Skip to content

Commit

Permalink
Rename WalkNpcFoo actions to MoveNpcFooWalk
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed Nov 1, 2024
1 parent ddfab81 commit 6f9fbaa
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 121 deletions.
38 changes: 19 additions & 19 deletions src/cutscene.asm
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ _InitMainFork:
d_entry table, MoveAvatarRun, _MoveAvatarRun
d_entry table, MoveAvatarSwim, _MoveAvatarSwim
d_entry table, MoveAvatarWalk, _MoveAvatarWalk
d_entry table, MoveNpcAlexSwim, _MoveNpcAlexSwim
d_entry table, MoveNpcAlexWalk, _MoveNpcAlexWalk
d_entry table, MoveNpcBrunoWalk, _MoveNpcBrunoWalk
d_entry table, MoveNpcGrontaWalk, _MoveNpcGrontaWalk
d_entry table, MoveNpcMarieWalk, _MoveNpcMarieWalk
d_entry table, MoveNpcNinaWalk, _MoveNpcNinaWalk
d_entry table, MoveNpcNoraWalk, _MoveNpcNoraWalk
d_entry table, MoveNpcOrcWalk, _MoveNpcOrcWalk
d_entry table, PlayMusic, _PlayMusic
d_entry table, PlaySfxSample, _PlaySfxSample
d_entry table, RepeatFunc, _RepeatFunc
Expand All @@ -408,17 +416,9 @@ _InitMainFork:
d_entry table, SetDeviceAnim, _SetDeviceAnim
d_entry table, SetScrollFlags, _SetScrollFlags
d_entry table, ShakeRoom, _ShakeRoom
d_entry table, SwimNpcAlex, _SwimNpcAlex
d_entry table, WaitFrames, _WaitFrames
d_entry table, WaitUntilC, _WaitUntilC
d_entry table, WaitUntilZ, _WaitUntilZ
d_entry table, WalkNpcAlex, _WalkNpcAlex
d_entry table, WalkNpcBruno, _WalkNpcBruno
d_entry table, WalkNpcGronta, _WalkNpcGronta
d_entry table, WalkNpcMarie, _WalkNpcMarie
d_entry table, WalkNpcNora, _WalkNpcNora
d_entry table, WalkNpcOrc, _WalkNpcOrc
d_entry table, WalkNpcToddler, _WalkNpcToddler
D_END
.ENDREPEAT
_BranchIfC:
Expand Down Expand Up @@ -755,56 +755,56 @@ _StartMoveAvatar:
_MoveNpcReachedGoal:
ldy #4 ; param: byte offset
jmp FuncA_Cutscene_AdvanceForkAndExecute
_SwimNpcAlex:
_MoveNpcAlexSwim:
jsr _StartMoveNpc ; returns X, Z, and N
beq _MoveNpcReachedGoal
jsr FuncA_Cutscene_AnimateNpcAlexSwimming ; preserves X
jsr FuncA_Cutscene_FaceAvatarTowardsActor
clc ; cutscene should continue
rts
_WalkNpcAlex:
_MoveNpcAlexWalk:
jsr _StartMoveNpc ; returns X, Z, and N
beq _MoveNpcReachedGoal
jsr FuncA_Cutscene_AnimateNpcAlexWalking ; preserves X
jsr FuncA_Cutscene_FaceAvatarTowardsActor
clc ; cutscene should continue
rts
_WalkNpcBruno:
_MoveNpcBrunoWalk:
jsr _StartMoveNpc ; returns X, Z, and N
beq _MoveNpcReachedGoal
jsr FuncA_Cutscene_AnimateNpcBrunoWalking ; preserves X
jsr FuncA_Cutscene_FaceAvatarTowardsActor
clc ; cutscene should continue
rts
_WalkNpcGronta:
_MoveNpcGrontaWalk:
jsr _StartMoveNpc ; returns X, Z, and N
beq _MoveNpcReachedGoal
jsr FuncA_Cutscene_AnimateNpcGrontaWalking
clc ; cutscene should continue
rts
_WalkNpcMarie:
_MoveNpcMarieWalk:
jsr _StartMoveNpc ; returns X, Z, and N
beq _MoveNpcReachedGoal
jsr FuncA_Cutscene_AnimateNpcMarieWalking ; preserves X
jsr FuncA_Cutscene_FaceAvatarTowardsActor
clc ; cutscene should continue
rts
_WalkNpcNora:
_MoveNpcNinaWalk:
jsr _StartMoveNpc ; returns X, Z, and N
beq _MoveNpcReachedGoal
jsr FuncA_Cutscene_AnimateNpcNoraWalking
jsr FuncA_Cutscene_AnimateNpcToddlerWalking
clc ; cutscene should continue
rts
_WalkNpcOrc:
_MoveNpcNoraWalk:
jsr _StartMoveNpc ; returns X, Z, and N
beq _MoveNpcReachedGoal
jsr FuncA_Cutscene_AnimateNpcOrcWalking
jsr FuncA_Cutscene_AnimateNpcNoraWalking
clc ; cutscene should continue
rts
_WalkNpcToddler:
_MoveNpcOrcWalk:
jsr _StartMoveNpc ; returns X, Z, and N
beq _MoveNpcReachedGoal
jsr FuncA_Cutscene_AnimateNpcToddlerWalking
jsr FuncA_Cutscene_AnimateNpcOrcWalking
clc ; cutscene should continue
rts
_StartMoveNpc:
Expand Down
108 changes: 52 additions & 56 deletions src/cutscene.inc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ kMaxForks = 4
MoveAvatarRun ; args: goal X-position (2 bytes)
MoveAvatarSwim ; args: goal X-position (2 bytes)
MoveAvatarWalk ; args: goal X-position (2 bytes)
;; Causes the specified actor to swim/walk to the specified room pixel
;; X-position. Suspends the current cutscene fork until the actor reaches
;; the goal position.
MoveNpcAlexSwim ; args: actor index, goal X-position (2 bytes)
MoveNpcAlexWalk ; args: actor index, goal X-position (2 bytes)
MoveNpcBrunoWalk ; args: actor index, goal X-position (2 bytes)
MoveNpcGrontaWalk ; args: actor index, goal X-position (2 bytes)
MoveNpcMarieWalk ; args: actor index, goal X-position (2 bytes)
MoveNpcNinaWalk ; args: actor index, goal X-position (2 bytes)
MoveNpcNoraWalk ; args: actor index, goal X-position (2 bytes)
MoveNpcOrcWalk ; args: actor index, goal X-position (2 bytes)
;; Queues up the specified music/SFX to play next, then the current
;; cutscene fork immediately continues on to the next action.
PlayMusic ; args: eMusic value
Expand Down Expand Up @@ -166,10 +177,6 @@ kMaxForks = 4
;; Shakes the room by the specified amount, then the current cutscene fork
;; immediately continues on to the next action.
ShakeRoom ; args: num shake frames
;; Causes the specified actor to swim to the specified room pixel
;; X-position. Suspends the current cutscene fork until the actor reaches
;; the goal position.
SwimNpcAlex ; args: actor index, goal X-position (2 bytes)
;; Suspends the current cutscene fork for the specified number of frames.
WaitFrames ; args: number of frames
;; Calls the specified function. If the function clears C/Z, then the
Expand All @@ -178,16 +185,6 @@ kMaxForks = 4
;; cutscene fork immediately continues on to the next action.
WaitUntilC ; args: func ptr (2 bytes); func must return C
WaitUntilZ ; args: func ptr (2 bytes); func must return Z
;; Causes the specified actor to walk to the specified room pixel
;; X-position. Suspends the current cutscene fork until the actor reaches
;; the goal position.
WalkNpcAlex ; args: actor index, goal X-position (2 bytes)
WalkNpcBruno ; args: actor index, goal X-position (2 bytes)
WalkNpcGronta ; args: actor index, goal X-position (2 bytes)
WalkNpcMarie ; args: actor index, goal X-position (2 bytes)
WalkNpcNora ; args: actor index, goal X-position (2 bytes)
WalkNpcOrc ; args: actor index, goal X-position (2 bytes)
WalkNpcToddler ; args: actor index, goal X-position (2 bytes)
NUM_VALUES
.ENDENUM

