aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/SeafoamIslandsB4F.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/SeafoamIslandsB4F.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/SeafoamIslandsB4F.asm')
-rw-r--r--scripts/SeafoamIslandsB4F.asm65
1 files changed, 34 insertions, 31 deletions
diff --git a/scripts/SeafoamIslandsB4F.asm b/scripts/SeafoamIslandsB4F.asm
index 5fa51bb7..98ea0a5b 100644
--- a/scripts/SeafoamIslandsB4F.asm
+++ b/scripts/SeafoamIslandsB4F.asm
@@ -11,22 +11,24 @@ SeafoamIslands5Script_467a5:
ret
SeafoamIslandsB4F_ScriptPointers:
- dw SeafoamIslands5Script0
- dw SeafoamIslands5Script1
- dw SeafoamIslands5Script2
- dw SeafoamIslands5Script3
- dw SeafoamIslands5Script4
+ def_script_pointers
+ dw_const SeafoamIslandsB4FDefaultScript, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT
+ dw_const SeafoamIslandsB4FObjectMoving1Script, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING1
+ dw_const SeafoamIslandsB4FMoveObjectScript, SCRIPT_SEAFOAMISLANDSB4F_MOVE_OBJECT
+ dw_const SeafoamIslandsB4FObjectMoving2Script, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING2
+ dw_const SeafoamIslandsB4FObjectMoving3Script, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING3
+ EXPORT SCRIPT_SEAFOAMISLANDSB4F_MOVE_OBJECT ; used by engine/overworld/player_state.asm
-SeafoamIslands5Script4:
+SeafoamIslandsB4FObjectMoving3Script:
ld a, [wIsInBattle]
cp $ff
jr z, SeafoamIslands5Script_467a5
call EndTrainerBattle
- ld a, $0
+ ld a, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT
ld [wSeafoamIslandsB4FCurScript], a
ret
-SeafoamIslands5Script0:
+SeafoamIslandsB4FDefaultScript:
CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE
ret z
ld hl, .Coords
@@ -48,7 +50,7 @@ SeafoamIslands5Script0:
call StartSimulatingJoypadStates
ld hl, wFlags_D733
res 2, [hl]
- ld a, $1
+ ld a, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING1
ld [wSeafoamIslandsB4FCurScript], a
ret
@@ -59,23 +61,23 @@ SeafoamIslands5Script0:
dbmapcoord 21, 16
db -1 ; end
-SeafoamIslands5Script1:
+SeafoamIslandsB4FObjectMoving1Script:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
xor a
ld [wJoyIgnore], a
- ld a, $0
+ ld a, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT
ld [wSeafoamIslandsB4FCurScript], a
ret
-SeafoamIslands5Script2:
+SeafoamIslandsB4FMoveObjectScript:
CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE
- ld a, $0
+ ld a, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT
jr z, .asm_46849
ld hl, .Coords
call ArePlayerCoordsInArray
- ld a, $0
+ ld a, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT
jr nc, .asm_46849
ld a, [wCoordIndex]
cp $1
@@ -90,7 +92,7 @@ SeafoamIslands5Script2:
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
- ld a, $3
+ ld a, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING2
.asm_46849
ld [wSeafoamIslandsB4FCurScript], a
ret
@@ -112,7 +114,7 @@ RLEMovementData_46859:
db D_UP, 1
db -1 ; end
-SeafoamIslands5Script3:
+SeafoamIslandsB4FObjectMoving2Script:
ld a, [wSimulatedJoypadStatesIndex]
ld b, a
cp $1
@@ -120,7 +122,7 @@ SeafoamIslands5Script3:
ld a, b
and a
ret nz
- ld a, $0
+ ld a, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT
ld [wSeafoamIslandsB4FCurScript], a
ret
@@ -131,40 +133,41 @@ SeaFoamIslands5Script_46872:
jp ForceBikeOrSurf
SeafoamIslandsB4F_TextPointers:
- dw BoulderText
- dw BoulderText
- dw ArticunoText
- dw SeafoamIslands5Text4
- dw SeafoamIslands5Text5
+ def_text_pointers
+ dw_const BoulderText, TEXT_SEAFOAMISLANDSB4F_BOULDER1
+ dw_const BoulderText, TEXT_SEAFOAMISLANDSB4F_BOULDER2
+ dw_const SeafoamIslandsB4FArticunoText, TEXT_SEAFOAMISLANDSB4F_ARTICUNO
+ dw_const SeafoamIslandsB4FBouldersSignText, TEXT_SEAFOAMISLANDSB4F_BOULDERS_SIGN
+ dw_const SeafoamIslandsB4FDangerSignText, TEXT_SEAFOAMISLANDSB4F_DANGER_SIGN
; Articuno is object 3, but its event flag is bit 2.
; This is not a problem because its sight range is 0, and
; trainer headers were not stored by ExecuteCurMapScriptInTable.
def_trainers 2
ArticunoTrainerHeader:
- trainer EVENT_BEAT_ARTICUNO, 0, ArticunoBattleText, ArticunoBattleText, ArticunoBattleText
+ trainer EVENT_BEAT_ARTICUNO, 0, SeafoamIslandsB4FArticunoBattleText, SeafoamIslandsB4FArticunoBattleText, SeafoamIslandsB4FArticunoBattleText
db -1 ; end
-ArticunoText:
+SeafoamIslandsB4FArticunoText:
text_asm
ld hl, ArticunoTrainerHeader
call TalkToTrainer
- ld a, $4
+ ld a, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING3
ld [wSeafoamIslandsB4FCurScript], a
jp TextScriptEnd
-ArticunoBattleText:
- text_far _ArticunoBattleText
+SeafoamIslandsB4FArticunoBattleText:
+ text_far _SeafoamIslandsB4FArticunoBattleText
text_asm
ld a, ARTICUNO
call PlayCry
call WaitForSoundToFinish
jp TextScriptEnd
-SeafoamIslands5Text4:
- text_far _SeafoamIslands5Text4
+SeafoamIslandsB4FBouldersSignText:
+ text_far _SeafoamIslandsB4FBouldersSignText
text_end
-SeafoamIslands5Text5:
- text_far _SeafoamIslands5Text5
+SeafoamIslandsB4FDangerSignText:
+ text_far _SeafoamIslandsB4FDangerSignText
text_end