aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/FuchsiaGym.asm
diff options
context:
space:
mode:
authorvulcandth <vulcandth@gmail.com>2023-07-13 20:27:56 -0500
committerGitHub <noreply@github.com>2023-07-13 21:27:56 -0400
commitd001ced41b53271373753de835a9c3b3413dc318 (patch)
treeff2db7f403bddfcdeb12e50def8411cafedcdd5e /scripts/FuchsiaGym.asm
parentMake wCurrentBoxNum a byte instead of word (#414) (diff)
downloadpokeyellow-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/FuchsiaGym.asm')
-rw-r--r--scripts/FuchsiaGym.asm194
1 files changed, 97 insertions, 97 deletions
diff --git a/scripts/FuchsiaGym.asm b/scripts/FuchsiaGym.asm
index 8dc93d22..1c0f02df 100644
--- a/scripts/FuchsiaGym.asm
+++ b/scripts/FuchsiaGym.asm
@@ -25,40 +25,41 @@ FuchsiaGym_Script:
db "KOGA@"
FuchsiaGymResetScripts:
- xor a
+ xor a ; SCRIPT_FUCHSIAGYM_DEFAULT
ld [wJoyIgnore], a
ld [wFuchsiaGymCurScript], a
ld [wCurMapScript], a
ret
FuchsiaGym_ScriptPointers:
- dw CheckFightingMapTrainers
- dw DisplayEnemyTrainerTextAndStartBattle
- dw EndTrainerBattle
- dw FuchsiaGymKogaPostBattle
+ def_script_pointers
+ dw_const CheckFightingMapTrainers, SCRIPT_FUCHSIAGYM_DEFAULT
+ dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_FUCHSIAGYM_START_BATTLE
+ dw_const EndTrainerBattle, SCRIPT_FUCHSIAGYM_END_BATTLE
+ dw_const FuchsiaGymKogaPostBattleScript, SCRIPT_FUCHSIAGYM_KOGA_POST_BATTLE
-FuchsiaGymKogaPostBattle:
+FuchsiaGymKogaPostBattleScript:
ld a, [wIsInBattle]
cp $ff
jp z, FuchsiaGymResetScripts
- ld a, $f0
+ ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
; fallthrough
FuchsiaGymReceiveTM06:
- ld a, $9
+ ld a, TEXT_FUCHSIAGYM_KOGA_SOUL_BADGE_INFO
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
SetEvent EVENT_BEAT_KOGA
lb bc, TM_TOXIC, 1
call GiveItem
jr nc, .BagFull
- ld a, $a
+ ld a, TEXT_FUCHSIAGYM_KOGA_RECEIVED_TM06
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
SetEvent EVENT_GOT_TM06
jr .gymVictory
.BagFull
- ld a, $b
+ ld a, TEXT_FUCHSIAGYM_KOGA_TM06_NO_ROOM
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
.gymVictory
@@ -73,35 +74,36 @@ FuchsiaGymReceiveTM06:
jp FuchsiaGymResetScripts
FuchsiaGym_TextPointers:
- dw KogaText
- dw FuchsiaGymTrainerText1
- dw FuchsiaGymTrainerText2
- dw FuchsiaGymTrainerText3
- dw FuchsiaGymTrainerText4
- dw FuchsiaGymTrainerText5
- dw FuchsiaGymTrainerText6
- dw FuchsiaGymGuideText
- dw KogaSoulBadgeInfoText
- dw ReceivedTM06Text
- dw TM06NoRoomText
+ def_text_pointers
+ dw_const FuchsiaGymKogaText, TEXT_FUCHSIAGYM_KOGA
+ dw_const FuchsiaGymRocker1Text, TEXT_FUCHSIAGYM_ROCKER1
+ dw_const FuchsiaGymRocker2Text, TEXT_FUCHSIAGYM_ROCKER2
+ dw_const FuchsiaGymRocker3Text, TEXT_FUCHSIAGYM_ROCKER3
+ dw_const FuchsiaGymRocker4Text, TEXT_FUCHSIAGYM_ROCKER4
+ dw_const FuchsiaGymRocker5Text, TEXT_FUCHSIAGYM_ROCKER5
+ dw_const FuchsiaGymRocker6Text, TEXT_FUCHSIAGYM_ROCKER6
+ dw_const FuchsiaGymGymGuideText, TEXT_FUCHSIAGYM_GYM_GUIDE
+ dw_const FuchsiaGymKogaSoulBadgeInfoText, TEXT_FUCHSIAGYM_KOGA_SOUL_BADGE_INFO
+ dw_const FuchsiaGymKogaReceivedTM06Text, TEXT_FUCHSIAGYM_KOGA_RECEIVED_TM06
+ dw_const FuchsiaGymKogaTM06NoRoomText, TEXT_FUCHSIAGYM_KOGA_TM06_NO_ROOM
FuchsiaGymTrainerHeaders:
def_trainers 2
FuchsiaGymTrainerHeader0:
- trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_0, 2, FuchsiaGymBattleText1, FuchsiaGymEndBattleText1, FuchsiaGymAfterBattleText1
+ trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_0, 2, FuchsiaGymRocker1BattleText, FuchsiaGymRocker1EndBattleText, FuchsiaGymRocker1AfterBattleText
FuchsiaGymTrainerHeader1:
- trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_1, 2, FuchsiaGymBattleText2, FuchsiaGymEndBattleText2, FuchsiaGymAfterBattleText2
+ trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_1, 2, FuchsiaGymRocker2BattleText, FuchsiaGymRocker2EndBattleText, FuchsiaGymRocker2AfterBattleText
FuchsiaGymTrainerHeader2:
- trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_2, 4, FuchsiaGymBattleText3, FuchsiaGymEndBattleText3, FuchsiaGymAfterBattleText3
+ trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_2, 4, FuchsiaGymRocker3BattleText, FuchsiaGymRocker3EndBattleText, FuchsiaGymRocker3AfterBattleText
FuchsiaGymTrainerHeader3:
- trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_3, 2, FuchsiaGymBattleText4, FuchsiaGymEndBattleText4, FuchsiaGymAfterBattleText4
+ trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_3, 2, FuchsiaGymRocker4BattleText, FuchsiaGymRocker4EndBattleText, FuchsiaGymRocker4AfterBattleText
FuchsiaGymTrainerHeader4:
- trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_4, 2, FuchsiaGymBattleText5, FuchsiaGymEndBattleText5, FuchsiaGymAfterBattleText5
+ trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_4, 2, FuchsiaGymRocker5BattleText, FuchsiaGymRocker5EndBattleText, FuchsiaGymRocker5AfterBattleText
FuchsiaGymTrainerHeader5:
- trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_5, 2, FuchsiaGymBattleText6, FuchsiaGymEndBattleText6, FuchsiaGymAfterBattleText6
+ trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_5, 2, FuchsiaGymRocker6BattleText, FuchsiaGymRocker6EndBattleText, FuchsiaGymRocker6AfterBattleText
db -1 ; end
-KogaText:
+FuchsiaGymKogaText:
text_asm
CheckEvent EVENT_BEAT_KOGA
jr z, .beforeBeat
@@ -111,17 +113,17 @@ KogaText:
call DisableWaitingAfterTextDisplay
jr .done
.afterBeat
- ld hl, KogaPostBattleAdviceText
+ ld hl, .PostBattleAdviceText
call PrintText
jr .done
.beforeBeat
- ld hl, KogaBeforeBattleText
+ ld hl, .BeforeBattleText
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, ReceivedSoulBadgeText
- ld de, ReceivedSoulBadgeText
+ ld hl, .ReceivedSoulBadgeText
+ ld de, .ReceivedSoulBadgeText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
@@ -131,161 +133,159 @@ KogaText:
ld [wGymLeaderNo], a
xor a
ldh [hJoyHeld], a
- ld a, $3
+ ld a, SCRIPT_FUCHSIAGYM_KOGA_POST_BATTLE
ld [wFuchsiaGymCurScript], a
.done
jp TextScriptEnd
-KogaBeforeBattleText:
- text_far _KogaBeforeBattleText
+.BeforeBattleText:
+ text_far _FuchsiaGymKogaBeforeBattleText
text_end
-ReceivedSoulBadgeText:
- text_far _ReceivedSoulBadgeText
+.ReceivedSoulBadgeText:
+ text_far _FuchsiaGymKogaReceivedSoulBadgeText
text_end
-KogaPostBattleAdviceText:
- text_far _KogaPostBattleAdviceText
+.PostBattleAdviceText:
+ text_far _FuchsiaGymKogaPostBattleAdviceText
text_end
-KogaSoulBadgeInfoText:
- text_far _KogaSoulBadgeInfoText
+FuchsiaGymKogaSoulBadgeInfoText:
+ text_far _FuchsiaGymKogaSoulBadgeInfoText
text_end
-ReceivedTM06Text:
- text_far _ReceivedTM06Text
+FuchsiaGymKogaReceivedTM06Text:
+ text_far _FuchsiaGymKogaReceivedTM06Text
sound_get_key_item
-
-TM06ExplanationText:
- text_far _TM06ExplanationText
+ text_far _FuchsiaGymKogaTM06ExplanationText
text_end
-TM06NoRoomText:
- text_far _TM06NoRoomText
+FuchsiaGymKogaTM06NoRoomText:
+ text_far _FuchsiaGymKogaTM06NoRoomText
text_end
-FuchsiaGymTrainerText1:
+FuchsiaGymRocker1Text:
text_asm
ld hl, FuchsiaGymTrainerHeader0
call TalkToTrainer
jp TextScriptEnd
-FuchsiaGymBattleText1:
- text_far _FuchsiaGymBattleText1
+FuchsiaGymRocker1BattleText:
+ text_far _FuchsiaGymRocker1BattleText
text_end
-FuchsiaGymEndBattleText1:
- text_far _FuchsiaGymEndBattleText1
+FuchsiaGymRocker1EndBattleText:
+ text_far _FuchsiaGymRocker1EndBattleText
text_end
-FuchsiaGymAfterBattleText1:
- text_far _FuchsiaGymAfterBattleText1
+FuchsiaGymRocker1AfterBattleText:
+ text_far _FuchsiaGymRocker1AfterBattleText
text_end
-FuchsiaGymTrainerText2:
+FuchsiaGymRocker2Text:
text_asm
ld hl, FuchsiaGymTrainerHeader1
call TalkToTrainer
jp TextScriptEnd
-FuchsiaGymBattleText2:
- text_far _FuchsiaGymBattleText2
+FuchsiaGymRocker2BattleText:
+ text_far _FuchsiaGymRocker2BattleText
text_end
-FuchsiaGymEndBattleText2:
- text_far _FuchsiaGymEndBattleText2
+FuchsiaGymRocker2EndBattleText:
+ text_far _FuchsiaGymRocker2EndBattleText
text_end
-FuchsiaGymAfterBattleText2:
- text_far _FuchsiaGymAfterBattleText2
+FuchsiaGymRocker2AfterBattleText:
+ text_far _FuchsiaGymRocker2AfterBattleText
text_end
-FuchsiaGymTrainerText3:
+FuchsiaGymRocker3Text:
text_asm
ld hl, FuchsiaGymTrainerHeader2
call TalkToTrainer
jp TextScriptEnd
-FuchsiaGymBattleText3:
- text_far _FuchsiaGymBattleText3
+FuchsiaGymRocker3BattleText:
+ text_far _FuchsiaGymRocker3BattleText
text_end
-FuchsiaGymEndBattleText3:
- text_far _FuchsiaGymEndBattleText3
+FuchsiaGymRocker3EndBattleText:
+ text_far _FuchsiaGymRocker3EndBattleText
text_end
-FuchsiaGymAfterBattleText3:
- text_far _FuchsiaGymAfterBattleText3
+FuchsiaGymRocker3AfterBattleText:
+ text_far _FuchsiaGymRocker3AfterBattleText
text_end
-FuchsiaGymTrainerText4:
+FuchsiaGymRocker4Text:
text_asm
ld hl, FuchsiaGymTrainerHeader3
call TalkToTrainer
jp TextScriptEnd
-FuchsiaGymBattleText4:
- text_far _FuchsiaGymBattleText4
+FuchsiaGymRocker4BattleText:
+ text_far _FuchsiaGymRocker4BattleText
text_end
-FuchsiaGymEndBattleText4:
- text_far _FuchsiaGymEndBattleText4
+FuchsiaGymRocker4EndBattleText:
+ text_far _FuchsiaGymRocker4EndBattleText
text_end
-FuchsiaGymAfterBattleText4:
- text_far _FuchsiaGymAfterBattleText4
+FuchsiaGymRocker4AfterBattleText:
+ text_far _FuchsiaGymRocker4AfterBattleText
text_end
-FuchsiaGymTrainerText5:
+FuchsiaGymRocker5Text:
text_asm
ld hl, FuchsiaGymTrainerHeader4
call TalkToTrainer
jp TextScriptEnd
-FuchsiaGymBattleText5:
- text_far _FuchsiaGymBattleText5
+FuchsiaGymRocker5BattleText:
+ text_far _FuchsiaGymRocker5BattleText
text_end
-FuchsiaGymEndBattleText5:
- text_far _FuchsiaGymEndBattleText5
+FuchsiaGymRocker5EndBattleText:
+ text_far _FuchsiaGymRocker5EndBattleText
text_end
-FuchsiaGymAfterBattleText5:
- text_far _FuchsiaGymAfterBattleText5
+FuchsiaGymRocker5AfterBattleText:
+ text_far _FuchsiaGymRocker5AfterBattleText
text_end
-FuchsiaGymTrainerText6:
+FuchsiaGymRocker6Text:
text_asm
ld hl, FuchsiaGymTrainerHeader5
call TalkToTrainer
jp TextScriptEnd
-FuchsiaGymBattleText6:
- text_far _FuchsiaGymBattleText6
+FuchsiaGymRocker6BattleText:
+ text_far _FuchsiaGymRocker6BattleText
text_end
-FuchsiaGymEndBattleText6:
- text_far _FuchsiaGymEndBattleText6
+FuchsiaGymRocker6EndBattleText:
+ text_far _FuchsiaGymRocker6EndBattleText
text_end
-FuchsiaGymAfterBattleText6:
- text_far _FuchsiaGymAfterBattleText6
+FuchsiaGymRocker6AfterBattleText:
+ text_far _FuchsiaGymRocker6AfterBattleText
text_end
-FuchsiaGymGuideText:
+FuchsiaGymGymGuideText:
text_asm
CheckEvent EVENT_BEAT_KOGA
- ld hl, FuchsiaGymGuidePostBattleText
+ ld hl, .BeatKogaText
jr nz, .afterBeat
- ld hl, FuchsiaGymGuidePreBattleText
+ ld hl, .ChampInMakingText
.afterBeat
call PrintText
jp TextScriptEnd
-FuchsiaGymGuidePreBattleText:
- text_far _FuchsiaGymGuidePreBattleText
+.ChampInMakingText:
+ text_far _FuchsiaGymGymGuideChampInMakingText
text_end
-FuchsiaGymGuidePostBattleText:
- text_far _FuchsiaGymGuidePostBattleText
+.BeatKogaText:
+ text_far _FuchsiaGymGymGuideBeatKogaText
text_end