1
0

cloakroom 2.9 KB

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