victoryroad3.asm 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. VictoryRoad3Script:
  2. call VictoryRoad3Script_44996
  3. call EnableAutoTextBoxDrawing
  4. ld hl, VictoryRoad3TrainerHeader0
  5. ld de, VictoryRoad3ScriptPointers
  6. ld a, [wVictoryRoad3CurScript]
  7. call ExecuteCurMapScriptInTable
  8. ld [wVictoryRoad3CurScript], a
  9. ret
  10. VictoryRoad3Script_44996:
  11. ld hl, wCurrentMapScriptFlags
  12. bit 5, [hl]
  13. res 5, [hl]
  14. ret z
  15. CheckEventHL EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1
  16. ret z
  17. ld a, $1d
  18. ld [wNewTileBlockID], a
  19. lb bc, 5, 3
  20. predef_jump ReplaceTileBlock
  21. VictoryRoad3ScriptPointers:
  22. dw VictoryRoad3Script0
  23. dw DisplayEnemyTrainerTextAndStartBattle
  24. dw EndTrainerBattle
  25. VictoryRoad3Script0:
  26. ld hl, wFlags_0xcd60
  27. bit 7, [hl]
  28. res 7, [hl]
  29. jp z, .asm_449fe
  30. ld hl, .coordsData_449f9
  31. call CheckBoulderCoords
  32. jp nc, .asm_449fe
  33. ld a, [wCoordIndex]
  34. cp $1
  35. jr nz, .asm_449dc
  36. ld hl, wCurrentMapScriptFlags
  37. set 5, [hl]
  38. SetEvent EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1
  39. ret
  40. .asm_449dc
  41. CheckAndSetEvent EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH2
  42. jr nz, .asm_449fe
  43. ld a, HS_VICTORY_ROAD_3_BOULDER
  44. ld [wMissableObjectIndex], a
  45. predef HideObject
  46. ld a, HS_VICTORY_ROAD_2_BOULDER
  47. ld [wMissableObjectIndex], a
  48. predef_jump ShowObject
  49. .coordsData_449f9:
  50. db $05,$03
  51. db $0F,$17
  52. db $FF
  53. .asm_449fe
  54. ld a, VICTORY_ROAD_2
  55. ld [wDungeonWarpDestinationMap], a
  56. ld hl, .coordsData_449f9
  57. call IsPlayerOnDungeonWarp
  58. ld a, [wCoordIndex]
  59. cp $1
  60. jr nz, .asm_44a1b
  61. ld hl, wd72d
  62. res 4, [hl]
  63. ld hl, wd732
  64. res 4, [hl]
  65. ret
  66. .asm_44a1b
  67. ld a, [wd72d]
  68. bit 4, a
  69. jp z, CheckFightingMapTrainers
  70. ret
  71. VictoryRoad3TextPointers:
  72. dw VictoryRoad3Text1
  73. dw VictoryRoad3Text2
  74. dw VictoryRoad3Text3
  75. dw VictoryRoad3Text4
  76. dw PickUpItemText
  77. dw PickUpItemText
  78. dw BoulderText
  79. dw BoulderText
  80. dw BoulderText
  81. dw BoulderText
  82. VictoryRoad3TrainerHeader0:
  83. dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0
  84. db ($1 << 4) ; trainer's view range
  85. dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0
  86. dw VictoryRoad3BattleText2 ; TextBeforeBattle
  87. dw VictoryRoad3AfterBattleText2 ; TextAfterBattle
  88. dw VictoryRoad3EndBattleText2 ; TextEndBattle
  89. dw VictoryRoad3EndBattleText2 ; TextEndBattle
  90. VictoryRoad3TrainerHeader1:
  91. dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_1
  92. db ($4 << 4) ; trainer's view range
  93. dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_1
  94. dw VictoryRoad3BattleText3 ; TextBeforeBattle
  95. dw VictoryRoad3AfterBattleText3 ; TextAfterBattle
  96. dw VictoryRoad3EndBattleText3 ; TextEndBattle
  97. dw VictoryRoad3EndBattleText3 ; TextEndBattle
  98. VictoryRoad3TrainerHeader2:
  99. dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2
  100. db ($4 << 4) ; trainer's view range
  101. dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2
  102. dw VictoryRoad3BattleText4 ; TextBeforeBattle
  103. dw VictoryRoad3AfterBattleText4 ; TextAfterBattle
  104. dw VictoryRoad3EndBattleText4 ; TextEndBattle
  105. dw VictoryRoad3EndBattleText4 ; TextEndBattle
  106. VictoryRoad3TrainerHeader3:
  107. dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3
  108. db ($4 << 4) ; trainer's view range
  109. dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3
  110. dw VictoryRoad3BattleText5 ; TextBeforeBattle
  111. dw VictoryRoad3AfterBattleText5 ; TextAfterBattle
  112. dw VictoryRoad3EndBattleText5 ; TextEndBattle
  113. dw VictoryRoad3EndBattleText5 ; TextEndBattle
  114. db $ff
  115. VictoryRoad3Text1:
  116. TX_ASM
  117. ld hl, VictoryRoad3TrainerHeader0
  118. call TalkToTrainer
  119. jp TextScriptEnd
  120. VictoryRoad3Text2:
  121. TX_ASM
  122. ld hl, VictoryRoad3TrainerHeader1
  123. call TalkToTrainer
  124. jp TextScriptEnd
  125. VictoryRoad3Text3:
  126. TX_ASM
  127. ld hl, VictoryRoad3TrainerHeader2
  128. call TalkToTrainer
  129. jp TextScriptEnd
  130. VictoryRoad3Text4:
  131. TX_ASM
  132. ld hl, VictoryRoad3TrainerHeader3
  133. call TalkToTrainer
  134. jp TextScriptEnd
  135. VictoryRoad3BattleText2:
  136. TX_FAR _VictoryRoad3BattleText2
  137. db "@"
  138. VictoryRoad3EndBattleText2:
  139. TX_FAR _VictoryRoad3EndBattleText2
  140. db "@"
  141. VictoryRoad3AfterBattleText2:
  142. TX_FAR _VictoryRoad3AfterBattleText2
  143. db "@"
  144. VictoryRoad3BattleText3:
  145. TX_FAR _VictoryRoad3BattleText3
  146. db "@"
  147. VictoryRoad3EndBattleText3:
  148. TX_FAR _VictoryRoad3EndBattleText3
  149. db "@"
  150. VictoryRoad3AfterBattleText3:
  151. TX_FAR _VictoryRoad3AfterBattleText3
  152. db "@"
  153. VictoryRoad3BattleText4:
  154. TX_FAR _VictoryRoad3BattleText4
  155. db "@"
  156. VictoryRoad3EndBattleText4:
  157. TX_FAR _VictoryRoad3EndBattleText4
  158. db "@"
  159. VictoryRoad3AfterBattleText4:
  160. TX_FAR _VictoryRoad3AfterBattleText4
  161. db "@"
  162. VictoryRoad3BattleText5:
  163. TX_FAR _VictoryRoad3BattleText5
  164. db "@"
  165. VictoryRoad3EndBattleText5:
  166. TX_FAR _VictoryRoad3EndBattleText5
  167. db "@"
  168. VictoryRoad3AfterBattleText5:
  169. TX_FAR _VictoryRoad3AfterBattleText5
  170. db "@"