Expand Down Expand Up @@ -238,12 +235,51 @@ kMaxForks = 4
.word GOALX
.ENDMACRO

;;; TODO: rename this to act_MoveAvatarWalk
.MACRO act_WalkAvatar GOALX
.MACRO act_MoveAvatarWalk GOALX
.byte eAction::MoveAvatarWalk
.word GOALX
.ENDMACRO

.MACRO act_MoveNpcAlexSwim INDEX, GOALX
.byte eAction::MoveNpcAlexSwim, INDEX
.word GOALX
.ENDMACRO

.MACRO act_MoveNpcAlexWalk INDEX, GOALX
.byte eAction::MoveNpcAlexWalk, INDEX
.word GOALX
.ENDMACRO

.MACRO act_MoveNpcBrunoWalk INDEX, GOALX
.byte eAction::MoveNpcBrunoWalk, INDEX
.word GOALX
.ENDMACRO

.MACRO act_MoveNpcGrontaWalk INDEX, GOALX
.byte eAction::MoveNpcGrontaWalk, INDEX
.word GOALX
.ENDMACRO

.MACRO act_MoveNpcMarieWalk INDEX, GOALX
.byte eAction::MoveNpcMarieWalk, INDEX
.word GOALX
.ENDMACRO

.MACRO act_MoveNpcNinaWalk INDEX, GOALX
.byte eAction::MoveNpcNinaWalk, INDEX
.word GOALX
.ENDMACRO

