aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/FightingDojo.asm10
-rw-r--r--scripts/PalletTown.asm8
-rw-r--r--scripts/Route22.asm24
-rw-r--r--scripts/SafariZoneGate.asm18
-rw-r--r--scripts/SilphCo11F.asm10
-rw-r--r--scripts/SilphCo7F.asm8
-rw-r--r--scripts/VermilionCity.asm2
7 files changed, 40 insertions, 40 deletions
diff --git a/scripts/FightingDojo.asm b/scripts/FightingDojo.asm
index 298c2fcb..d434f681 100644
--- a/scripts/FightingDojo.asm
+++ b/scripts/FightingDojo.asm
@@ -32,15 +32,15 @@ FightingDojoDefaultScript:
ret nz
xor a
ldh [hJoyHeld], a
- ld [wcf0d], a
+ ld [wSavedCoordIndex], a
ld a, [wYCoord]
cp 3
ret nz
ld a, [wXCoord]
cp 4
ret nz
- ld a, $1
- ld [wcf0d], a
+ ld a, 1
+ ld [wSavedCoordIndex], a
ld a, PLAYER_DIR_RIGHT
ld [wPlayerMovingDirection], a
ld a, FIGHTINGDOJO_KARATE_MASTER
@@ -57,8 +57,8 @@ FightingDojoKarateMasterPostBattleScript:
ld a, [wIsInBattle]
cp $ff
jp z, FightingDojoResetScripts
- ld a, [wcf0d]
- and a
+ ld a, [wSavedCoordIndex]
+ and a ; nz if the player was at (4, 3), left of the Karate Master
jr z, .already_facing
ld a, PLAYER_DIR_RIGHT
ld [wPlayerMovingDirection], a
diff --git a/scripts/PalletTown.asm b/scripts/PalletTown.asm
index dd898ac6..4d5bebf0 100644
--- a/scripts/PalletTown.asm
+++ b/scripts/PalletTown.asm
@@ -45,7 +45,7 @@ PalletTownDefaultScript:
PalletTownOakHeyWaitScript:
xor a
- ld [wcf0d], a
+ ld [wOakWalkedToPlayer], a
ld a, TEXT_PALLETTOWN_OAK
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
@@ -96,8 +96,8 @@ PalletTownOakNotSafeComeWithMeScript:
ret nz
xor a ; ld a, SPRITE_FACING_DOWN
ld [wSpritePlayerStateData1FacingDirection], a
- ld a, 1
- ld [wcf0d], a
+ ld a, TRUE
+ ld [wOakWalkedToPlayer], a
ld a, SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
ld a, TEXT_PALLETTOWN_OAK
@@ -161,7 +161,7 @@ PalletTown_TextPointers:
PalletTownOakText:
text_asm
- ld a, [wcf0d]
+ ld a, [wOakWalkedToPlayer]
and a
jr nz, .next
ld a, 1
diff --git a/scripts/Route22.asm b/scripts/Route22.asm
index abf6c8e4..1e575e43 100644
--- a/scripts/Route22.asm
+++ b/scripts/Route22.asm
@@ -38,7 +38,7 @@ Route22GetRivalTrainerNoByStarterScript:
Route22MoveRivalRightScript:
ld de, Route22RivalMovementData
- ld a, [wcf0d]
+ ld a, [wSavedCoordIndex]
cp $1
jr z, .skip_first_right
inc de
@@ -62,7 +62,7 @@ Route22DefaultScript:
call ArePlayerCoordsInArray
ret nc
ld a, [wCoordIndex]
- ld [wcf0d], a
+ ld [wSavedCoordIndex], a
xor a
ldh [hJoyHeld], a
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
@@ -107,8 +107,8 @@ Route22Rival1StartBattleScript:
ld a, [wd730]
bit 0, a
ret nz
- ld a, [wcf0d]
- cp $1
+ ld a, [wSavedCoordIndex]
+ cp 1 ; index of second, lower entry in Route22DefaultScript.Route22RivalBattleCoords
jr nz, .set_rival_facing_right
ld a, PLAYER_DIR_DOWN
ld [wPlayerMovingDirection], a
@@ -172,8 +172,8 @@ Route22Rival1AfterBattleScript:
ld [wNewSoundID], a
call PlaySound
farcall Music_RivalAlternateStart
- ld a, [wcf0d]
- cp $1
+ ld a, [wSavedCoordIndex]
+ cp 1 ; index of second, lower entry in Route22DefaultScript.Route22RivalBattleCoords
jr nz, .exit_movement_2
call .RivalExit1Script
jr .next_script
@@ -263,8 +263,8 @@ Route22Rival2StartBattleScript:
ret nz
ld a, ROUTE22_RIVAL2
ldh [hSpriteIndex], a
- ld a, [wcf0d]
- cp $1
+ ld a, [wSavedCoordIndex]
+ cp 1 ; index of second, lower entry in Route22DefaultScript.Route22RivalBattleCoords
jr nz, .set_player_direction_left
ld a, PLAYER_DIR_DOWN
ld [wPlayerMovingDirection], a
@@ -307,8 +307,8 @@ Route22Rival2AfterBattleScript:
jp z, Route22SetDefaultScript
ld a, ROUTE22_RIVAL2
ldh [hSpriteIndex], a
- ld a, [wcf0d]
- cp $1
+ ld a, [wSavedCoordIndex]
+ cp 1 ; index of second, lower entry in Route22DefaultScript.Route22RivalBattleCoords
jr nz, .set_player_direction_left
ld a, PLAYER_DIR_DOWN
ld [wPlayerMovingDirection], a
@@ -331,8 +331,8 @@ Route22Rival2AfterBattleScript:
ld [wNewSoundID], a
call PlaySound
farcall Music_RivalAlternateStartAndTempo
- ld a, [wcf0d]
- cp $1
+ ld a, [wSavedCoordIndex]
+ cp 1 ; index of second, lower entry in Route22DefaultScript.Route22RivalBattleCoords
jr nz, .exit_movement_2
call .RivalExit1Script
jr .next_script
diff --git a/scripts/SafariZoneGate.asm b/scripts/SafariZoneGate.asm
index a0f9c1f4..14a8a79b 100644
--- a/scripts/SafariZoneGate.asm
+++ b/scripts/SafariZoneGate.asm
@@ -29,14 +29,14 @@ SafariZoneGateDefaultScript:
ld a, SPRITE_FACING_RIGHT
ld [wSpritePlayerStateData1FacingDirection], a
ld a, [wCoordIndex]
- cp $1
+ cp 1 ; index of second, lower entry in .PlayerNextToSafariZoneWorker1CoordsArray
jr z, .player_not_next_to_worker
ld a, SCRIPT_SAFARIZONEGATE_WOULD_YOU_LIKE_TO_JOIN
ld [wSafariZoneGateCurScript], a
ret
.player_not_next_to_worker
ld a, D_RIGHT
- ld c, $1
+ ld c, 1
call SafariZoneEntranceAutoWalk
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
@@ -88,7 +88,7 @@ SafariZoneGateLeavingSafariScript:
xor a
ld [wNumSafariBalls], a
ld a, D_DOWN
- ld c, $3
+ ld c, 3
call SafariZoneEntranceAutoWalk
ld a, SCRIPT_SAFARIZONEGATE_PLAYER_MOVING_DOWN
ld [wSafariZoneGateCurScript], a
@@ -113,7 +113,7 @@ SafariZoneGateSetScriptAfterMoveScript:
call SafariZoneGateReturnSimulatedJoypadStateScript
ret nz
call Delay3
- ld a, [wcf0d]
+ ld a, [wNextSafariZoneGateScript]
ld [wSafariZoneGateCurScript], a
ret
@@ -236,11 +236,11 @@ SafariZoneGateSafariZoneWorker1LeavingEarlyText:
xor a
ld [wSpritePlayerStateData1FacingDirection], a
ld a, D_DOWN
- ld c, $3
+ ld c, 3
call SafariZoneEntranceAutoWalk
ResetEvents EVENT_SAFARI_GAME_OVER, EVENT_IN_SAFARI_ZONE
- ld a, $0
- ld [wcf0d], a
+ ld a, SCRIPT_SAFARIZONEGATE_DEFAULT
+ ld [wNextSafariZoneGateScript], a
jr .set_current_script
.not_ready_to_leave
ld hl, .GoodLuckText
@@ -248,10 +248,10 @@ SafariZoneGateSafariZoneWorker1LeavingEarlyText:
ld a, SPRITE_FACING_UP
ld [wSpritePlayerStateData1FacingDirection], a
ld a, D_UP
- ld c, $1
+ ld c, 1
call SafariZoneEntranceAutoWalk
ld a, SCRIPT_SAFARIZONEGATE_LEAVING_SAFARI
- ld [wcf0d], a
+ ld [wNextSafariZoneGateScript], a
.set_current_script
ld a, SCRIPT_SAFARIZONEGATE_SET_SCRIPT_AFTER_MOVE
ld [wSafariZoneGateCurScript], a
diff --git a/scripts/SilphCo11F.asm b/scripts/SilphCo11F.asm
index 1a2978a8..778283c5 100644
--- a/scripts/SilphCo11F.asm
+++ b/scripts/SilphCo11F.asm
@@ -170,7 +170,7 @@ SilphCo11FDefaultScript:
call ArePlayerCoordsInArray
jp nc, CheckFightingMapTrainers
ld a, [wCoordIndex]
- ld [wcf0d], a
+ ld [wSavedCoordIndex], a
xor a
ldh [hJoyHeld], a
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
@@ -209,8 +209,8 @@ SilphCo11FGiovanniAfterBattleScript:
ld a, [wIsInBattle]
cp $ff
jp z, SilphCo11FResetCurScript
- ld a, [wcf0d]
- cp $1
+ ld a, [wSavedCoordIndex]
+ cp 1 ; index of second, upper-right entry in SilphCo11FDefaultScript.PlayerCoordsArray
jr z, .face_player_up
ld a, PLAYER_DIR_LEFT
ld b, SPRITE_FACING_RIGHT
@@ -242,8 +242,8 @@ SilphCo11FGiovanniBattleFacingScript:
ld a, SILPHCO11F_GIOVANNI
ldh [hSpriteIndex], a
call SetSpriteMovementBytesToFF
- ld a, [wcf0d]
- cp $1
+ ld a, [wSavedCoordIndex]
+ cp 1 ; index of second, upper-right entry in SilphCo11FDefaultScript.PlayerCoordsArray
jr z, .face_player_up
ld a, PLAYER_DIR_LEFT
ld b, SPRITE_FACING_RIGHT
diff --git a/scripts/SilphCo7F.asm b/scripts/SilphCo7F.asm
index c6afd27a..bfa78847 100644
--- a/scripts/SilphCo7F.asm
+++ b/scripts/SilphCo7F.asm
@@ -145,8 +145,8 @@ SilphCo7FDefaultScript:
call SetSpriteMovementBytesToFF
ld de, .RivalMovementUp
ld a, [wCoordIndex]
- ld [wcf0d], a
- cp $1
+ ld [wSavedCoordIndex], a
+ cp 1 ; index of second, lower entry in .RivalEncounterCoordinates
jr z, .full_rival_movement
inc de
.full_rival_movement
@@ -225,8 +225,8 @@ SilphCo7FRivalAfterBattleScript:
call PlaySound
farcall Music_RivalAlternateStart
ld de, .RivalWalkAroundPlayerMovement
- ld a, [wcf0d]
- cp $1
+ ld a, [wSavedCoordIndex]
+ cp 1 ; index of second, lower entry in SilphCo7FDefaultScript.RivalEncounterCoordinates
jr nz, .walk_around_player
ld de, .RivalExitRightMovement
.walk_around_player
diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm
index 4c8a0b18..9d800233 100644
--- a/scripts/VermilionCity.asm
+++ b/scripts/VermilionCity.asm
@@ -47,7 +47,7 @@ VermilionCityDefaultScript:
ret nc
xor a
ldh [hJoyHeld], a
- ld [wcf0d], a
+ ld [wSavedCoordIndex], a ; unnecessary
ld a, TEXT_VERMILIONCITY_SAILOR1
ldh [hSpriteIndexOrTextID], a
call DisplayTextID