cloakroom.qsrc 4.0 KB

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