route20.asm 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. Route20Script:
  2. CheckAndResetEvent EVENT_IN_SEAFOAM_ISLANDS
  3. call nz, Route20Script_50cc6
  4. call EnableAutoTextBoxDrawing
  5. ld hl, Route20TrainerHeader0
  6. ld de, Route20ScriptPointers
  7. ld a, [wRoute20CurScript]
  8. call ExecuteCurMapScriptInTable
  9. ld [wRoute20CurScript], a
  10. ret
  11. Route20Script_50cc6:
  12. CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE
  13. jr z, .asm_50cef
  14. ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1
  15. call Route20Script_50d0c
  16. ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_2
  17. call Route20Script_50d0c
  18. ld hl, .MissableObjectIDs
  19. .asm_50cdc
  20. ld a, [hli]
  21. cp $ff
  22. jr z, .asm_50cef
  23. push hl
  24. call Route20Script_50d14
  25. pop hl
  26. jr .asm_50cdc
  27. .MissableObjectIDs:
  28. db HS_SEAFOAM_ISLANDS_2_BOULDER_1
  29. db HS_SEAFOAM_ISLANDS_2_BOULDER_2
  30. db HS_SEAFOAM_ISLANDS_3_BOULDER_1
  31. db HS_SEAFOAM_ISLANDS_3_BOULDER_2
  32. db HS_SEAFOAM_ISLANDS_4_BOULDER_3
  33. db HS_SEAFOAM_ISLANDS_4_BOULDER_4
  34. db $FF
  35. .asm_50cef
  36. CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE
  37. ret z
  38. ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_1
  39. call Route20Script_50d0c
  40. ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_2
  41. call Route20Script_50d0c
  42. ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_1
  43. call Route20Script_50d14
  44. ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_2
  45. call Route20Script_50d14
  46. ret
  47. Route20Script_50d0c:
  48. ld [wMissableObjectIndex], a
  49. predef_jump ShowObject
  50. Route20Script_50d14:
  51. ld [wMissableObjectIndex], a
  52. predef_jump HideObject
  53. Route20ScriptPointers:
  54. dw CheckFightingMapTrainers
  55. dw DisplayEnemyTrainerTextAndStartBattle
  56. dw EndTrainerBattle
  57. Route20TextPointers:
  58. dw Route20Text1
  59. dw Route20Text2
  60. dw Route20Text3
  61. dw Route20Text4
  62. dw Route20Text5
  63. dw Route20Text6
  64. dw Route20Text7
  65. dw Route20Text8
  66. dw Route20Text9
  67. dw Route20Text10
  68. dw Route20Text11
  69. dw Route20Text12
  70. Route20TrainerHeader0:
  71. dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_0
  72. db ($4 << 4) ; trainer's view range
  73. dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_0
  74. dw Route20BattleText1 ; TextBeforeBattle
  75. dw Route20AfterBattleText1 ; TextAfterBattle
  76. dw Route20EndBattleText1 ; TextEndBattle
  77. dw Route20EndBattleText1 ; TextEndBattle
  78. Route20TrainerHeader1:
  79. dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_1
  80. db ($4 << 4) ; trainer's view range
  81. dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_1
  82. dw Route20BattleText2 ; TextBeforeBattle
  83. dw Route20AfterBattleText2 ; TextAfterBattle
  84. dw Route20EndBattleText2 ; TextEndBattle
  85. dw Route20EndBattleText2 ; TextEndBattle
  86. Route20TrainerHeader2:
  87. dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_2
  88. db ($2 << 4) ; trainer's view range
  89. dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_2
  90. dw Route20BattleText3 ; TextBeforeBattle
  91. dw Route20AfterBattleText3 ; TextAfterBattle
  92. dw Route20EndBattleText3 ; TextEndBattle
  93. dw Route20EndBattleText3 ; TextEndBattle
  94. Route20TrainerHeader3:
  95. dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_3
  96. db ($4 << 4) ; trainer's view range
  97. dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_3
  98. dw Route20BattleText4 ; TextBeforeBattle
  99. dw Route20AfterBattleText4 ; TextAfterBattle
  100. dw Route20EndBattleText4 ; TextEndBattle
  101. dw Route20EndBattleText4 ; TextEndBattle
  102. Route20TrainerHeader4:
  103. dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_4
  104. db ($3 << 4) ; trainer's view range
  105. dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_4
  106. dw Route20BattleText5 ; TextBeforeBattle
  107. dw Route20AfterBattleText5 ; TextAfterBattle
  108. dw Route20EndBattleText5 ; TextEndBattle
  109. dw Route20EndBattleText5 ; TextEndBattle
  110. Route20TrainerHeader5:
  111. dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_5
  112. db ($4 << 4) ; trainer's view range
  113. dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_5
  114. dw Route20BattleText6 ; TextBeforeBattle
  115. dw Route20AfterBattleText6 ; TextAfterBattle
  116. dw Route20EndBattleText6 ; TextEndBattle
  117. dw Route20EndBattleText6 ; TextEndBattle
  118. Route20TrainerHeader6:
  119. dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_6
  120. db ($2 << 4) ; trainer's view range
  121. dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_6
  122. dw Route20BattleText7 ; TextBeforeBattle
  123. dw Route20AfterBattleText7 ; TextAfterBattle
  124. dw Route20EndBattleText7 ; TextEndBattle
  125. dw Route20EndBattleText7 ; TextEndBattle
  126. Route20TrainerHeader7:
  127. dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_7, 1
  128. db ($4 << 4) ; trainer's view range
  129. dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_7, 1
  130. dw Route20BattleText8 ; TextBeforeBattle
  131. dw Route20AfterBattleText8 ; TextAfterBattle
  132. dw Route20EndBattleText8 ; TextEndBattle
  133. dw Route20EndBattleText8 ; TextEndBattle
  134. Route20TrainerHeader8:
  135. dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_8, 1
  136. db ($3 << 4) ; trainer's view range
  137. dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_8, 1
  138. dw Route20BattleText9 ; TextBeforeBattle
  139. dw Route20AfterBattleText9 ; TextAfterBattle
  140. dw Route20EndBattleText9 ; TextEndBattle
  141. dw Route20EndBattleText9 ; TextEndBattle
  142. Route20TrainerHeader9:
  143. dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_9, 1
  144. db ($4 << 4) ; trainer's view range
  145. dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_9, 1
  146. dw Route20BattleText10 ; TextBeforeBattle
  147. dw Route20AfterBattleText10 ; TextAfterBattle
  148. dw Route20EndBattleText10 ; TextEndBattle
  149. dw Route20EndBattleText10 ; TextEndBattle
  150. db $ff
  151. Route20Text1:
  152. TX_ASM
  153. ld hl, Route20TrainerHeader0
  154. call TalkToTrainer
  155. jp TextScriptEnd
  156. Route20Text2:
  157. TX_ASM
  158. ld hl, Route20TrainerHeader1
  159. call TalkToTrainer
  160. jp TextScriptEnd
  161. Route20Text3:
  162. TX_ASM
  163. ld hl, Route20TrainerHeader2
  164. call TalkToTrainer
  165. jp TextScriptEnd
  166. Route20Text4:
  167. TX_ASM
  168. ld hl, Route20TrainerHeader3
  169. call TalkToTrainer
  170. jp TextScriptEnd
  171. Route20Text5:
  172. TX_ASM
  173. ld hl, Route20TrainerHeader4
  174. call TalkToTrainer
  175. jp TextScriptEnd
  176. Route20Text6:
  177. TX_ASM
  178. ld hl, Route20TrainerHeader5
  179. call TalkToTrainer
  180. jp TextScriptEnd
  181. Route20Text7:
  182. TX_ASM
  183. ld hl, Route20TrainerHeader6
  184. call TalkToTrainer
  185. jp TextScriptEnd
  186. Route20Text8:
  187. TX_ASM
  188. ld hl, Route20TrainerHeader7
  189. call TalkToTrainer
  190. jp TextScriptEnd
  191. Route20Text9:
  192. TX_ASM
  193. ld hl, Route20TrainerHeader8
  194. call TalkToTrainer
  195. jp TextScriptEnd
  196. Route20Text10:
  197. TX_ASM
  198. ld hl, Route20TrainerHeader9
  199. call TalkToTrainer
  200. jp TextScriptEnd
  201. Route20BattleText1:
  202. TX_FAR _Route20BattleText1
  203. db "@"
  204. Route20EndBattleText1:
  205. TX_FAR _Route20EndBattleText1
  206. db "@"
  207. Route20AfterBattleText1:
  208. TX_FAR _Route20AfterBattleText1
  209. db "@"
  210. Route20BattleText2:
  211. TX_FAR _Route20BattleText2
  212. db "@"
  213. Route20EndBattleText2:
  214. TX_FAR _Route20EndBattleText2
  215. db "@"
  216. Route20AfterBattleText2:
  217. TX_FAR _Route20AfterBattleText2
  218. db "@"
  219. Route20BattleText3:
  220. TX_FAR _Route20BattleText3
  221. db "@"
  222. Route20EndBattleText3:
  223. TX_FAR _Route20EndBattleText3
  224. db "@"
  225. Route20AfterBattleText3:
  226. TX_FAR _Route20AfterBattleText3
  227. db "@"
  228. Route20BattleText4:
  229. TX_FAR _Route20BattleText4
  230. db "@"
  231. Route20EndBattleText4:
  232. TX_FAR _Route20EndBattleText4
  233. db "@"
  234. Route20AfterBattleText4:
  235. TX_FAR _Route20AfterBattleText4
  236. db "@"
  237. Route20BattleText5:
  238. TX_FAR _Route20BattleText5
  239. db "@"
  240. Route20EndBattleText5:
  241. TX_FAR _Route20EndBattleText5
  242. db "@"
  243. Route20AfterBattleText5:
  244. TX_FAR _Route20AfterBattleText5
  245. db "@"
  246. Route20BattleText6:
  247. TX_FAR _Route20BattleText6
  248. db "@"
  249. Route20EndBattleText6:
  250. TX_FAR _Route20EndBattleText6
  251. db "@"
  252. Route20AfterBattleText6:
  253. TX_FAR _Route20AfterBattleText6
  254. db "@"
  255. Route20BattleText7:
  256. TX_FAR _Route20BattleText7
  257. db "@"
  258. Route20EndBattleText7:
  259. TX_FAR _Route20EndBattleText7
  260. db "@"
  261. Route20AfterBattleText7:
  262. TX_FAR _Route20AfterBattleText7
  263. db "@"
  264. Route20BattleText8:
  265. TX_FAR _Route20BattleText8
  266. db "@"
  267. Route20EndBattleText8:
  268. TX_FAR _Route20EndBattleText8
  269. db "@"
  270. Route20AfterBattleText8:
  271. TX_FAR _Route20AfterBattleText8
  272. db "@"
  273. Route20BattleText9:
  274. TX_FAR _Route20BattleText9
  275. db "@"
  276. Route20EndBattleText9:
  277. TX_FAR _Route20EndBattleText9
  278. db "@"
  279. Route20AfterBattleText9:
  280. TX_FAR _Route20AfterBattleText9
  281. db "@"
  282. Route20BattleText10:
  283. TX_FAR _Route20BattleText10
  284. db "@"
  285. Route20EndBattleText10:
  286. TX_FAR _Route20EndBattleText10
  287. db "@"
  288. Route20AfterBattleText10:
  289. TX_FAR _Route20AfterBattleText10
  290. db "@"
  291. Route20Text12:
  292. Route20Text11:
  293. TX_FAR _Route20Text11
  294. db "@"