route16.asm 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. Route16Script:
  2. call EnableAutoTextBoxDrawing
  3. ld hl, Route16TrainerHeader0
  4. ld de, Route16ScriptPointers
  5. ld a, [wRoute16CurScript]
  6. call ExecuteCurMapScriptInTable
  7. ld [wRoute16CurScript], a
  8. ret
  9. Route16Script_59946:
  10. xor a
  11. ld [wJoyIgnore], a
  12. ld [wRoute16CurScript], a
  13. ld [wCurMapScript], a
  14. ret
  15. Route16ScriptPointers:
  16. dw Route16Script0
  17. dw DisplayEnemyTrainerTextAndStartBattle
  18. dw EndTrainerBattle
  19. dw Route16Script3
  20. Route16Script0:
  21. CheckEventHL EVENT_BEAT_ROUTE16_SNORLAX
  22. jp nz, CheckFightingMapTrainers
  23. CheckEventReuseHL EVENT_FIGHT_ROUTE16_SNORLAX
  24. ResetEventReuseHL EVENT_FIGHT_ROUTE16_SNORLAX
  25. jp z, CheckFightingMapTrainers
  26. ld a, $a
  27. ld [hSpriteIndexOrTextID], a
  28. call DisplayTextID
  29. ld a, SNORLAX
  30. ld [wCurOpponent], a
  31. ld a, 30
  32. ld [wCurEnemyLVL], a
  33. ld a, HS_ROUTE_16_SNORLAX
  34. ld [wMissableObjectIndex], a
  35. predef HideObject
  36. call UpdateSprites
  37. ld a, $3
  38. ld [wRoute16CurScript], a
  39. ld [wCurMapScript], a
  40. ret
  41. Route16Script3:
  42. ld a, [wIsInBattle]
  43. cp $ff
  44. jp z, Route16Script_59946
  45. call UpdateSprites
  46. ld a, [wBattleResult]
  47. cp $2
  48. jr z, .asm_599a8
  49. ld a, $b
  50. ld [hSpriteIndexOrTextID], a
  51. call DisplayTextID
  52. .asm_599a8
  53. SetEvent EVENT_BEAT_ROUTE16_SNORLAX
  54. call Delay3
  55. ld a, $0
  56. ld [wRoute16CurScript], a
  57. ld [wCurMapScript], a
  58. ret
  59. Route16TextPointers:
  60. dw Route16Text1
  61. dw Route16Text2
  62. dw Route16Text3
  63. dw Route16Text4
  64. dw Route16Text5
  65. dw Route16Text6
  66. dw Route16Text7
  67. dw Route16Text8
  68. dw Route16Text9
  69. dw Route16Text10
  70. dw Route16Text11
  71. Route16TrainerHeader0:
  72. dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_0
  73. db ($3 << 4) ; trainer's view range
  74. dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_0
  75. dw Route16BattleText1 ; TextBeforeBattle
  76. dw Route16AfterBattleText1 ; TextAfterBattle
  77. dw Route16EndBattleText1 ; TextEndBattle
  78. dw Route16EndBattleText1 ; TextEndBattle
  79. Route16TrainerHeader1:
  80. dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_1
  81. db ($2 << 4) ; trainer's view range
  82. dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_1
  83. dw Route16BattleText2 ; TextBeforeBattle
  84. dw Route16AfterBattleText2 ; TextAfterBattle
  85. dw Route16EndBattleText2 ; TextEndBattle
  86. dw Route16EndBattleText2 ; TextEndBattle
  87. Route16TrainerHeader2:
  88. dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_2
  89. db ($2 << 4) ; trainer's view range
  90. dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_2
  91. dw Route16BattleText3 ; TextBeforeBattle
  92. dw Route16AfterBattleText3 ; TextAfterBattle
  93. dw Route16EndBattleText3 ; TextEndBattle
  94. dw Route16EndBattleText3 ; TextEndBattle
  95. Route16TrainerHeader3:
  96. dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_3
  97. db ($2 << 4) ; trainer's view range
  98. dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_3
  99. dw Route16BattleText4 ; TextBeforeBattle
  100. dw Route16AfterBattleText4 ; TextAfterBattle
  101. dw Route16EndBattleText4 ; TextEndBattle
  102. dw Route16EndBattleText4 ; TextEndBattle
  103. Route16TrainerHeader4:
  104. dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_4
  105. db ($2 << 4) ; trainer's view range
  106. dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_4
  107. dw Route16BattleText5 ; TextBeforeBattle
  108. dw Route16AfterBattleText5 ; TextAfterBattle
  109. dw Route16EndBattleText5 ; TextEndBattle
  110. dw Route16EndBattleText5 ; TextEndBattle
  111. Route16TrainerHeader5:
  112. dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_5
  113. db ($4 << 4) ; trainer's view range
  114. dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_5
  115. dw Route16BattleText6 ; TextBeforeBattle
  116. dw Route16AfterBattleText6 ; TextAfterBattle
  117. dw Route16EndBattleText6 ; TextEndBattle
  118. dw Route16EndBattleText6 ; TextEndBattle
  119. db $ff
  120. Route16Text1:
  121. TX_ASM
  122. ld hl, Route16TrainerHeader0
  123. call TalkToTrainer
  124. jp TextScriptEnd
  125. Route16BattleText1:
  126. TX_FAR _Route16BattleText1
  127. db "@"
  128. Route16EndBattleText1:
  129. TX_FAR _Route16EndBattleText1
  130. db "@"
  131. Route16AfterBattleText1:
  132. TX_FAR _Route16AfterBattleText1
  133. db "@"
  134. Route16Text2:
  135. TX_ASM
  136. ld hl, Route16TrainerHeader1
  137. call TalkToTrainer
  138. jp TextScriptEnd
  139. Route16BattleText2:
  140. TX_FAR _Route16BattleText2
  141. db "@"
  142. Route16EndBattleText2:
  143. TX_FAR _Route16EndBattleText2
  144. db "@"
  145. Route16AfterBattleText2:
  146. TX_FAR _Route16AfterBattleText2
  147. db "@"
  148. Route16Text3:
  149. TX_ASM
  150. ld hl, Route16TrainerHeader2
  151. call TalkToTrainer
  152. jp TextScriptEnd
  153. Route16BattleText3:
  154. TX_FAR _Route16BattleText3
  155. db "@"
  156. Route16EndBattleText3:
  157. TX_FAR _Route16EndBattleText3
  158. db "@"
  159. Route16AfterBattleText3:
  160. TX_FAR _Route16AfterBattleText3
  161. db "@"
  162. Route16Text4:
  163. TX_ASM
  164. ld hl, Route16TrainerHeader3
  165. call TalkToTrainer
  166. jp TextScriptEnd
  167. Route16BattleText4:
  168. TX_FAR _Route16BattleText4
  169. db "@"
  170. Route16EndBattleText4:
  171. TX_FAR _Route16EndBattleText4
  172. db "@"
  173. Route16AfterBattleText4:
  174. TX_FAR _Route16AfterBattleText4
  175. db "@"
  176. Route16Text5:
  177. TX_ASM
  178. ld hl, Route16TrainerHeader4
  179. call TalkToTrainer
  180. jp TextScriptEnd
  181. Route16BattleText5:
  182. TX_FAR _Route16BattleText5
  183. db "@"
  184. Route16EndBattleText5:
  185. TX_FAR _Route16EndBattleText5
  186. db "@"
  187. Route16AfterBattleText5:
  188. TX_FAR _Route16AfterBattleText5
  189. db "@"
  190. Route16Text6:
  191. TX_ASM
  192. ld hl, Route16TrainerHeader5
  193. call TalkToTrainer
  194. jp TextScriptEnd
  195. Route16BattleText6:
  196. TX_FAR _Route16BattleText6
  197. db "@"
  198. Route16EndBattleText6:
  199. TX_FAR _Route16EndBattleText6
  200. db "@"
  201. Route16AfterBattleText6:
  202. TX_FAR _Route16AfterBattleText6
  203. db "@"
  204. Route16Text7:
  205. TX_FAR _Route16Text7
  206. db "@"
  207. Route16Text10:
  208. TX_FAR _Route16Text10
  209. db "@"
  210. Route16Text11:
  211. TX_FAR _Route16Text11
  212. db "@"
  213. Route16Text8:
  214. TX_FAR _Route16Text8
  215. db "@"
  216. Route16Text9:
  217. TX_FAR _Route16Text9
  218. db "@"