cloakroom.qsrc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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 += coatH[<<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 coatH[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 = coatS[<<ARGS[0]>>]') = 0:$RESULT += ' <a href="exec:gt ''cloakroom'', ''dest'', <<ARGS[0]>>">Keep</a>'
  27. if dyneval('RESULT = coatS[<<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 'coatS[<<ARGS[1]>>] = 2'
  32. gt 'cloakroom', 'view_coat_list'
  33. end
  34. if $ARGS[0] = 'dest1':
  35. *clr
  36. dynamic 'coatS[<<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 = 0
  73. gt 'cloakroom', 'view_coat_list'
  74. end
  75. end
  76. gs 'cloakroom', 'clothwidth'
  77. end
  78. if $ARGS[0] = 'view_coat_item':
  79. !! ARGS 0 - view_clothing_item
  80. !! ARGS 1 - clothing index
  81. cla
  82. '<center><img <<$set_imgh>> src="<<FUNC(''$clothing_image'', ''coat'', ARGS[1])>>"></center>'
  83. 'coat no.<<ARGS[1]>>'
  84. FUNC('$attributes_coat', coat, ARGS[1])
  85. FUNC('$clothing_name', coat, ARGS[1])
  86. $RESULT = '(strength '
  87. dynamic '$RESULT += coatH[<<ARGS[1]>>]'
  88. $RESULT += ')'
  89. '<<$RESULT>>'
  90. !! if the clothing is worn out
  91. if dyneval('RESULT = coatH[<<ARGS[1]>>]') <= 0:
  92. 'This item is worn and is not suitable for further wear.'
  93. act 'Throw it away':
  94. dynamic 'coat[<<ARGS[1]>>] = 0'
  95. gt 'cloakroom', 'view_coat_list', 'coat'
  96. end
  97. end
  98. act 'Return':gt 'cloakroom', 'view_coat_list'
  99. if defaultcoat ! '<<ARGS[1]>>':
  100. act 'Wear this coat':
  101. defaultcoat = '<<ARGS[1]>>'
  102. if defaultcoat < 4:
  103. defaultcoat_warmth = 1
  104. elseif defaultcoat = 4 or defaultcoat = 5 or defaultcoat = 8 or defaultcoat = 10 or defaultcoat = 12 or defaultcoat = 13 or defaultcoat = 14 or defaultcoat = 16 or defaultcoat = 17 or defaultcoat = 18 or defaultcoat = 19:
  105. defaultcoat_warmth = 2
  106. elseif defaultcoat = 6 or defaultcoat = 7 or defaultcoat = 9 or defaultcoat = 11 or defaultcoat = 15:
  107. defaultcoat_warmth = 3
  108. end
  109. gt 'wardrobe', 'start'
  110. end
  111. end
  112. end
  113. --- cloakroom ---------------------------------