aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/LancesRoom.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2023-11-20 00:33:27 -0600
committerdannye <33dannye@gmail.com>2023-11-20 20:23:27 -0600
commit298e99d3776580585c3f434e5d93137ae431bdd3 (patch)
treea808c4ffd0fd0f9bd28972bae5236e0d3345c8e5 /scripts/LancesRoom.asm
parentAdd sound bits documentation for wOptions (#110) (diff)
parentName 2 unnamed labels I missed in SeafoamIslandsB4F and PokemonMansion3F (#437) (diff)
downloadpokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.tar.gz
pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.tar.xz
pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'scripts/LancesRoom.asm')
-rw-r--r--scripts/LancesRoom.asm50
1 files changed, 26 insertions, 24 deletions
diff --git a/scripts/LancesRoom.asm b/scripts/LancesRoom.asm
index 8a3dc31d..75215cba 100644
--- a/scripts/LancesRoom.asm
+++ b/scripts/LancesRoom.asm
@@ -36,21 +36,22 @@ LanceShowOrHideEntranceBlocks:
predef_jump ReplaceTileBlock
ResetLanceScript:
- xor a
+ xor a ; SCRIPT_LANCESROOM_DEFAULT
ld [wLancesRoomCurScript], a
ret
LancesRoom_ScriptPointers:
- dw LanceScript0
- dw DisplayEnemyTrainerTextAndStartBattle
- dw LanceScript2
- dw LanceScript3
- dw LanceScript4
+ def_script_pointers
+ dw_const LancesRoomDefaultScript, SCRIPT_LANCESROOM_DEFAULT
+ dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_LANCESROOM_LANCE_START_BATTLE
+ dw_const LancesRoomLanceEndBattleScript, SCRIPT_LANCESROOM_LANCE_END_BATTLE
+ dw_const LancesRoomPlayerIsMovingScript, SCRIPT_LANCESROOM_PLAYER_IS_MOVING
+ dw_const LancesRoomNoopScript, SCRIPT_LANCESROOM_NOOP
-LanceScript4:
+LancesRoomNoopScript:
ret
-LanceScript0:
+LancesRoomDefaultScript:
CheckEvent EVENT_BEAT_LANCE
ret nz
ld hl, LanceTriggerMovementCoords
@@ -61,7 +62,7 @@ LanceScript0:
ld a, [wCoordIndex]
cp $3 ; Is player standing next to Lance's sprite?
jr nc, .notStandingNextToLance
- ld a, $1
+ ld a, TEXT_LANCESROOM_LANCE
ldh [hSpriteIndexOrTextID], a
jp DisplayTextID
.notStandingNextToLance
@@ -83,18 +84,18 @@ LanceTriggerMovementCoords:
dbmapcoord 24, 16
db -1 ; end
-LanceScript2:
+LancesRoomLanceEndBattleScript:
call EndTrainerBattle
ld a, [wIsInBattle]
cp $ff
jp z, ResetLanceScript
- ld a, $1
+ ld a, TEXT_LANCESROOM_LANCE
ldh [hSpriteIndexOrTextID], a
jp DisplayTextID
WalkToLance:
; Moves the player down the hallway to Lance's room.
- ld a, $ff
+ ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
ld hl, wSimulatedJoypadStatesEnd
ld de, WalkToLance_RLEList
@@ -102,7 +103,7 @@ WalkToLance:
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
- ld a, $3
+ ld a, SCRIPT_LANCESROOM_PLAYER_IS_MOVING
ld [wLancesRoomCurScript], a
ld [wCurMapScript], a
ret
@@ -114,42 +115,43 @@ WalkToLance_RLEList:
db D_LEFT, 6
db -1 ; end
-LanceScript3:
+LancesRoomPlayerIsMovingScript:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
call Delay3
- xor a
+ xor a ; SCRIPT_LANCESROOM_DEFAULT
ld [wJoyIgnore], a
ld [wLancesRoomCurScript], a
ld [wCurMapScript], a
ret
LancesRoom_TextPointers:
- dw LanceText1
+ def_text_pointers
+ dw_const LancesRoomLanceText, TEXT_LANCESROOM_LANCE
LancesRoomTrainerHeaders:
def_trainers
LancesRoomTrainerHeader0:
- trainer EVENT_BEAT_LANCES_ROOM_TRAINER_0, 0, LanceBeforeBattleText, LanceEndBattleText, LanceAfterBattleText
+ trainer EVENT_BEAT_LANCES_ROOM_TRAINER_0, 0, LancesRoomLanceBeforeBattleText, LancesRoomLanceEndBattleText, LancesRoomLanceAfterBattleText
db -1 ; end
-LanceText1:
+LancesRoomLanceText:
text_asm
ld hl, LancesRoomTrainerHeader0
call TalkToTrainer
jp TextScriptEnd
-LanceBeforeBattleText:
- text_far _LanceBeforeBattleText
+LancesRoomLanceBeforeBattleText:
+ text_far _LancesRoomLanceBeforeBattleText
text_end
-LanceEndBattleText:
- text_far _LanceEndBattleText
+LancesRoomLanceEndBattleText:
+ text_far _LancesRoomLanceEndBattleText
text_end
-LanceAfterBattleText:
- text_far _LanceAfterBattleText
+LancesRoomLanceAfterBattleText:
+ text_far _LancesRoomLanceAfterBattleText
text_asm
SetEvent EVENT_BEAT_LANCE
jp TextScriptEnd