victoryroad2.asm 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. VictoryRoad2Script:
  2. ld hl, wCurrentMapScriptFlags
  3. bit 6, [hl]
  4. res 6, [hl]
  5. call nz, VictoryRoad2Script_517c4
  6. ld hl, wCurrentMapScriptFlags
  7. bit 5, [hl]
  8. res 5, [hl]
  9. call nz, VictoryRoad2Script_517c9
  10. call EnableAutoTextBoxDrawing
  11. ld hl, VictoryRoad2TrainerHeader0
  12. ld de, VictoryRoad2ScriptPointers
  13. ld a, [wVictoryRoad2CurScript]
  14. call ExecuteCurMapScriptInTable
  15. ld [wVictoryRoad2CurScript], a
  16. ret
  17. VictoryRoad2Script_517c4:
  18. ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH
  19. VictoryRoad2Script_517c9:
  20. CheckEvent EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
  21. jr z, .asm_517da
  22. push af
  23. ld a, $15
  24. lb bc, 4, 3
  25. call VictoryRoad2Script_517e2
  26. pop af
  27. .asm_517da
  28. bit 7, a
  29. ret z
  30. ld a, $1d
  31. lb bc, 7, 11
  32. VictoryRoad2Script_517e2:
  33. ld [wNewTileBlockID], a
  34. predef ReplaceTileBlock
  35. ret
  36. VictoryRoad2ScriptPointers:
  37. dw VictoryRoad2Script0
  38. dw DisplayEnemyTrainerTextAndStartBattle
  39. dw EndTrainerBattle
  40. VictoryRoad2Script0:
  41. ld hl, CoordsData_51816
  42. call CheckBoulderCoords
  43. jp nc, CheckFightingMapTrainers
  44. EventFlagAddress hl, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
  45. ld a, [wCoordIndex]
  46. cp $2
  47. jr z, .asm_5180b
  48. CheckEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
  49. SetEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
  50. ret nz
  51. jr .asm_51810
  52. .asm_5180b
  53. CheckEventAfterBranchReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
  54. SetEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2
  55. ret nz
  56. .asm_51810
  57. ld hl, wCurrentMapScriptFlags
  58. set 5, [hl]
  59. ret
  60. CoordsData_51816:
  61. db $10,$01
  62. db $10,$09
  63. db $FF
  64. VictoryRoad2TextPointers:
  65. dw VictoryRoad2Text1
  66. dw VictoryRoad2Text2
  67. dw VictoryRoad2Text3
  68. dw VictoryRoad2Text4
  69. dw VictoryRoad2Text5
  70. dw MoltresText
  71. dw PickUpItemText
  72. dw PickUpItemText
  73. dw PickUpItemText
  74. dw PickUpItemText
  75. dw BoulderText
  76. dw BoulderText
  77. dw BoulderText
  78. VictoryRoad2TrainerHeader0:
  79. dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0
  80. db ($4 << 4) ; trainer's view range
  81. dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0
  82. dw VictoryRoad2BattleText1 ; TextBeforeBattle
  83. dw VictoryRoad2AfterBattleText1 ; TextAfterBattle
  84. dw VictoryRoad2EndBattleText1 ; TextEndBattle
  85. dw VictoryRoad2EndBattleText1 ; TextEndBattle
  86. VictoryRoad2TrainerHeader1:
  87. dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_1
  88. db ($3 << 4) ; trainer's view range
  89. dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_1
  90. dw VictoryRoad2BattleText2 ; TextBeforeBattle
  91. dw VictoryRoad2AfterBattleText2 ; TextAfterBattle
  92. dw VictoryRoad2EndBattleText2 ; TextEndBattle
  93. dw VictoryRoad2EndBattleText2 ; TextEndBattle
  94. VictoryRoad2TrainerHeader2:
  95. dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2
  96. db ($3 << 4) ; trainer's view range
  97. dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2
  98. dw VictoryRoad2BattleText3 ; TextBeforeBattle
  99. dw VictoryRoad2AfterBattleText3 ; TextAfterBattle
  100. dw VictoryRoad2EndBattleText3 ; TextEndBattle
  101. dw VictoryRoad2EndBattleText3 ; TextEndBattle
  102. VictoryRoad2TrainerHeader3:
  103. dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3
  104. db ($1 << 4) ; trainer's view range
  105. dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3
  106. dw VictoryRoad2BattleText4 ; TextBeforeBattle
  107. dw VictoryRoad2AfterBattleText4 ; TextAfterBattle
  108. dw VictoryRoad2EndBattleText4 ; TextEndBattle
  109. dw VictoryRoad2EndBattleText4 ; TextEndBattle
  110. VictoryRoad2TrainerHeader4:
  111. dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4
  112. db ($3 << 4) ; trainer's view range
  113. dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4
  114. dw VictoryRoad2BattleText5 ; TextBeforeBattle
  115. dw VictoryRoad2AfterBattleText5 ; TextAfterBattle
  116. dw VictoryRoad2EndBattleText5 ; TextEndBattle
  117. dw VictoryRoad2EndBattleText5 ; TextEndBattle
  118. MoltresTrainerHeader:
  119. dbEventFlagBit EVENT_BEAT_MOLTRES
  120. db ($0 << 4) ; trainer's view range
  121. dwEventFlagAddress EVENT_BEAT_MOLTRES
  122. dw MoltresBattleText ; TextBeforeBattle
  123. dw MoltresBattleText ; TextAfterBattle
  124. dw MoltresBattleText ; TextEndBattle
  125. dw MoltresBattleText ; TextEndBattle
  126. db $ff
  127. VictoryRoad2Text1:
  128. TX_ASM
  129. ld hl, VictoryRoad2TrainerHeader0
  130. call TalkToTrainer
  131. jp TextScriptEnd
  132. VictoryRoad2Text2:
  133. TX_ASM
  134. ld hl, VictoryRoad2TrainerHeader1
  135. call TalkToTrainer
  136. jp TextScriptEnd
  137. VictoryRoad2Text3:
  138. TX_ASM
  139. ld hl, VictoryRoad2TrainerHeader2
  140. call TalkToTrainer
  141. jp TextScriptEnd
  142. VictoryRoad2Text4:
  143. TX_ASM
  144. ld hl, VictoryRoad2TrainerHeader3
  145. call TalkToTrainer
  146. jp TextScriptEnd
  147. VictoryRoad2Text5:
  148. TX_ASM
  149. ld hl, VictoryRoad2TrainerHeader4
  150. call TalkToTrainer
  151. jp TextScriptEnd
  152. MoltresText:
  153. TX_ASM
  154. ld hl, MoltresTrainerHeader
  155. call TalkToTrainer
  156. jp TextScriptEnd
  157. MoltresBattleText:
  158. TX_FAR _MoltresBattleText
  159. TX_ASM
  160. ld a, MOLTRES
  161. call PlayCry
  162. call WaitForSoundToFinish
  163. jp TextScriptEnd
  164. VictoryRoad2BattleText1:
  165. TX_FAR _VictoryRoad2BattleText1
  166. db "@"
  167. VictoryRoad2EndBattleText1:
  168. TX_FAR _VictoryRoad2EndBattleText1
  169. db "@"
  170. VictoryRoad2AfterBattleText1:
  171. TX_FAR _VictoryRoad2AfterBattleText1
  172. db "@"
  173. VictoryRoad2BattleText2:
  174. TX_FAR _VictoryRoad2BattleText2
  175. db "@"
  176. VictoryRoad2EndBattleText2:
  177. TX_FAR _VictoryRoad2EndBattleText2
  178. db "@"
  179. VictoryRoad2AfterBattleText2:
  180. TX_FAR _VictoryRoad2AfterBattleText2
  181. db "@"
  182. VictoryRoad2BattleText3:
  183. TX_FAR _VictoryRoad2BattleText3
  184. db "@"
  185. VictoryRoad2EndBattleText3:
  186. TX_FAR _VictoryRoad2EndBattleText3
  187. db "@"
  188. VictoryRoad2AfterBattleText3:
  189. TX_FAR _VictoryRoad2AfterBattleText3
  190. db "@"
  191. VictoryRoad2BattleText4:
  192. TX_FAR _VictoryRoad2BattleText4
  193. db "@"
  194. VictoryRoad2EndBattleText4:
  195. TX_FAR _VictoryRoad2EndBattleText4
  196. db "@"
  197. VictoryRoad2AfterBattleText4:
  198. TX_FAR _VictoryRoad2AfterBattleText4
  199. db "@"
  200. VictoryRoad2BattleText5:
  201. TX_FAR _VictoryRoad2BattleText5
  202. db "@"
  203. VictoryRoad2EndBattleText5:
  204. TX_FAR _VictoryRoad2EndBattleText5
  205. db "@"
  206. VictoryRoad2AfterBattleText5:
  207. TX_FAR _VictoryRoad2AfterBattleText5
  208. db "@"