cloakroom.qsrc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. # cloakroom
  2. menu_off = 1
  3. $coat_list_line = {
  4. !! a single line in a clothing list (wardrobe, etc)
  5. !! ARGS 0 - clothing index
  6. if Enable_clothwidth > 0:
  7. clothing_temp = Enable_clothwidth - 1
  8. else
  9. clothing_temp = 150 & !clothing widdefault to 150
  10. end
  11. gs 'themes', 'clothing', 1
  12. $RESULT = '<TR bgcolor='+$bgcolor+'>'
  13. $RESULT +='<TD><a href="exec:gt ''cloakroom'', ''view_coat_item'', <<ARGS[0]>>"><img src="<<FUNC(''$clothing_image'', ''coat'', ARGS[0])>>" width="<<clothing_temp>>"></a></TD>'
  14. $RESULT += '<TD>Coat # <<ARGS[0]>><br>strength: ' + dyneval '$RESULT += coat_h[<<ARGS[0]>>]'+'</TD>'
  15. $RESULT += '<TD>' + FUNC('$clothing_name', 'coat', ARGS[0]) + '</TD>'
  16. $RESULT += '<TD><a href="exec:gt ''cloakroom'', ''view_coat_item'', <<ARGS[0]>>">View</a></TD>'
  17. if coat_h[i] > 0:
  18. $RESULT += '<TD><a href="exec:defaultcoat = ''<<i>>'' & gt ''cloakroom'', ''view_coat_list''">Wear</a></TD>'
  19. end
  20. $RESULT += '<TD>'
  21. if i = defaultcoat:
  22. $RESULT += 'Yes'
  23. end
  24. $RESULT += '</TD>'
  25. $RESULT += '<TD>'
  26. if dyneval('RESULT = coat_s[<<ARGS[0]>>]') = 0:$RESULT += ' <a href="exec:gt ''cloakroom'', ''dest'', <<ARGS[0]>>">Keep</a>'
  27. if dyneval('RESULT = coat_s[<<ARGS[0]>>]') = 2:$RESULT += ' <a href="exec:gt ''cloakroom'', ''dest1'', <<ARGS[0]>>">Unwanted</a>'
  28. $RESULT += '</TD>'}
  29. if $ARGS[0] = 'dest':
  30. *clr
  31. dynamic 'coat_s[<<ARGS[1]>>] = 2'
  32. gt 'cloakroom', 'view_coat_list'
  33. end
  34. if $ARGS[0] = 'dest1':
  35. *clr
  36. dynamic 'coat_s[<<ARGS[1]>>] = 0'
  37. gt 'cloakroom', 'view_coat_list'
  38. end
  39. if $ARGS[0] = 'clothwidth':
  40. act 'Set image height for this view':
  41. Enable_clothwidth = input("Enter height in pixels you want for images on this page <br>(Default 150, min 50, max 500)")
  42. if Enable_clothwidth < 50:
  43. Enable_clothwidth = 50
  44. elseif Enable_clothwidth > 500:
  45. Enable_clothwidth = 500
  46. end
  47. gt 'cloakroom', 'view_coat_list'
  48. end
  49. end
  50. if $ARGS[0] = 'view_coat_list':
  51. '<h3><center><b><font color="maroon">Wardrobe</font></b></center></h3>'
  52. '<center>These are the coats that are currently available for you to wear.</center>'
  53. *nl
  54. if defaultcoat = 0:
  55. '<center>You will not wear a coat when outside in the cold.</center>'
  56. else
  57. '<center>You will wear Coat<<defaultcoat>> when a coat is required.</center>'
  58. end
  59. *nl
  60. gs 'themes', 'clothing', 2
  61. '<table><table border=0 cellspacing=0 cellpadding=5><TH></TH><TH>Item no.</TH><TH>Description</TH><TH>Large image</TH><TH>Set as default</TH><TH>Default</TH><TH>Set for sale</TH>'
  62. i = 1
  63. :loopcoat
  64. if coat[i] = 1:*p dyneval($coat_list_line, i)
  65. i += 1
  66. if i <= ARRSIZE('coat'):jump 'loopcoat'
  67. '</table>'
  68. act 'Return':gt 'wardrobe', 'start'
  69. if defaultcoat ! 0:
  70. act 'Remove coat':
  71. defaultcoat_warmth = 0
  72. defaultcoat_quality = 0
  73. defaultcoat = 0
  74. gt 'cloakroom', 'view_coat_list'
  75. end
  76. end
  77. gs 'cloakroom', 'clothwidth'
  78. end
  79. if $ARGS[0] = 'view_coat_item':
  80. !! ARGS 0 - view_clothing_item
  81. !! ARGS 1 - clothing index
  82. cla
  83. '<center><img <<$set_imgh>> src="<<FUNC(''$clothing_image'', ''coat'', ARGS[1])>>"></center>'
  84. 'coat no.<<ARGS[1]>>'
  85. FUNC('$attributes_coat', coat, ARGS[1])
  86. FUNC('$clothing_name', coat, ARGS[1])
  87. $RESULT = '(strength '
  88. dynamic '$RESULT += coat_h[<<ARGS[1]>>]'
  89. $RESULT += ')'
  90. '<<$RESULT>>'
  91. !! if the clothing is worn out
  92. if dyneval('RESULT = coat_h[<<ARGS[1]>>]') <= 0:
  93. 'This item is worn and is not suitable for further wear.'
  94. act 'Throw it away':
  95. dynamic 'coat[<<ARGS[1]>>] = 0'
  96. gt 'cloakroom', 'view_coat_list', 'coat'
  97. end
  98. end
  99. act 'Return':gt 'cloakroom', 'view_coat_list'
  100. if defaultcoat ! '<<ARGS[1]>>':
  101. act 'Wear this coat':
  102. defaultcoat = '<<ARGS[1]>>'
  103. defaultcoat_warmth = CloWarm
  104. defaultcoat_quality = CloQuality
  105. gt 'wardrobe', 'start'
  106. end
  107. end
  108. end
  109. --- cloakroom ---------------------------------