cloakroom 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 ''clothing'', ''view_clothing_item'', ''wardrobe'', ''coat'', <<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 have not chosen a coat to wear.</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 = 0
  56. '</table>'
  57. act 'Leave':gt $loc, $metka
  58. end
  59. if $ARGS[0] = 'view_coat_item':
  60. !! ARGS 0 - view_clothing_item
  61. !! ARGS 1 - clothing index
  62. cla
  63. '<center><img <<$set_imgh>> src="<<FUNC(''$clothing_image'', ''coat'', ARGS[1])>>"></center>'
  64. 'coat no.<<ARGS[1]>>'
  65. FUNC('$attributes_coat', coat, ARGS[1])
  66. FUNC('$clothing_name', coat, ARGS[1])
  67. $RESULT = '(strength '
  68. dynamic '$RESULT += coatH[<<ARGS[1]>>]'
  69. $RESULT += ')'
  70. '<<$RESULT>>'
  71. act 'Return':gt 'cloakroom', 'view_coat_list'
  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 'Set as default':
  82. defaultcoat = '<<ARGS[1]>>'
  83. end
  84. end
  85. end
  86. --- cloakroom ---------------------------------