diff options
| author | vulcandth <vulcandth@gmail.com> | 2023-07-13 20:27:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-13 21:27:56 -0400 |
| commit | d001ced41b53271373753de835a9c3b3413dc318 (patch) | |
| tree | ff2db7f403bddfcdeb12e50def8411cafedcdd5e /scripts/VictoryRoad2F.asm | |
| parent | Make wCurrentBoxNum a byte instead of word (#414) (diff) | |
| download | pokeyellow-d001ced41b53271373753de835a9c3b3413dc318.tar.gz pokeyellow-d001ced41b53271373753de835a9c3b3413dc318.tar.xz pokeyellow-d001ced41b53271373753de835a9c3b3413dc318.zip | |
Add macros, constants, and labels for map scripts and text (#367)
This introduces `def_script_pointers`, `def_text_pointers`, and `object_const_def` macros, and applies them to all maps. Most other map labels have also been identified.
Diffstat (limited to 'scripts/VictoryRoad2F.asm')
| -rw-r--r-- | scripts/VictoryRoad2F.asm | 152 |
1 files changed, 77 insertions, 75 deletions
diff --git a/scripts/VictoryRoad2F.asm b/scripts/VictoryRoad2F.asm index d86c7a16..5cbd5376 100644 --- a/scripts/VictoryRoad2F.asm +++ b/scripts/VictoryRoad2F.asm @@ -2,11 +2,11 @@ VictoryRoad2F_Script: ld hl, wCurrentMapScriptFlags bit 6, [hl] res 6, [hl] - call nz, VictoryRoad2Script_517c4 + call nz, VictoryRoad2FResetBoulderEventScript ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] - call nz, VictoryRoad2Script_517c9 + call nz, VictoryRoad2FCheckBoulderEventScript call EnableAutoTextBoxDrawing ld hl, VictoryRoad2TrainerHeaders ld de, VictoryRoad2F_ScriptPointers @@ -15,188 +15,190 @@ VictoryRoad2F_Script: ld [wVictoryRoad2FCurScript], a ret -VictoryRoad2Script_517c4: +VictoryRoad2FResetBoulderEventScript: ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH -VictoryRoad2Script_517c9: +; fallthrough +VictoryRoad2FCheckBoulderEventScript: CheckEvent EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 - jr z, .asm_517da + jr z, .not_on_switch push af ld a, $15 lb bc, 4, 3 - call VictoryRoad2Script_517e2 + call VictoryRoad2FReplaceTileBlockScript pop af -.asm_517da +.not_on_switch bit 7, a ret z ld a, $1d lb bc, 7, 11 -VictoryRoad2Script_517e2: +VictoryRoad2FReplaceTileBlockScript: ld [wNewTileBlockID], a predef ReplaceTileBlock ret VictoryRoad2F_ScriptPointers: - dw VictoryRoad2Script0 - dw DisplayEnemyTrainerTextAndStartBattle - dw EndTrainerBattle + dw_const VictoryRoad2FDefaultScript, SCRIPT_VICTORYROAD2F_DEFAULT + dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_VICTORYROAD2F_START_BATTLE + dw_const EndTrainerBattle, SCRIPT_VICTORYROAD2F_END_BATTLE -VictoryRoad2Script0: - ld hl, CoordsData_51816 +VictoryRoad2FDefaultScript: + ld hl, .SwitchCoords call CheckBoulderCoords jp nc, CheckFightingMapTrainers EventFlagAddress hl, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 ld a, [wCoordIndex] cp $2 - jr z, .asm_5180b + jr z, .second_switch CheckEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 SetEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 ret nz - jr .asm_51810 -.asm_5180b + jr .set_script_flag +.second_switch CheckEventAfterBranchReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 SetEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2 ret nz -.asm_51810 +.set_script_flag ld hl, wCurrentMapScriptFlags set 5, [hl] ret -CoordsData_51816: +.SwitchCoords: dbmapcoord 1, 16 dbmapcoord 9, 16 db -1 ; end VictoryRoad2F_TextPointers: - dw VictoryRoad2Text1 - dw VictoryRoad2Text2 - dw VictoryRoad2Text3 - dw VictoryRoad2Text4 - dw VictoryRoad2Text5 - dw MoltresText - dw PickUpItemText - dw PickUpItemText - dw PickUpItemText - dw PickUpItemText - dw BoulderText - dw BoulderText - dw BoulderText + def_text_pointers + dw_const VictoryRoad2FHikerText, TEXT_VICTORYROAD2F_HIKER + dw_const VictoryRoad2FSuperNerd1Text, TEXT_VICTORYROAD2F_SUPER_NERD1 + dw_const VictoryRoad2FCooltrainerMText, TEXT_VICTORYROAD2F_COOLTRAINER_M + dw_const VictoryRoad2FSuperNerd2Text, TEXT_VICTORYROAD2F_SUPER_NERD2 + dw_const VictoryRoad2FSuperNerd3Text, TEXT_VICTORYROAD2F_SUPER_NERD3 + dw_const VictoryRoad2FMoltresText, TEXT_VICTORYROAD2F_MOLTRES + dw_const PickUpItemText, TEXT_VICTORYROAD2F_TM_SUBMISSION + dw_const PickUpItemText, TEXT_VICTORYROAD2F_FULL_HEAL + dw_const PickUpItemText, TEXT_VICTORYROAD2F_TM_MEGA_KICK + dw_const PickUpItemText, TEXT_VICTORYROAD2F_GUARD_SPEC + dw_const BoulderText, TEXT_VICTORYROAD2F_BOULDER1 + dw_const BoulderText, TEXT_VICTORYROAD2F_BOULDER2 + dw_const BoulderText, TEXT_VICTORYROAD2F_BOULDER3 VictoryRoad2TrainerHeaders: def_trainers VictoryRoad2TrainerHeader0: - trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0, 4, VictoryRoad2BattleText1, VictoryRoad2EndBattleText1, VictoryRoad2AfterBattleText1 + trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0, 4, VictoryRoad2FHikerBattleText, VictoryRoad2FHikerEndBattleText, VictoryRoad2FHikerAfterBattleText VictoryRoad2TrainerHeader1: - trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_1, 3, VictoryRoad2BattleText2, VictoryRoad2EndBattleText2, VictoryRoad2AfterBattleText2 + trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_1, 3, VictoryRoad2FSuperNerd1BattleText, VictoryRoad2FSuperNerd1EndBattleText, VictoryRoad2FSuperNerd1AfterBattleText VictoryRoad2TrainerHeader2: - trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2, 3, VictoryRoad2BattleText3, VictoryRoad2EndBattleText3, VictoryRoad2AfterBattleText3 + trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2, 3, VictoryRoad2FCooltrainerMBattleText, VictoryRoad2FCooltrainerMEndBattleText, VictoryRoad2FCooltrainerMAfterBattleText VictoryRoad2TrainerHeader3: - trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3, 1, VictoryRoad2BattleText4, VictoryRoad2EndBattleText4, VictoryRoad2AfterBattleText4 + trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3, 1, VictoryRoad2FSuperNerd2BattleText, VictoryRoad2FSuperNerd2EndBattleText, VictoryRoad2FSuperNerd2AfterBattleText VictoryRoad2TrainerHeader4: - trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4, 3, VictoryRoad2BattleText5, VictoryRoad2EndBattleText5, VictoryRoad2AfterBattleText5 + trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4, 3, VictoryRoad2FSuperNerd3BattleText, VictoryRoad2FSuperNerd3EndBattleText, VictoryRoad2FSuperNerd3AfterBattleText MoltresTrainerHeader: - trainer EVENT_BEAT_MOLTRES, 0, MoltresBattleText, MoltresBattleText, MoltresBattleText + trainer EVENT_BEAT_MOLTRES, 0, VictoryRoad2FMoltresBattleText, VictoryRoad2FMoltresBattleText, VictoryRoad2FMoltresBattleText db -1 ; end -VictoryRoad2Text1: +VictoryRoad2FHikerText: text_asm ld hl, VictoryRoad2TrainerHeader0 call TalkToTrainer jp TextScriptEnd -VictoryRoad2Text2: +VictoryRoad2FSuperNerd1Text: text_asm ld hl, VictoryRoad2TrainerHeader1 call TalkToTrainer jp TextScriptEnd -VictoryRoad2Text3: +VictoryRoad2FCooltrainerMText: text_asm ld hl, VictoryRoad2TrainerHeader2 call TalkToTrainer jp TextScriptEnd -VictoryRoad2Text4: +VictoryRoad2FSuperNerd2Text: text_asm ld hl, VictoryRoad2TrainerHeader3 call TalkToTrainer jp TextScriptEnd -VictoryRoad2Text5: +VictoryRoad2FSuperNerd3Text: text_asm ld hl, VictoryRoad2TrainerHeader4 call TalkToTrainer jp TextScriptEnd -MoltresText: +VictoryRoad2FMoltresText: text_asm ld hl, MoltresTrainerHeader call TalkToTrainer jp TextScriptEnd -MoltresBattleText: - text_far _MoltresBattleText +VictoryRoad2FMoltresBattleText: + text_far _VictoryRoad2FMoltresBattleText text_asm ld a, MOLTRES call PlayCry call WaitForSoundToFinish jp TextScriptEnd -VictoryRoad2BattleText1: - text_far _VictoryRoad2BattleText1 +VictoryRoad2FHikerBattleText: + text_far _VictoryRoad2FHikerBattleText text_end -VictoryRoad2EndBattleText1: - text_far _VictoryRoad2EndBattleText1 +VictoryRoad2FHikerEndBattleText: + text_far _VictoryRoad2FHikerEndBattleText text_end -VictoryRoad2AfterBattleText1: - text_far _VictoryRoad2AfterBattleText1 +VictoryRoad2FHikerAfterBattleText: + text_far _VictoryRoad2FHikerAfterBattleText text_end -VictoryRoad2BattleText2: - text_far _VictoryRoad2BattleText2 +VictoryRoad2FSuperNerd1BattleText: + text_far _VictoryRoad2FSuperNerd1BattleText text_end -VictoryRoad2EndBattleText2: - text_far _VictoryRoad2EndBattleText2 +VictoryRoad2FSuperNerd1EndBattleText: + text_far _VictoryRoad2FSuperNerd1EndBattleText text_end -VictoryRoad2AfterBattleText2: - text_far _VictoryRoad2AfterBattleText2 +VictoryRoad2FSuperNerd1AfterBattleText: + text_far _VictoryRoad2FSuperNerd1AfterBattleText text_end -VictoryRoad2BattleText3: - text_far _VictoryRoad2BattleText3 +VictoryRoad2FCooltrainerMBattleText: + text_far _VictoryRoad2FCooltrainerMBattleText text_end -VictoryRoad2EndBattleText3: - text_far _VictoryRoad2EndBattleText3 +VictoryRoad2FCooltrainerMEndBattleText: + text_far _VictoryRoad2FCooltrainerMEndBattleText text_end -VictoryRoad2AfterBattleText3: - text_far _VictoryRoad2AfterBattleText3 +VictoryRoad2FCooltrainerMAfterBattleText: + text_far _VictoryRoad2FCooltrainerMAfterBattleText text_end -VictoryRoad2BattleText4: - text_far _VictoryRoad2BattleText4 +VictoryRoad2FSuperNerd2BattleText: + text_far _VictoryRoad2FSuperNerd2BattleText text_end -VictoryRoad2EndBattleText4: - text_far _VictoryRoad2EndBattleText4 +VictoryRoad2FSuperNerd2EndBattleText: + text_far _VictoryRoad2FSuperNerd2EndBattleText text_end -VictoryRoad2AfterBattleText4: - text_far _VictoryRoad2AfterBattleText4 +VictoryRoad2FSuperNerd2AfterBattleText: + text_far _VictoryRoad2FSuperNerd2AfterBattleText text_end -VictoryRoad2BattleText5: - text_far _VictoryRoad2BattleText5 +VictoryRoad2FSuperNerd3BattleText: + text_far _VictoryRoad2FSuperNerd3BattleText text_end -VictoryRoad2EndBattleText5: - text_far _VictoryRoad2EndBattleText5 +VictoryRoad2FSuperNerd3EndBattleText: + text_far _VictoryRoad2FSuperNerd3EndBattleText text_end -VictoryRoad2AfterBattleText5: - text_far _VictoryRoad2AfterBattleText5 +VictoryRoad2FSuperNerd3AfterBattleText: + text_far _VictoryRoad2FSuperNerd3AfterBattleText text_end |
