coats.qsrc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. # coats
  2. !!gs 'coats', 'remove'
  3. !!To remove coat and store them
  4. !!gs 'coats', 'wear', 'type', 'number'
  5. !!To wear coat - There is no previous worn stored as this is only specified through cloakroom/wardrobe
  6. menu_off = 1
  7. if $ARGS[0] = 'remove':
  8. $coatworntype = 'none'
  9. coatwornnumber = 0
  10. end
  11. if $ARGS[0] = 'wear':
  12. $coatworntype = $ARGS[1]
  13. coatwornnumber = ARGS[2]
  14. dynamic $ARGS[1] + '_w[<<ARGS[2]>>] = 1'
  15. end
  16. if $ARGS[0] = 'view_coat_list':
  17. !! ARGS 0 - view_coat_list
  18. !! ARGS 1 - action type (clean, dirty, store, bathroom)
  19. if $ARGS[1] ! 'bathroom':
  20. act 'Return': gt 'wardrobe', 'start'
  21. else
  22. act 'Return': gt $loc, $loc_arg
  23. end
  24. if $ARGS[1] = 'wardrobe':
  25. coat_loc = 0
  26. end
  27. if $ARGS[1] = 'store':
  28. coat_loc = 1
  29. end
  30. if $ARGS[1] = 'unwanted':
  31. coat_loc = 2
  32. end
  33. '<center><table border=1><TH><a href="exec:gt ''coats'', ''view_coat_list'', ''wardrobe''">Draw</a></TH><TH><a href="exec:gt ''coats'', ''view_coat_list'', ''store''">Storage</a></TH><TH><a href="exec:gt ''coats'', ''view_coat_list'', ''unwanted''">Unwanted</a></TH></center>'
  34. if $coatworntype ! 'none':act 'Remove coat':gs 'coats', 'remove' & gt 'coats', 'view_coat_list', $ARGS[1]
  35. if $ARGS[1] = 'store':
  36. cloc = 1
  37. end
  38. if ARRSIZE('gm_coats') > 0:
  39. '<center><img src="images/locations/city/citycenter/mall/gm.png"></a></center>'
  40. i = 1
  41. :loopgmcoat
  42. if gm_coats_s[i] = coat_loc and gm_coats[i] = 1:*p '<a href="exec:gt ''coats'', ''view_coat_item'', ''<<$ARGS[1]>>'', ''gm'', <<i>>"><img src="images/pc/items/gm/coats/<<i>>.jpg" height="150" /></a>'
  43. i += 1
  44. if i <= ARRSIZE('gm_coats'):jump 'loopgmcoat'
  45. end
  46. if ARRSIZE('cats_coats') > 0:
  47. '<center><img src="images/locations/city/citycenter/mall/pussycat.png"></center>'
  48. i = 1
  49. :loopcatscoat
  50. if cats_coats_s[i] = coat_loc and cats_coats[i] = 1:*p '<a href="exec:gt ''coats'', ''view_coat_item'', ''<<$ARGS[1]>>'', ''cats'', <<i>>"><img src="images/pc/items/cats/coats/<<i>>.jpg" height="150" /></a>'
  51. i += 1
  52. if i <= ARRSIZE('cats_coats'):jump 'loopcatscoat'
  53. end
  54. if ARRSIZE('moncheri_coats') > 0:
  55. '<center><img src="images/locations/city/citycenter/mall/moncheri.png"></center>'
  56. i = 1
  57. :loopmonchericoat
  58. if moncheri_coats_s[i] = coat_loc and moncheri_coats[i] = 1:*p '<a href="exec:gt ''coats'', ''view_coat_item'', ''<<$ARGS[1]>>'', ''moncheri'', <<i>>"><img src="images/pc/items/moncheri/coats/<<i>>.jpg" height="150" /></a>'
  59. i += 1
  60. if i <= ARRSIZE('moncheri_coats'):jump 'loopmonchericoat'
  61. end
  62. if ARRSIZE('dolls_coats') > 0:
  63. '<center><img src="images/locations/city/island/dolls.png"></center>'
  64. i = 1
  65. :loopdollscoat
  66. if dolls_coats_s[i] = coat_loc and dolls_coats[i] = 1:*p '<a href="exec:gt ''coats'', ''view_coat_item'', ''<<$ARGS[1]>>'', ''dolls'', <<i>>"><img src="images/pc/items/dolls/coats/<<i>>.jpg" height="150" /></a>'
  67. i += 1
  68. if i <= ARRSIZE('dolls_coats'):jump 'loopdollscoat'
  69. end
  70. if ARRSIZE('bomba_coats') > 0:
  71. '<center><img src="images/locations/oldtown/bomba/shop_name.png"></center>'
  72. i = 1
  73. :loopbombacoat
  74. if bomba_coats_s[i] = coat_loc and bomba_coats[i] = 1:*p '<a href="exec:gt ''coats'', ''view_coat_item'', ''<<$ARGS[1]>>'', ''bomba'', <<i>>"><img src="images/pc/items/bomba/coats/<<i>>.jpg" height="150" /></a>'
  75. i += 1
  76. if i <= ARRSIZE('bomba_coats'):jump 'loopbombacoat'
  77. end
  78. if ARRSIZE('danilovich_coats') > 0:
  79. '<center><img src="images/locations/city/citycenter/mall/sports.png"></center>'
  80. i = 1
  81. :loopdanilovichcoat
  82. if danilovich_coats_s[i] = coat_loc and danilovich_coats[i] = 1:*p '<a href="exec:gt ''coats'', ''view_coat_item'', ''<<$ARGS[1]>>'', ''danilovich'', <<i>>"><img src="images/pc/items/danilovich/coats/<<i>>.jpg" height="150" /></a>'
  83. i += 1
  84. if i <= ARRSIZE('danilovich_coats'):jump 'loopdanilovichcoat'
  85. end
  86. end
  87. if $ARGS[0] = 'view_coat_item':
  88. !! ARGS 0 - view_coat_item
  89. !! ARGS 1 = action type (draw, shop)
  90. !! ARGS 2 - coat type
  91. !! ARGS 3 - coat index
  92. !! ARGS 4 - price for shop
  93. cla
  94. '<center><img src="<<FUNC(''$coat_image'', $ARGS[2], ARGS[3])>>"></center>'
  95. gs 'coat_attributes', $ARGS[2], ARGS[3]
  96. $coat_description
  97. if $ARGS[1] = 'shop':
  98. if dyneval('RESULT = <<$ARGS[2]>>_coats[<<ARGS[3]>>]') = 1:
  99. 'You already own this item.'
  100. act 'Leave': gt $loc, $loc_arg
  101. else
  102. price = ARGS[4]
  103. 'Price: <<ARGS[4]>> <b>₽</b>'
  104. act 'Leave': gt $loc, $loc_arg
  105. if money >= price:
  106. act 'Buy (cash)':
  107. money -= price
  108. dynamic $ARGS[2] + '_coats[<<ARGS[3]>>] = 1'
  109. dynamic $ARGS[2] + '_coats_s[<<ARGS[3]>>] = 0'
  110. gt $loc, $loc_arg
  111. end
  112. else
  113. 'You do not have enough cash to buy these coat.'
  114. end
  115. if karta + bankDebtLimit >= price:
  116. act 'Buy (card)':
  117. karta -= price
  118. dynamic $ARGS[2] + '_coats[<<ARGS[3]>>] = 1'
  119. dynamic $ARGS[2] + '_coats_s[<<ARGS[3]>>] = 0'
  120. gt $loc, $loc_arg
  121. end
  122. else
  123. 'You do not have enough money in your bank to buy these coat.'
  124. end
  125. end
  126. else
  127. if $ARGS[1] ! 'bathroom':
  128. if coat_loc ! 1:$RESULT += 'Move these coat to <a href="exec:gt ''coats'', ''dest1'', ''<<$ARGS[1]>>'', ''<<$ARGS[2]>>'', <<ARGS[3]>>">Storage</a><BR>'
  129. if coat_loc ! 0:$RESULT += 'Move these coat to <a href="exec:gt ''coats'', ''dest0'', ''<<$ARGS[1]>>'', ''<<$ARGS[2]>>'', <<ARGS[3]>>">Wardrobe</a><BR>'
  130. if coat_loc ! 2:$RESULT += 'Move these coat to <a href="exec:gt ''coats'', ''dest2'', ''<<$ARGS[1]>>'', ''<<$ARGS[2]>>'', <<ARGS[3]>>">Unwanted</a>'
  131. end
  132. act 'Return':gt 'coats', 'view_coat_list', $ARGS[1]
  133. if $ARGS[1] = 'store':
  134. 'These coat are in storage.'
  135. elseif $ARGS[1] = 'unwanted':
  136. 'These coat are unwanted.'
  137. else
  138. if $coatworntype = $ARGS[2] and coatwornnumber = ARGS[3]:
  139. 'You are wearing this coat.'
  140. else
  141. if coat_loc = 0:
  142. act 'Wear':
  143. gs 'coats', 'wear', $ARGS[2], ARGS[3]
  144. if $ARGS[1] = 'wardrobe':
  145. gt 'wardrobe', 'start'
  146. else
  147. gt $loc, $loc_arg
  148. end
  149. end
  150. end
  151. end
  152. end
  153. if $ARGS[1] ! 'store':
  154. act 'Move to storage': gt 'coats', 'dest1', $ARGS[1], $ARGS[2], ARGS[3]
  155. end
  156. if $ARGS[1] ! 'unwanted':
  157. act 'Move to unwanted': gt 'coats', 'dest2', $ARGS[1], $ARGS[2], ARGS[3]
  158. end
  159. if $ARGS[1] ! 'wardrobe':
  160. act 'Move to wardrobe': gt 'coats', 'dest0', $ARGS[1], $ARGS[2], ARGS[3]
  161. end
  162. end
  163. end
  164. if $ARGS[0] = 'dest0':
  165. *clr
  166. dynamic '<<$ARGS[2]>>_coats_s[<<ARGS[3]>>] = 0'
  167. gt 'coats', 'view_coat_item', $ARGS[1], $ARGS[2], ARGS[3]
  168. end
  169. if $ARGS[0] = 'dest1':
  170. *clr
  171. dynamic '<<$ARGS[2]>>_coats_s[<<ARGS[3]>>] = 1'
  172. gt 'coats', 'view_coat_item', $ARGS[1], $ARGS[2], ARGS[3]
  173. end
  174. if $ARGS[0] = 'dest2':
  175. *clr
  176. dynamic '<<$ARGS[2]>>_coats_s[<<ARGS[3]>>] = 2'
  177. gt 'coats', 'view_coat_item', $ARGS[1], $ARGS[2], ARGS[3]
  178. end
  179. --- coats ---------------------------------