coats.qsrc 7.0 KB

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