aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Route7Gate.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/Route7Gate.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/Route7Gate.asm')
-rw-r--r--scripts/Route7Gate.asm36
1 files changed, 19 insertions, 17 deletions
diff --git a/scripts/Route7Gate.asm b/scripts/Route7Gate.asm
index 9a647965..0260fb48 100644
--- a/scripts/Route7Gate.asm
+++ b/scripts/Route7Gate.asm
@@ -6,13 +6,14 @@ Route7Gate_Script:
ret
Route7Gate_ScriptPointers:
- dw Route7GateScript0
- dw Route7GateScript1
+ def_script_pointers
+ dw_const Route7DefaultScript, SCRIPT_ROUTE7GATE_DEFAULT
+ dw_const Route7PlayerMovingScript, SCRIPT_ROUTE7GATE_PLAYER_MOVING
-Route7GateScript_1e111:
+Route7GateMovePlayerLeftScript:
ld hl, wd730
set 7, [hl]
- ld a, $20
+ ld a, D_LEFT
ld [wSimulatedJoypadStatesEnd], a
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
@@ -21,11 +22,11 @@ Route7GateScript_1e111:
ld [wOverrideSimulatedJoypadStatesMask], a
ret
-Route7GateScript0:
+Route7DefaultScript:
ld a, [wd728]
bit 6, a
ret nz
- ld hl, CoordsData_1e167
+ ld hl, .PlayerInCoordsArray
call ArePlayerCoordsInArray
ret nc
ld a, PLAYER_DIR_UP
@@ -35,28 +36,28 @@ Route7GateScript0:
farcall RemoveGuardDrink
ldh a, [hItemToRemoveID]
and a
- jr nz, .asm_1e15a
- ld a, $2
+ jr nz, .have_drink
+ ld a, TEXT_ROUTE7GATE_GUARD_GEE_IM_THIRSTY
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- call Route7GateScript_1e111
- ld a, $1
+ call Route7GateMovePlayerLeftScript
+ ld a, SCRIPT_ROUTE7GATE_PLAYER_MOVING
ld [wRoute7GateCurScript], a
ret
-.asm_1e15a
- ld a, $3
+.have_drink
+ ld a, TEXT_ROUTE7GATE_GUARD_GIVE_DRINK
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd728
set 6, [hl]
ret
-CoordsData_1e167:
+.PlayerInCoordsArray:
dbmapcoord 3, 3
dbmapcoord 3, 4
db -1 ; end
-Route7GateScript1:
+Route7PlayerMovingScript:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
@@ -68,6 +69,7 @@ Route7GateScript1:
ret
Route7Gate_TextPointers:
- dw Route7GateText1
- dw Route7GateText2
- dw Route7GateText3
+ def_text_pointers
+ dw_const SaffronGateGuardText, TEXT_ROUTE7GATE_GUARD
+ dw_const SaffronGateGuardGeeImThirstyText, TEXT_ROUTE7GATE_GUARD_GEE_IM_THIRSTY
+ dw_const SaffronGateGuardGiveDrinkText, TEXT_ROUTE7GATE_GUARD_GIVE_DRINK