cloakroom.qsrc 4.4 KB

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