aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/PokemonMansion1F.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/PokemonMansion1F.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/PokemonMansion1F.asm')
-rw-r--r--scripts/PokemonMansion1F.asm64
1 files changed, 33 insertions, 31 deletions
diff --git a/scripts/PokemonMansion1F.asm b/scripts/PokemonMansion1F.asm
index 247562a9..c1fef205 100644
--- a/scripts/PokemonMansion1F.asm
+++ b/scripts/PokemonMansion1F.asm
@@ -51,79 +51,81 @@ Mansion1Script_Switches::
ret nz
xor a
ldh [hJoyHeld], a
- ld a, $4
+ ld a, TEXT_POKEMONMANSION1F_SWITCH
ldh [hSpriteIndexOrTextID], a
jp DisplayTextID
PokemonMansion1F_ScriptPointers:
- dw CheckFightingMapTrainers
- dw DisplayEnemyTrainerTextAndStartBattle
- dw EndTrainerBattle
+ def_script_pointers
+ dw_const CheckFightingMapTrainers, SCRIPT_POKEMONMANSION1F_DEFAULT
+ dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_POKEMONMANSION1F_START_BATTLE
+ dw_const EndTrainerBattle, SCRIPT_POKEMONMANSION1F_END_BATTLE
PokemonMansion1F_TextPointers:
- dw Mansion1Text1
- dw PickUpItemText
- dw PickUpItemText
- dw Mansion1Text4
+ def_text_pointers
+ dw_const PokemonMansion1FScientistText, TEXT_POKEMONMANSION1F_SCIENTIST
+ dw_const PickUpItemText, TEXT_POKEMONMANSION1F_ESCAPE_ROPE
+ dw_const PickUpItemText, TEXT_POKEMONMANSION1F_CARBOS
+ dw_const PokemonMansion1FSwitchText, TEXT_POKEMONMANSION1F_SWITCH
Mansion1TrainerHeaders:
def_trainers
Mansion1TrainerHeader0:
- trainer EVENT_BEAT_MANSION_1_TRAINER_0, 3, Mansion1BattleText2, Mansion1EndBattleText2, Mansion1AfterBattleText2
+ trainer EVENT_BEAT_MANSION_1_TRAINER_0, 3, PokemonMansion1FScientistBattleText, PokemonMansion1FScientistEndBattleText, PokemonMansion1FScientistAfterBattleText
db -1 ; end
-Mansion1Text1:
+PokemonMansion1FScientistText:
text_asm
ld hl, Mansion1TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
-Mansion1BattleText2:
- text_far _Mansion1BattleText2
+PokemonMansion1FScientistBattleText:
+ text_far _PokemonMansion1FScientistBattleText
text_end
-Mansion1EndBattleText2:
- text_far _Mansion1EndBattleText2
+PokemonMansion1FScientistEndBattleText:
+ text_far _PokemonMansion1FScientistEndBattleText
text_end
-Mansion1AfterBattleText2:
- text_far _Mansion1AfterBattleText2
+PokemonMansion1FScientistAfterBattleText:
+ text_far _PokemonMansion1FScientistAfterBattleText
text_end
-Mansion1Text4:
+PokemonMansion1FSwitchText:
text_asm
- ld hl, MansionSwitchText
+ ld hl, .Text
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
- jr nz, .asm_4438c
+ jr nz, .not_pressed
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, wCurrentMapScriptFlags
set 5, [hl]
- ld hl, MansionSwitchPressedText
+ ld hl, .PressedText
call PrintText
ld a, SFX_GO_INSIDE
call PlaySound
CheckAndSetEvent EVENT_MANSION_SWITCH_ON
- jr z, .asm_44392
+ jr z, .done
ResetEventReuseHL EVENT_MANSION_SWITCH_ON
- jr .asm_44392
-.asm_4438c
- ld hl, MansionSwitchNotPressedText
+ jr .done
+.not_pressed
+ ld hl, .NotPressedText
call PrintText
-.asm_44392
+.done
jp TextScriptEnd
-MansionSwitchText:
- text_far _MansionSwitchText
+.Text:
+ text_far _PokemonMansion1FSwitchText
text_end
-MansionSwitchPressedText:
- text_far _MansionSwitchPressedText
+.PressedText:
+ text_far _PokemonMansion1FSwitchPressedText
text_end
-MansionSwitchNotPressedText:
- text_far _MansionSwitchNotPressedText
+.NotPressedText:
+ text_far _PokemonMansion1FSwitchNotPressedText
text_end