1
0

cloakroom 3.0 KB

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