coats.qsrc 6.7 KB

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