1
0

cloakroom 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # cloakroom
  2. $coat_list_line = {
  3. !! a single line in a clothing list (wardrobe, etc)
  4. !! ARGS 0 - clothing index
  5. if night_mode = 1:
  6. $bgcolor = iif($bgcolor='#0C0B11','#000000','#0C0B11')
  7. else
  8. $bgcolor = iif($bgcolor='#f3f4ee','#ffffff','#f3f4ee')
  9. end
  10. $RESULT = '<TR bgcolor='+$bgcolor+'>'
  11. $RESULT +='<TD><a href="exec:gt ''cloakroom'', ''view_coat_item'', <<ARGS[0]>>"><img <<$set_imgh>> src="<<FUNC(''$clothing_image'', ''coat'', ARGS[0])>>" width="75"></a></TD>'
  12. $RESULT += '<TD>coat no.<<ARGS[0]>> (strength ' + dyneval '$RESULT += coatH[<<ARGS[0]>>]'+')</TD>'
  13. $RESULT += '<TD>' + FUNC('$clothing_name', 'coat', ARGS[0]) + '</TD>'
  14. $RESULT += '<TD><a href="exec:gt ''cloakroom'', ''view_coat_item'', <<ARGS[0]>>">View</a></TD>'
  15. if coatH[i] > 0:
  16. $RESULT += '<TD><a href="exec:defaultcoat = ''<<i>>'' & gt ''cloakroom'', ''view_coat_list''">Select</a></TD>'
  17. end
  18. $RESULT += '<TD>'
  19. if i = defaultcoat:
  20. $RESULT += '<font color="navy">Yes</font>'
  21. end
  22. $RESULT += '</TD>'
  23. $RESULT += '<TD>'
  24. if dyneval('RESULT = coatS[<<ARGS[0]>>]') = 0:$RESULT += ' <a href="exec:gt ''cloakroom'', ''dest'', <<ARGS[0]>>">Keep</a>'
  25. if dyneval('RESULT = coatS[<<ARGS[0]>>]') = 2:$RESULT += ' <a href="exec:gt ''cloakroom'', ''dest1'', <<ARGS[0]>>">Unwanted</a>'
  26. $RESULT += '</TD>'}
  27. if $ARGS[0] = 'dest':
  28. *clr
  29. dynamic 'coatS[<<ARGS[1]>>] = 2'
  30. gt 'cloakroom', 'view_coat_list'
  31. end
  32. if $ARGS[0] = 'dest1':
  33. *clr
  34. dynamic 'coatS[<<ARGS[1]>>] = 0'
  35. gt 'cloakroom', 'view_coat_list'
  36. end
  37. if $ARGS[0] = 'view_coat_list':
  38. '<center><table border=1><TH>Cloakroom</TH></table></center>'
  39. if defaultcoat = 0:
  40. '<center>You will not wear a coat when outside in the cold.</center>'
  41. else
  42. '<center>You will wear Coat<<defaultcoat>> when a coat is required.</center>'
  43. end
  44. if night_mode = 1:
  45. $bgcolor = '#0C0B11'
  46. else
  47. $bgcolor='#f3f4ee'
  48. end
  49. '<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>'
  50. i = 1
  51. :loopcoat
  52. if coat[i] = 1:*p dyneval($coat_list_line, i)
  53. i += 1
  54. if i <= ARRSIZE('coat'):jump 'loopcoat'
  55. act 'Don''t wear a coat':defaultcoat_warmth = 0 & defaultcoat = 0
  56. '</table>'
  57. act 'Return to overview':gt 'wardrobe'
  58. act 'Leave': gt $loc, $metka
  59. end
  60. if $ARGS[0] = 'view_coat_item':
  61. !! ARGS 0 - view_clothing_item
  62. !! ARGS 1 - clothing index
  63. cla
  64. '<center><img <<$set_imgh>> src="<<FUNC(''$clothing_image'', ''coat'', ARGS[1])>>"></center>'
  65. 'coat no.<<ARGS[1]>>'
  66. FUNC('$attributes_coat', coat, ARGS[1])
  67. FUNC('$clothing_name', coat, ARGS[1])
  68. $RESULT = '(strength '
  69. dynamic '$RESULT += coatH[<<ARGS[1]>>]'
  70. $RESULT += ')'
  71. '<<$RESULT>>'
  72. !! if the clothing is worn out
  73. if dyneval('RESULT = coatH[<<ARGS[1]>>]') <= 0:
  74. 'This item is worn and is not suitable for further wear.'
  75. act 'Throw it away':
  76. dynamic 'coat[<<ARGS[1]>>] = 0'
  77. gt 'cloakroom', 'view_coat_list', 'coat'
  78. end
  79. end
  80. if defaultcoat ! '<<ARGS[1]>>':
  81. act 'Wear this coat when outdoors in the cold':
  82. defaultcoat = '<<ARGS[1]>>'
  83. if defaultcoat < 4:
  84. defaultcoat_warmth = 1
  85. 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:
  86. defaultcoat_warmth = 2
  87. elseif defaultcoat = 6 or defaultcoat = 7 or defaultcoat = 9 or defaultcoat = 11 or defaultcoat = 15:
  88. defaultcoat_warmth = 3
  89. end
  90. gt 'wardrobe'
  91. end
  92. end
  93. act 'Return to coats':gt 'cloakroom', 'view_coat_list'
  94. act 'Return to overview':gt 'wardrobe'
  95. act 'Leave': gt $loc, $metka
  96. end
  97. --- cloakroom ---------------------------------