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/SilphCo4F.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/SilphCo4F.asm')
| -rw-r--r-- | scripts/SilphCo4F.asm | 124 |
1 files changed, 63 insertions, 61 deletions
diff --git a/scripts/SilphCo4F.asm b/scripts/SilphCo4F.asm index 486b68ac..91453d65 100644 --- a/scripts/SilphCo4F.asm +++ b/scripts/SilphCo4F.asm @@ -1,5 +1,5 @@ SilphCo4F_Script: - call SilphCo4Script_19d21 + call SilphCo4FGateCallbackScript call EnableAutoTextBoxDrawing ld hl, SilphCo4TrainerHeaders ld de, SilphCo4F_ScriptPointers @@ -8,23 +8,23 @@ SilphCo4F_Script: ld [wSilphCo4FCurScript], a ret -SilphCo4Script_19d21: +SilphCo4FGateCallbackScript: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] ret z - ld hl, SilphCo4GateCoords - call SilphCo4Script_19d5d - call SilphCo4Script_19d89 + ld hl, .GateCoordinates + call SilphCo4F_SetCardKeyDoorYScript + call SilphCo4FUnlockedDoorEventScript CheckEvent EVENT_SILPH_CO_4_UNLOCKED_DOOR1 - jr nz, .asm_19d48 + jr nz, .unlock_door1 push af ld a, $54 ld [wNewTileBlockID], a lb bc, 6, 2 predef ReplaceTileBlock pop af -.asm_19d48 +.unlock_door1 CheckEventAfterBranchReuseA EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret nz ld a, $54 @@ -32,12 +32,12 @@ SilphCo4Script_19d21: lb bc, 4, 6 predef_jump ReplaceTileBlock -SilphCo4GateCoords: +.GateCoordinates: dbmapcoord 2, 6 dbmapcoord 6, 4 db -1 ; end -SilphCo4Script_19d5d: +SilphCo4F_SetCardKeyDoorYScript: push hl ld hl, wCardKeyDoorY ld a, [hli] @@ -47,134 +47,136 @@ SilphCo4Script_19d5d: xor a ldh [hUnlockedSilphCoDoors], a pop hl -.asm_19d69 +.loop_check_doors ld a, [hli] cp $ff - jr z, .asm_19d85 + jr z, .exit_loop push hl ld hl, hUnlockedSilphCoDoors inc [hl] pop hl cp b - jr z, .asm_19d7a + jr z, .check_y_coord inc hl - jr .asm_19d69 -.asm_19d7a + jr .loop_check_doors +.check_y_coord ld a, [hli] cp c - jr nz, .asm_19d69 + jr nz, .loop_check_doors ld hl, wCardKeyDoorY xor a ld [hli], a ld [hl], a ret -.asm_19d85 +.exit_loop xor a ldh [hUnlockedSilphCoDoors], a ret -SilphCo4Script_19d89: +SilphCo4FUnlockedDoorEventScript: EventFlagAddress hl, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ldh a, [hUnlockedSilphCoDoors] and a ret z cp $1 - jr nz, .next + jr nz, .unlock_door1 SetEventReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret -.next +.unlock_door1 SetEventAfterBranchReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret SilphCo4F_ScriptPointers: - dw CheckFightingMapTrainers - dw DisplayEnemyTrainerTextAndStartBattle - dw EndTrainerBattle + def_script_pointers + dw_const CheckFightingMapTrainers, SCRIPT_SILPHCO4F_DEFAULT + dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_SILPHCO4F_START_BATTLE + dw_const EndTrainerBattle, SCRIPT_SILPHCO4F_END_BATTLE SilphCo4F_TextPointers: - dw SilphCo4Text1 - dw SilphCo4Text2 - dw SilphCo4Text3 - dw SilphCo4Text4 - dw PickUpItemText - dw PickUpItemText - dw PickUpItemText + def_text_pointers + dw_const SilphCo4FSilphWorkerMText, TEXT_SILPHCO4F_SILPH_WORKER_M + dw_const SilphCo4FRocket1Text, TEXT_SILPHCO4F_ROCKET1 + dw_const SilphCo4FScientistText, TEXT_SILPHCO4F_SCIENTIST + dw_const SilphCo4FRocket2Text, TEXT_SILPHCO4F_ROCKET2 + dw_const PickUpItemText, TEXT_SILPHCO4F_FULL_HEAL + dw_const PickUpItemText, TEXT_SILPHCO4F_MAX_REVIVE + dw_const PickUpItemText, TEXT_SILPHCO4F_ESCAPE_ROPE SilphCo4TrainerHeaders: def_trainers 2 SilphCo4TrainerHeader0: - trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_0, 4, SilphCo4BattleText2, SilphCo4EndBattleText2, SilphCo4AfterBattleText2 + trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_0, 4, SilphCo4FRocket1BattleText, SilphCo4FRocket1EndBattleText, SilphCo4FRocket1AfterBattleText SilphCo4TrainerHeader1: - trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_1, 3, SilphCo4BattleText3, SilphCo4EndBattleText3, SilphCo4AfterBattleText3 + trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_1, 3, SilphCo4FScientistBattleText, SilphCo4FScientistEndBattleText, SilphCo4FScientistAfterBattleText SilphCo4TrainerHeader2: - trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_2, 4, SilphCo4BattleText4, SilphCo4EndBattleText4, SilphCo4AfterBattleText4 + trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_2, 4, SilphCo4FRocket2BattleText, SilphCo4FRocket2EndBattleText, SilphCo4FRocket2AfterBattleText db -1 ; end -SilphCo4Text1: +SilphCo4FSilphWorkerMText: text_asm - ld hl, SilphCo4Text_19de0 - ld de, SilphCo4Text_19de5 - call SilphCo6Script_1a22f + ld hl, .ImHidingText + ld de, .TeamRocketIsGoneText + call SilphCo6FBeatGiovanniPrintDEOrPrintHLScript jp TextScriptEnd -SilphCo4Text_19de0: - text_far _SilphCo4Text_19de0 +.ImHidingText: + text_far _SilphCo4FSilphWorkerMImHidingText text_end -SilphCo4Text_19de5: - text_far _SilphCo4Text_19de5 +.TeamRocketIsGoneText: + text_far _SilphCo4FSilphWorkerMTeamRocketIsGoneText text_end -SilphCo4Text2: +SilphCo4FRocket1Text: text_asm ld hl, SilphCo4TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SilphCo4BattleText2: - text_far _SilphCo4BattleText2 +SilphCo4FRocket1BattleText: + text_far _SilphCo4FRocket1BattleText text_end -SilphCo4EndBattleText2: - text_far _SilphCo4EndBattleText2 +SilphCo4FRocket1EndBattleText: + text_far _SilphCo4FRocket1EndBattleText text_end -SilphCo4AfterBattleText2: - text_far _SilphCo4AfterBattleText2 +SilphCo4FRocket1AfterBattleText: + text_far _SilphCo4FRocket1AfterBattleText text_end -SilphCo4Text3: +SilphCo4FScientistText: text_asm ld hl, SilphCo4TrainerHeader1 call TalkToTrainer jp TextScriptEnd -SilphCo4BattleText3: - text_far _SilphCo4BattleText3 +SilphCo4FScientistBattleText: + text_far _SilphCo4FScientistBattleText text_end -SilphCo4EndBattleText3: - text_far _SilphCo4EndBattleText3 +SilphCo4FScientistEndBattleText: + text_far _SilphCo4FScientistEndBattleText text_end -SilphCo4AfterBattleText3: - text_far _SilphCo4AfterBattleText3 +SilphCo4FScientistAfterBattleText: + text_far _SilphCo4FScientistAfterBattleText text_end -SilphCo4Text4: +SilphCo4FRocket2Text: text_asm ld hl, SilphCo4TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SilphCo4BattleText4: - text_far _SilphCo4BattleText4 +SilphCo4FRocket2BattleText: + text_far _SilphCo4FRocket2BattleText text_end -SilphCo4EndBattleText4: - text_far _SilphCo4EndBattleText4 +SilphCo4FRocket2EndBattleText: + text_far _SilphCo4FRocket2EndBattleText text_end -SilphCo4AfterBattleText4: - text_far _SilphCo4AfterBattleText4 +SilphCo4FRocket2AfterBattleText: + text_far _SilphCo4FRocket2AfterBattleText text_end |
