cloakroom.qsrc 4.2 KB

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