.MACRO act_MoveNpcNoraWalk INDEX, GOALX
.byte eAction::MoveNpcNoraWalk, INDEX
.word GOALX
.ENDMACRO

.MACRO act_MoveNpcOrcWalk INDEX, GOALX
.byte eAction::MoveNpcOrcWalk, INDEX
.word GOALX
.ENDMACRO

.MACRO act_PlayMusic EMUSIC
.byte eAction::PlayMusic
.byte EMUSIC
Expand Down Expand Up @@ -356,11 +392,6 @@ kMaxForks = 4
.byte eAction::ShakeRoom, FRAMES
.ENDMACRO

.MACRO act_SwimNpcAlex INDEX, GOALX
.byte eAction::SwimNpcAlex, INDEX
.word GOALX
.ENDMACRO

.MACRO act_WaitFrames FRAMES
.byte eAction::WaitFrames, FRAMES
.ENDMACRO
Expand All @@ -375,39 +406,4 @@ kMaxForks = 4
.addr FUNC
.ENDMACRO

.MACRO act_WalkNpcAlex INDEX, GOALX
.byte eAction::WalkNpcAlex, INDEX
.word GOALX
.ENDMACRO

.MACRO act_WalkNpcBruno INDEX, GOALX
.byte eAction::WalkNpcBruno, INDEX
.word GOALX
.ENDMACRO

.MACRO act_WalkNpcGronta INDEX, GOALX
.byte eAction::WalkNpcGronta, INDEX
.word GOALX
.ENDMACRO

.MACRO act_WalkNpcMarie INDEX, GOALX
.byte eAction::WalkNpcMarie, INDEX
.word GOALX
.ENDMACRO

.MACRO act_WalkNpcNora INDEX, GOALX
.byte eAction::WalkNpcNora, INDEX
.word GOALX
.ENDMACRO

.MACRO act_WalkNpcOrc INDEX, GOALX
.byte eAction::WalkNpcOrc, INDEX
.word GOALX
.ENDMACRO

.MACRO act_WalkNpcToddler INDEX, GOALX
.byte eAction::WalkNpcToddler, INDEX
.word GOALX
.ENDMACRO

