aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Route6Gate.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/Route6Gate.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/Route6Gate.asm')
-rw-r--r--scripts/Route6Gate.asm36
1 files changed, 19 insertions, 17 deletions
diff --git a/scripts/Route6Gate.asm b/scripts/Route6Gate.asm
index 143f60ae..db4cfcab 100644
--- a/scripts/Route6Gate.asm
+++ b/scripts/Route6Gate.asm
@@ -6,14 +6,15 @@ Route6Gate_Script:
ret
Route6Gate_ScriptPointers:
- dw Route6GateScript0
- dw Route6GateScript1
+ def_script_pointers
+ dw_const Route6GateDefaultScript, SCRIPT_ROUTE6GATE_DEFAULT
+ dw_const Route6GatePlayerMovingScript, SCRIPT_ROUTE6GATE_PLAYER_MOVING
-Route6GateScript0:
+Route6GateDefaultScript:
ld a, [wd728]
bit 6, a
ret nz
- ld hl, CoordsData_1e08c
+ ld hl, .PlayerInCoordsArray
call ArePlayerCoordsInArray
ret nc
ld a, PLAYER_DIR_RIGHT
@@ -23,27 +24,27 @@ Route6GateScript0:
farcall RemoveGuardDrink
ldh a, [hItemToRemoveID]
and a
- jr nz, .asm_1e080
- ld a, $2
+ jr nz, .have_drink
+ ld a, TEXT_ROUTE6GATE_GUARD_GEE_IM_THIRSTY
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- call Route6GateScript_1e0a1
- ld a, $1
+ call Route6GateMovePlayerDownScript
+ ld a, SCRIPT_ROUTE6GATE_PLAYER_MOVING
ld [wRoute6GateCurScript], a
ret
-.asm_1e080
+.have_drink
ld hl, wd728
set 6, [hl]
- ld a, $3
+ ld a, TEXT_ROUTE6GATE_GUARD_GIVE_DRINK
ldh [hSpriteIndexOrTextID], a
jp DisplayTextID
-CoordsData_1e08c:
+.PlayerInCoordsArray:
dbmapcoord 3, 2
dbmapcoord 4, 2
db -1 ; end
-Route6GateScript1:
+Route6GatePlayerMovingScript:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
@@ -53,10 +54,10 @@ Route6GateScript1:
ld [wRoute6GateCurScript], a
ret
-Route6GateScript_1e0a1:
+Route6GateMovePlayerDownScript:
ld hl, wd730
set 7, [hl]
- ld a, $80
+ ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
@@ -66,6 +67,7 @@ Route6GateScript_1e0a1:
ret
Route6Gate_TextPointers:
- dw Route6GateText1
- dw Route6GateText2
- dw Route6GateText3
+ def_text_pointers
+ dw_const SaffronGateGuardText, TEXT_ROUTE6GATE_GUARD
+ dw_const SaffronGateGuardGeeImThirstyText, TEXT_ROUTE6GATE_GUARD_GEE_IM_THIRSTY
+ dw_const SaffronGateGuardGiveDrinkText, TEXT_ROUTE6GATE_GUARD_GIVE_DRINK