pewtercity.asm 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. PewterCityScript:
  2. call EnableAutoTextBoxDrawing
  3. ld hl, PewterCityScriptPointers
  4. ld a, [wPewterCityCurScript]
  5. jp CallFunctionInTable
  6. PewterCityScriptPointers:
  7. dw PewterCityScript0
  8. dw PewterCityScript1
  9. dw PewterCityScript2
  10. dw PewterCityScript3
  11. dw PewterCityScript4
  12. dw PewterCityScript5
  13. dw PewterCityScript6
  14. PewterCityScript0:
  15. xor a
  16. ld [wMuseum1fCurScript], a
  17. ResetEvent EVENT_BOUGHT_MUSEUM_TICKET
  18. call PewterCityScript_1925e
  19. ret
  20. PewterCityScript_1925e:
  21. CheckEvent EVENT_BEAT_BROCK
  22. ret nz
  23. ld hl, CoordsData_19277
  24. call ArePlayerCoordsInArray
  25. ret nc
  26. ld a, $f0
  27. ld [wJoyIgnore], a
  28. ld a, $5
  29. ld [hSpriteIndexOrTextID], a
  30. jp DisplayTextID
  31. CoordsData_19277:
  32. db $11,$23
  33. db $11,$24
  34. db $12,$25
  35. db $13,$25
  36. db $ff
  37. PewterCityScript1:
  38. ld a, [wNPCMovementScriptPointerTableNum]
  39. and a
  40. ret nz
  41. ld a, $3
  42. ld [H_SPRITEINDEX], a
  43. ld a, SPRITE_FACING_UP
  44. ld [hSpriteFacingDirection], a
  45. call SetSpriteFacingDirectionAndDelay
  46. ld a, ($3 << 4) | SPRITE_FACING_UP
  47. ld [hSpriteImageIndex], a
  48. call SetSpriteImageIndexAfterSettingFacingDirection
  49. call PlayDefaultMusic
  50. ld hl, wFlags_0xcd60
  51. set 4, [hl]
  52. ld a, $d
  53. ld [hSpriteIndexOrTextID], a
  54. call DisplayTextID
  55. ld a, $3c
  56. ld [$ffeb], a
  57. ld a, $30
  58. ld [$ffec], a
  59. ld a, $c
  60. ld [$ffed], a
  61. ld a, $11
  62. ld [$ffee], a
  63. ld a, $3
  64. ld [wSpriteIndex], a
  65. call SetSpritePosition1
  66. ld a, $3
  67. ld [H_SPRITEINDEX], a
  68. ld de, MovementData_PewterMuseumGuyExit
  69. call MoveSprite
  70. ld a, $2
  71. ld [wPewterCityCurScript], a
  72. ret
  73. MovementData_PewterMuseumGuyExit:
  74. db NPC_MOVEMENT_DOWN
  75. db NPC_MOVEMENT_DOWN
  76. db NPC_MOVEMENT_DOWN
  77. db NPC_MOVEMENT_DOWN
  78. db $FF
  79. PewterCityScript2:
  80. ld a, [wd730]
  81. bit 0, a
  82. ret nz
  83. ld a, HS_MUSEUM_GUY
  84. ld [wMissableObjectIndex], a
  85. predef HideObject
  86. ld a, $3
  87. ld [wPewterCityCurScript], a
  88. ret
  89. PewterCityScript3:
  90. ld a, $3
  91. ld [wSpriteIndex], a
  92. call SetSpritePosition2
  93. ld a, HS_MUSEUM_GUY
  94. ld [wMissableObjectIndex], a
  95. predef ShowObject
  96. xor a
  97. ld [wJoyIgnore], a
  98. ld a, $0
  99. ld [wPewterCityCurScript], a
  100. ret
  101. PewterCityScript4:
  102. ld a, [wNPCMovementScriptPointerTableNum]
  103. and a
  104. ret nz
  105. ld a, $5
  106. ld [H_SPRITEINDEX], a
  107. ld a, SPRITE_FACING_LEFT
  108. ld [hSpriteFacingDirection], a
  109. call SetSpriteFacingDirectionAndDelay
  110. ld a, ($1 << 4) | SPRITE_FACING_LEFT
  111. ld [hSpriteImageIndex], a
  112. call SetSpriteImageIndexAfterSettingFacingDirection
  113. call PlayDefaultMusic
  114. ld hl, wFlags_0xcd60
  115. set 4, [hl]
  116. ld a, $e
  117. ld [hSpriteIndexOrTextID], a
  118. call DisplayTextID
  119. ld a, $3c
  120. ld [$ffeb], a
  121. ld a, $40
  122. ld [$ffec], a
  123. ld a, $16
  124. ld [$ffed], a
  125. ld a, $10
  126. ld [$ffee], a
  127. ld a, $5
  128. ld [wSpriteIndex], a
  129. call SetSpritePosition1
  130. ld a, $5
  131. ld [H_SPRITEINDEX], a
  132. ld de, MovementData_PewterGymGuyExit
  133. call MoveSprite
  134. ld a, $5
  135. ld [wPewterCityCurScript], a
  136. ret
  137. MovementData_PewterGymGuyExit:
  138. db NPC_MOVEMENT_RIGHT
  139. db NPC_MOVEMENT_RIGHT
  140. db NPC_MOVEMENT_RIGHT
  141. db NPC_MOVEMENT_RIGHT
  142. db NPC_MOVEMENT_RIGHT
  143. db $FF
  144. PewterCityScript5:
  145. ld a, [wd730]
  146. bit 0, a
  147. ret nz
  148. ld a, HS_GYM_GUY
  149. ld [wMissableObjectIndex], a
  150. predef HideObject
  151. ld a, $6
  152. ld [wPewterCityCurScript], a
  153. ret
  154. PewterCityScript6:
  155. ld a, $5
  156. ld [wSpriteIndex], a
  157. call SetSpritePosition2
  158. ld a, HS_GYM_GUY
  159. ld [wMissableObjectIndex], a
  160. predef ShowObject
  161. xor a
  162. ld [wJoyIgnore], a
  163. ld a, $0
  164. ld [wPewterCityCurScript], a
  165. ret
  166. PewterCityTextPointers:
  167. dw PewterCityText1
  168. dw PewterCityText2
  169. dw PewterCityText3
  170. dw PewterCityText4
  171. dw PewterCityText5
  172. dw PewterCityText6
  173. dw PewterCityText7
  174. dw MartSignText
  175. dw PokeCenterSignText
  176. dw PewterCityText10
  177. dw PewterCityText11
  178. dw PewterCityText12
  179. dw PewterCityText13
  180. dw PewterCityText14
  181. PewterCityText1:
  182. TX_FAR _PewterCityText1
  183. db "@"
  184. PewterCityText2:
  185. TX_FAR _PewterCityText2
  186. db "@"
  187. PewterCityText3:
  188. TX_ASM
  189. ld hl, PewterCityText_193f1
  190. call PrintText
  191. call YesNoChoice
  192. ld a, [wCurrentMenuItem]
  193. and a
  194. jr nz, .asm_193c9
  195. ld hl, PewterCityText_193f6
  196. call PrintText
  197. jr .asm_193ee
  198. .asm_193c9
  199. ld hl, PewterCityText_193fb
  200. call PrintText
  201. xor a
  202. ld [hJoyPressed], a
  203. ld [hJoyHeld], a
  204. ld [wNPCMovementScriptFunctionNum], a
  205. ld a, $2
  206. ld [wNPCMovementScriptPointerTableNum], a
  207. ld a, [H_LOADEDROMBANK]
  208. ld [wNPCMovementScriptBank], a
  209. ld a, $3
  210. ld [wSpriteIndex], a
  211. call GetSpritePosition2
  212. ld a, $1
  213. ld [wPewterCityCurScript], a
  214. .asm_193ee
  215. jp TextScriptEnd
  216. PewterCityText_193f1:
  217. TX_FAR _PewterCityText_193f1
  218. db "@"
  219. PewterCityText_193f6:
  220. TX_FAR _PewterCityText_193f6
  221. db "@"
  222. PewterCityText_193fb:
  223. TX_FAR _PewterCityText_193fb
  224. db "@"
  225. PewterCityText13:
  226. TX_FAR _PewterCityText13
  227. db "@"
  228. PewterCityText4:
  229. TX_ASM
  230. ld hl, PewterCityText_19427
  231. call PrintText
  232. call YesNoChoice
  233. ld a, [wCurrentMenuItem]
  234. cp $0
  235. jr nz, .asm_1941e
  236. ld hl, PewterCityText_1942c
  237. call PrintText
  238. jr .asm_19424
  239. .asm_1941e
  240. ld hl, PewterCityText_19431
  241. call PrintText
  242. .asm_19424
  243. jp TextScriptEnd
  244. PewterCityText_19427:
  245. TX_FAR _PewterCityText_19427
  246. db "@"
  247. PewterCityText_1942c:
  248. TX_FAR _PewterCityText_1942c
  249. db "@"
  250. PewterCityText_19431:
  251. TX_FAR _PewterCityText_19431
  252. db "@"
  253. PewterCityText5:
  254. TX_ASM
  255. ld hl, PewterCityText_1945d
  256. call PrintText
  257. xor a
  258. ld [hJoyHeld], a
  259. ld [wNPCMovementScriptFunctionNum], a
  260. ld a, $3
  261. ld [wNPCMovementScriptPointerTableNum], a
  262. ld a, [H_LOADEDROMBANK]
  263. ld [wNPCMovementScriptBank], a
  264. ld a, $5
  265. ld [wSpriteIndex], a
  266. call GetSpritePosition2
  267. ld a, $4
  268. ld [wPewterCityCurScript], a
  269. jp TextScriptEnd
  270. PewterCityText_1945d:
  271. TX_FAR _PewterCityText_1945d
  272. db "@"
  273. PewterCityText14:
  274. TX_FAR _PewterCityText14
  275. db "@"
  276. PewterCityText6:
  277. TX_FAR _PewterCityText6
  278. db "@"
  279. PewterCityText7:
  280. TX_FAR _PewterCityText7
  281. db "@"
  282. PewterCityText10:
  283. TX_FAR _PewterCityText10
  284. db "@"
  285. PewterCityText11:
  286. TX_FAR _PewterCityText11
  287. db "@"
  288. PewterCityText12:
  289. TX_FAR _PewterCityText12
  290. db "@"