;;;=========================================================================;;;
6 changes: 3 additions & 3 deletions src/rooms/city_center.asm
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ _WriteRegLock:
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexStanding
act_WaitFrames 30
;; Make Alex walk over to talk to Gronta.
act_WalkNpcAlex kAlexActorIndex, $0346
act_MoveNpcAlexWalk kAlexActorIndex, $0346
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexStanding
act_RunDialog eDialog::CityCenterBreakerCity1
act_SetActorState1 kGrontaActorIndex, eNpcOrc::GrontaStanding
Expand All @@ -770,10 +770,10 @@ _WriteRegLock:
;; Make Gronta mutter to herself, then walk offscreen.
act_SetActorFlags kAlexActorIndex, 0
act_RunDialog eDialog::CityCenterBreakerCity2
act_WalkNpcGronta kGrontaActorIndex, $0418
act_MoveNpcGrontaWalk kGrontaActorIndex, $0418
act_WaitFrames 90
;; Make Alex walk to the edge of the roof.
act_WalkNpcAlex kAlexActorIndex, $0322
act_MoveNpcAlexWalk kAlexActorIndex, $0322
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexStanding
act_WaitFrames 6
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexKneeling
Expand Down
6 changes: 3 additions & 3 deletions src/rooms/core_boss.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1964,12 +1964,12 @@ _Blaster:
act_SetActorState2 kGrontaActorIndex, $ff
act_BranchIfZ _GetHorzScreen, _LeftSide_sCutscene
_RightSide_sCutscene:
act_WalkAvatar $0168
act_MoveAvatarWalk $0168
act_SetAvatarFlags kPaletteObjAvatarNormal | bObj::FlipH
act_ForkStart 0, _IntroDialog_sCutscene
_LeftSide_sCutscene:
act_SetActorFlags kGrontaActorIndex, bObj::FlipH
act_WalkAvatar $00b8
act_MoveAvatarWalk $00b8
act_SetAvatarFlags kPaletteObjAvatarNormal
_IntroDialog_sCutscene:
act_SetAvatarPose eAvatar::Standing
Expand Down Expand Up @@ -2138,7 +2138,7 @@ _TurnOnFinalTerminal:
;; down, as though searching for an exit.
act_ForkStart 1, _ShakeBig_sCutscene
act_WaitFrames 30
act_WalkAvatar $0100
act_MoveAvatarWalk $0100
act_SetAvatarPose eAvatar::Standing
act_WaitFrames 30
act_SetAvatarPose eAvatar::Kneeling
Expand Down
2 changes: 1 addition & 1 deletion src/rooms/core_lock.asm
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ _Passages_sPassage_arr:
act_SetActorVelY kGrontaActorIndex, 0
;; Make Gronta run through the eastern passage.
act_WaitFrames 20
act_WalkNpcGronta kGrontaActorIndex, $0118
act_MoveNpcGrontaWalk kGrontaActorIndex, $0118
act_WaitFrames 90
act_JumpToMain Main_Breaker_FadeBackToBreakerRoom
_RaiseLift3:
Expand Down
2 changes: 1 addition & 1 deletion src/rooms/factory_elevator.asm
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ _WriteL:
act_SetAvatarVelX 0
act_SetAvatarPose eAvatar::Standing
act_RunDialog eDialog::FactoryElevatorBrunoWait
act_WalkAvatar $00ba
act_MoveAvatarWalk $00ba
act_SetAvatarFlags kPaletteObjAvatarNormal | 0
act_SetAvatarPose eAvatar::Standing
act_WaitFrames 30
Expand Down
10 changes: 5 additions & 5 deletions src/rooms/factory_vault.asm
Original file line number Diff line number Diff line change
Expand Up @@ -182,23 +182,23 @@ _Passages_sPassage_arr:
;; Anna steps out of the way to the left.
act_ForkStart 1, _WalkAvatar_sCutscene
;; Alex walks over to the big tank and kneels down for a closer look.
act_WalkNpcAlex kAlexActorIndex, $007a
act_MoveNpcAlexWalk kAlexActorIndex, $007a
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexStanding
act_WaitFrames 45
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexKneeling
act_WaitFrames 60
;; Alex reads off the label on the tank.
act_RunDialog eDialog::FactoryVaultAlex2
;; Alex walk over and looks at the tank from the right side.
act_WalkNpcAlex kAlexActorIndex, $009c
act_MoveNpcAlexWalk kAlexActorIndex, $009c
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexStanding
act_WaitFrames 10
act_SetActorFlags kAlexActorIndex, bObj::FlipH
act_WaitFrames 10
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexLooking
act_WaitFrames 90
;; Alex walk over and looks at the tank from the left side.
act_WalkNpcAlex kAlexActorIndex, $006c
act_MoveNpcAlexWalk kAlexActorIndex, $006c
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexStanding
act_WaitFrames 10
act_SetActorFlags kAlexActorIndex, 0
Expand All @@ -208,14 +208,14 @@ _Passages_sPassage_arr:
;; Alex thinks out loud for a bit.
act_RunDialog eDialog::FactoryVaultAlex3
;; Alex walks back to where he was standing before and talks to Anna again.
act_WalkNpcAlex kAlexActorIndex, $0060
act_MoveNpcAlexWalk kAlexActorIndex, $0060
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexStanding
act_SetActorState2 kAlexActorIndex, 0
act_CallFunc _SetFlag
act_RunDialog eDialog::FactoryVaultAlex1
act_ContinueExploring
_WalkAvatar_sCutscene:
act_WalkAvatar $0050 | kTalkRightAvatarOffset
act_MoveAvatarWalk $0050 | kTalkRightAvatarOffset
act_SetAvatarPose eAvatar::Standing
act_SetAvatarFlags kPaletteObjAvatarNormal | 0
act_ForkStop $ff
Expand Down
4 changes: 2 additions & 2 deletions src/rooms/mermaid_hut1.asm
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ _Alex:
.PROC DataA_Cutscene_MermaidHut1AlexPetition_sCutscene
act_RunDialog eDialog::MermaidHut1AlexPetition
;; Make Alex walk to the edge of the platform.
act_WalkNpcAlex kAlexActorIndex, $00a0
act_MoveNpcAlexWalk kAlexActorIndex, $00a0
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexStanding
act_ForkStart 1, _MoveAvatarSwim_sCutscene
act_WaitFrames 6
Expand All @@ -263,7 +263,7 @@ _Alex:
act_SetActorVelY kAlexActorIndex, 0
act_SetActorPosY kAlexActorIndex, $00c4
;; Make Alex swim to the door and exit the room.
act_SwimNpcAlex kAlexActorIndex, $0077
act_MoveNpcAlexSwim kAlexActorIndex, $0077
act_SetActorState1 kAlexActorIndex, eNpcChild::AlexSwimDoor
act_WaitFrames 15
act_CallFunc _RemoveAlex
Expand Down
Loading

0 comments on commit 6f9fbaa

Please sign in to comment.