coats.qsrc 6.9 KB

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