aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/PokemonMansion2F.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/PokemonMansion2F.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/PokemonMansion2F.asm')
-rw-r--r--scripts/PokemonMansion2F.asm75
1 files changed, 38 insertions, 37 deletions
diff --git a/scripts/PokemonMansion2F.asm b/scripts/PokemonMansion2F.asm
index a887913a..a4322da7 100644
--- a/scripts/PokemonMansion2F.asm
+++ b/scripts/PokemonMansion2F.asm
@@ -47,89 +47,90 @@ Mansion2Script_Switches::
ret nz
xor a
ldh [hJoyHeld], a
- ld a, $5
+ ld a, TEXT_POKEMONMANSION2F_SWITCH
ldh [hSpriteIndexOrTextID], a
jp DisplayTextID
PokemonMansion2F_ScriptPointers:
- dw CheckFightingMapTrainers
- dw DisplayEnemyTrainerTextAndStartBattle
- dw EndTrainerBattle
+ def_script_pointers
+ dw_const CheckFightingMapTrainers, SCRIPT_POKEMONMANSION2F_DEFAULT
+ dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_POKEMONMANSION2F_START_BATTLE
+ dw_const EndTrainerBattle, SCRIPT_POKEMONMANSION2F_END_BATTLE
PokemonMansion2F_TextPointers:
- dw Mansion2Text1
- dw PickUpItemText
- dw Mansion2Text3
- dw Mansion2Text4
- dw Mansion2Text5
+ def_text_pointers
+ dw_const PokemonMansion2FSuperNerdText, TEXT_POKEMONMANSION2F_SUPER_NERD
+ dw_const PickUpItemText, TEXT_POKEMONMANSION2F_CALCIUM
+ dw_const PokemonMansion2FDiary1Text, TEXT_POKEMONMANSION2F_DIARY1
+ dw_const PokemonMansion2FDiary2Text, TEXT_POKEMONMANSION2F_DIARY2
+ dw_const PokemonMansion2FSwitchText, TEXT_POKEMONMANSION2F_SWITCH
Mansion2TrainerHeaders:
def_trainers
Mansion2TrainerHeader0:
- trainer EVENT_BEAT_MANSION_2_TRAINER_0, 0, Mansion2BattleText1, Mansion2EndBattleText1, Mansion2AfterBattleText1
+ trainer EVENT_BEAT_MANSION_2_TRAINER_0, 0, PokemonMansion2FSuperNerdBattleText, PokemonMansion2FSuperNerdEndBattleText, PokemonMansion2FSuperNerdAfterBattleText
db -1 ; end
-Mansion2Text1:
+PokemonMansion2FSuperNerdText:
text_asm
ld hl, Mansion2TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
-Mansion2BattleText1:
- text_far _Mansion2BattleText1
+PokemonMansion2FSuperNerdBattleText:
+ text_far _PokemonMansion2FSuperNerdBattleText
text_end
-Mansion2EndBattleText1:
- text_far _Mansion2EndBattleText1
+PokemonMansion2FSuperNerdEndBattleText:
+ text_far _PokemonMansion2FSuperNerdEndBattleText
text_end
-Mansion2AfterBattleText1:
- text_far _Mansion2AfterBattleText1
+PokemonMansion2FSuperNerdAfterBattleText:
+ text_far _PokemonMansion2FSuperNerdAfterBattleText
text_end
-Mansion2Text3:
- text_far _Mansion2Text3
+PokemonMansion2FDiary1Text:
+ text_far _PokemonMansion2FDiary1Text
text_end
-Mansion2Text4:
- text_far _Mansion2Text4
+PokemonMansion2FDiary2Text:
+ text_far _PokemonMansion2FDiary2Text
text_end
-Mansion3Text6:
-Mansion2Text5:
+PokemonMansion2FSwitchText:
text_asm
- ld hl, Mansion2Text_520c2
+ ld hl, .Text
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
- jr nz, .asm_520b9
+ jr nz, .not_pressed
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, wCurrentMapScriptFlags
set 5, [hl]
- ld hl, Mansion2Text_520c7
+ ld hl, .PressedText
call PrintText
ld a, SFX_GO_INSIDE
call PlaySound
CheckAndSetEvent EVENT_MANSION_SWITCH_ON
- jr z, .asm_520bf
+ jr z, .done
ResetEventReuseHL EVENT_MANSION_SWITCH_ON
- jr .asm_520bf
-.asm_520b9
- ld hl, Mansion2Text_520cc
+ jr .done
+.not_pressed
+ ld hl, .NotPressed
call PrintText
-.asm_520bf
+.done
jp TextScriptEnd
-Mansion2Text_520c2:
- text_far _Mansion2Text_520c2
+.Text:
+ text_far _PokemonMansion2FSwitchText
text_end
-Mansion2Text_520c7:
- text_far _Mansion2Text_520c7
+.PressedText:
+ text_far _PokemonMansion2FSwitchPressedText
text_end
-Mansion2Text_520cc:
- text_far _Mansion2Text_520cc
+.NotPressed:
+ text_far _PokemonMansion2FSwitchNotPressedText
text_end