viridiancity.asm 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. ViridianCityScript:
  2. call EnableAutoTextBoxDrawing
  3. ld hl, ViridianCityScriptPointers
  4. ld a, [wViridianCityCurScript]
  5. jp CallFunctionInTable
  6. ViridianCityScriptPointers:
  7. dw ViridianCityScript0
  8. dw ViridianCityScript1
  9. dw ViridianCityScript2
  10. dw ViridianCityScript3
  11. ViridianCityScript0:
  12. call ViridianCityScript_1900b
  13. jp ViridianCityScript_1903d
  14. ViridianCityScript_1900b:
  15. CheckEvent EVENT_VIRIDIAN_GYM_OPEN
  16. ret nz
  17. ld a, [wObtainedBadges]
  18. cp %01111111
  19. jr nz, .asm_1901e
  20. SetEvent EVENT_VIRIDIAN_GYM_OPEN
  21. ret
  22. .asm_1901e
  23. ld a, [wYCoord]
  24. cp $8
  25. ret nz
  26. ld a, [wXCoord]
  27. cp $20
  28. ret nz
  29. ld a, $e
  30. ld [hSpriteIndexOrTextID], a
  31. call DisplayTextID
  32. xor a
  33. ld [hJoyHeld], a
  34. call ViridianCityScript_190cf
  35. ld a, $3
  36. ld [wViridianCityCurScript], a
  37. ret
  38. ViridianCityScript_1903d:
  39. CheckEvent EVENT_GOT_POKEDEX
  40. ret nz
  41. ld a, [wYCoord]
  42. cp $9
  43. ret nz
  44. ld a, [wXCoord]
  45. cp $13
  46. ret nz
  47. ld a, $5
  48. ld [hSpriteIndexOrTextID], a
  49. call DisplayTextID
  50. xor a
  51. ld [hJoyHeld], a
  52. call ViridianCityScript_190cf
  53. ld a, $3
  54. ld [wViridianCityCurScript], a
  55. ret
  56. ViridianCityScript1:
  57. ld a, [wSpriteStateData1 + $34]
  58. ld [$ffeb], a
  59. ld a, [wSpriteStateData1 + $36]
  60. ld [$ffec], a
  61. ld a, [wSpriteStateData2 + $34]
  62. ld [$ffed], a
  63. ld a, [wSpriteStateData2 + $35]
  64. ld [$ffee], a
  65. xor a
  66. ld [wListScrollOffset], a
  67. ; set up battle for Old Man
  68. ld a, BATTLE_TYPE_OLD_MAN
  69. ld [wBattleType], a
  70. ld a, 5
  71. ld [wCurEnemyLVL], a
  72. ld a, WEEDLE
  73. ld [wCurOpponent], a
  74. ld a, $2
  75. ld [wViridianCityCurScript], a
  76. ret
  77. ViridianCityScript2:
  78. ld a, [$ffeb]
  79. ld [wSpriteStateData1 + $34], a
  80. ld a, [$ffec]
  81. ld [wSpriteStateData1 + $36], a
  82. ld a, [$ffed]
  83. ld [wSpriteStateData2 + $34], a
  84. ld a, [$ffee]
  85. ld [wSpriteStateData2 + $35], a
  86. call UpdateSprites
  87. call Delay3
  88. xor a
  89. ld [wJoyIgnore], a
  90. ld a, $f
  91. ld [hSpriteIndexOrTextID], a
  92. call DisplayTextID
  93. xor a
  94. ld [wBattleType], a
  95. ld [wJoyIgnore], a
  96. ld a, $0
  97. ld [wViridianCityCurScript], a
  98. ret
  99. ViridianCityScript3:
  100. ld a, [wSimulatedJoypadStatesIndex]
  101. and a
  102. ret nz
  103. call Delay3
  104. ld a, 0
  105. ld [wViridianCityCurScript], a
  106. ret
  107. ViridianCityScript_190cf:
  108. call StartSimulatingJoypadStates
  109. ld a, $1
  110. ld [wSimulatedJoypadStatesIndex], a
  111. ld a, D_DOWN
  112. ld [wSimulatedJoypadStatesEnd], a
  113. xor a
  114. ld [wSpriteStateData1 + 9], a
  115. ld [wJoyIgnore], a
  116. ret
  117. ViridianCityTextPointers:
  118. dw ViridianCityText1
  119. dw ViridianCityText2
  120. dw ViridianCityText3
  121. dw ViridianCityText4
  122. dw ViridianCityText5
  123. dw ViridianCityText6
  124. dw ViridianCityText7
  125. dw ViridianCityText8
  126. dw ViridianCityText9
  127. dw ViridianCityText10
  128. dw MartSignText
  129. dw PokeCenterSignText
  130. dw ViridianCityText13
  131. dw ViridianCityText14
  132. dw ViridianCityText15
  133. ViridianCityText1:
  134. TX_FAR _ViridianCityText1
  135. db "@"
  136. ViridianCityText2:
  137. TX_ASM
  138. ld a, [wObtainedBadges]
  139. cp %01111111
  140. ld hl, ViridianCityText_19127
  141. jr z, .asm_ae9fe
  142. CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
  143. jr nz, .asm_ae9fe
  144. ld hl, ViridianCityText_19122
  145. .asm_ae9fe
  146. call PrintText
  147. jp TextScriptEnd
  148. ViridianCityText_19122:
  149. TX_FAR _ViridianCityText_19122
  150. db "@"
  151. ViridianCityText_19127:
  152. TX_FAR _ViridianCityText_19127
  153. db "@"
  154. ViridianCityText3:
  155. TX_ASM
  156. ld hl, ViridianCityText_1914d
  157. call PrintText
  158. call YesNoChoice
  159. ld a, [wCurrentMenuItem]
  160. and a
  161. jr nz, .asm_6dfea
  162. ld hl, ViridianCityText_19157
  163. call PrintText
  164. jr .asm_d611f
  165. .asm_6dfea
  166. ld hl, ViridianCityText_19152
  167. call PrintText
  168. .asm_d611f
  169. jp TextScriptEnd
  170. ViridianCityText_1914d:
  171. TX_FAR _ViridianCityText_1914d
  172. db "@"
  173. ViridianCityText_19152:
  174. TX_FAR _ViridianCityText_19152
  175. db "@"
  176. ViridianCityText_19157:
  177. TX_FAR _ViridianCityText_19157
  178. db "@"
  179. ViridianCityText4:
  180. TX_ASM
  181. CheckEvent EVENT_GOT_POKEDEX
  182. jr nz, .asm_83894
  183. ld hl, ViridianCityText_19175
  184. call PrintText
  185. jr .asm_700a6
  186. .asm_83894
  187. ld hl, ViridianCityText_1917a
  188. call PrintText
  189. .asm_700a6
  190. jp TextScriptEnd
  191. ViridianCityText_19175:
  192. TX_FAR _ViridianCityText_19175
  193. db "@"
  194. ViridianCityText_1917a:
  195. TX_FAR _ViridianCityText_1917a
  196. db "@"
  197. ViridianCityText5:
  198. TX_ASM
  199. ld hl, ViridianCityText_19191
  200. call PrintText
  201. call ViridianCityScript_190cf
  202. ld a, $3
  203. ld [wViridianCityCurScript], a
  204. jp TextScriptEnd
  205. ViridianCityText_19191:
  206. TX_FAR _ViridianCityText_19191
  207. db "@"
  208. ViridianCityText6:
  209. TX_ASM
  210. CheckEvent EVENT_GOT_TM42
  211. jr nz, .asm_4e5a0
  212. ld hl, ViridianCityText_191ca
  213. call PrintText
  214. lb bc, TM_42, 1
  215. call GiveItem
  216. jr nc, .BagFull
  217. ld hl, ReceivedTM42Text
  218. call PrintText
  219. SetEvent EVENT_GOT_TM42
  220. jr .asm_3c73c
  221. .BagFull
  222. ld hl, TM42NoRoomText
  223. call PrintText
  224. jr .asm_3c73c
  225. .asm_4e5a0
  226. ld hl, TM42Explanation
  227. call PrintText
  228. .asm_3c73c
  229. jp TextScriptEnd
  230. ViridianCityText_191ca:
  231. TX_FAR _ViridianCityText_191ca
  232. db "@"
  233. ReceivedTM42Text:
  234. TX_FAR _ReceivedTM42Text
  235. TX_SFX_ITEM_2
  236. db "@"
  237. TM42Explanation:
  238. TX_FAR _TM42Explanation
  239. db "@"
  240. TM42NoRoomText:
  241. TX_FAR _TM42NoRoomText
  242. db "@"
  243. ViridianCityText7:
  244. TX_ASM
  245. ld hl, ViridianCityText_1920a
  246. call PrintText
  247. ld c, 2
  248. call DelayFrames
  249. call YesNoChoice
  250. ld a, [wCurrentMenuItem]
  251. and a
  252. jr z, .asm_42f68
  253. ld hl, ViridianCityText_1920f
  254. call PrintText
  255. ld a, $1
  256. ld [wViridianCityCurScript], a
  257. jr .asm_2413a
  258. .asm_42f68
  259. ld hl, ViridianCityText_19214
  260. call PrintText
  261. .asm_2413a
  262. jp TextScriptEnd
  263. ViridianCityText_1920a:
  264. TX_FAR _ViridianCityText_1920a
  265. db "@"
  266. ViridianCityText_1920f:
  267. TX_FAR _ViridianCityText_1920f
  268. db "@"
  269. ViridianCityText_19214:
  270. TX_FAR _ViridianCityText_19214
  271. db "@"
  272. ViridianCityText15:
  273. TX_FAR _ViridianCityText_19219
  274. db "@"
  275. ViridianCityText8:
  276. TX_FAR _ViridianCityText8
  277. db "@"
  278. ViridianCityText9:
  279. TX_FAR _ViridianCityText9
  280. db "@"
  281. ViridianCityText10:
  282. TX_FAR _ViridianCityText10
  283. db "@"
  284. ViridianCityText13:
  285. TX_FAR _ViridianCityText13
  286. db "@"
  287. ViridianCityText14:
  288. TX_FAR _ViridianCityText14
  289. db "@"