diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2023-11-06 10:34:53 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-05 20:34:53 -0300 |
| commit | f8a5f11d6d53f5bb3982eef9a8fdebd491ec98ff (patch) | |
| tree | 8dbf28eb2ac1e7aecfcb0a2c9284ea48bb860cd3 /src/code | |
| parent | 10a14feb2c9a484597fce6e29df0ab5f7fa62848 (diff) | |
Player Docs: public facing csAction things (#1459)
* public cs
* comments
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 29 | ||||
| -rw-r--r-- | src/code/z_eventmgr.c | 6 |
2 files changed, 28 insertions, 7 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 3b68a0853..aacee620b 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1402,7 +1402,17 @@ void Actor_SpawnHorse(PlayState* play, Player* player) { Horse_Spawn(play, player); } -s32 func_800B724C(PlayState* play, Actor* actor, u8 csAction) { +/** + * Sets a Player Cutscene Action specified by `csAction`. + * + * `haltActorsDuringCsAction` being set to false in this function means that all actors will + * be able to update while Player is performing the cutscene action. + * + * Note: due to how player implements initializing the cutscene action state, `haltActorsDuringCsAction` + * will only be considered the first time player starts a `csAction`. + * Player must leave the cutscene action state and enter it again before halting actors can be toggled. + */ +s32 Player_SetCsAction(PlayState* play, Actor* csActor, u8 csAction) { Player* player = GET_PLAYER(play); if ((player->csAction == PLAYER_CSACTION_5) || @@ -1411,15 +1421,26 @@ s32 func_800B724C(PlayState* play, Actor* actor, u8 csAction) { } player->csAction = csAction; - player->csActor = actor; + player->csActor = csActor; player->cv.haltActorsDuringCsAction = false; return true; } -s32 func_800B7298(PlayState* play, Actor* actor, u8 csAction) { +/** + * Sets a Player Cutscene Action specified by `csAction`. + * + * `haltActorsDuringCsAction` being set to true in this function means that eventually `PLAYER_STATE1_20000000` will be + * set. This makes it so actors belonging to categories `ACTORCAT_ENEMY` and `ACTORCAT_MISC` will not update while + * Player is performing the cutscene action. + * + * Note: due to how player implements initializing the cutscene action state, `haltActorsDuringCsAction` + * will only be considered the first time player starts a `csAction`. + * Player must leave the cutscene action state and enter it again before halting actors can be toggled. + */ +s32 Player_SetCsActionWithHaltedActors(PlayState* play, Actor* csActor, u8 csAction) { Player* player = GET_PLAYER(play); - if (func_800B724C(play, actor, csAction)) { + if (Player_SetCsAction(play, csActor, csAction)) { player->cv.haltActorsDuringCsAction = true; return true; } diff --git a/src/code/z_eventmgr.c b/src/code/z_eventmgr.c index 9f08806f9..d682ed4f4 100644 --- a/src/code/z_eventmgr.c +++ b/src/code/z_eventmgr.c @@ -213,7 +213,7 @@ void CutsceneManager_End(void) { sCutsceneMgr.targetActor->flags &= ~ACTOR_FLAG_100000; // fallthrough case CS_START_1: - func_800B7298(sCutsceneMgr.play, NULL, PLAYER_CSACTION_END); + Player_SetCsActionWithHaltedActors(sCutsceneMgr.play, NULL, PLAYER_CSACTION_END); sCutsceneMgr.startMethod = CS_START_0; break; @@ -344,7 +344,7 @@ s16 CutsceneManager_StartWithPlayerCs(s16 csId, Actor* actor) { s16 startCsId = CutsceneManager_Start(csId, actor); if (startCsId >= 0) { - func_800B7298(sCutsceneMgr.play, NULL, PLAYER_CSACTION_WAIT); + Player_SetCsActionWithHaltedActors(sCutsceneMgr.play, NULL, PLAYER_CSACTION_WAIT); if (sCutsceneMgr.length == 0) { CutsceneManager_Stop(sCutsceneMgr.csId); } @@ -360,7 +360,7 @@ s16 CutsceneManager_StartWithPlayerCsAndSetFlag(s16 csId, Actor* actor) { s16 startCsId = CutsceneManager_Start(csId, actor); if (startCsId >= 0) { - func_800B7298(sCutsceneMgr.play, NULL, PLAYER_CSACTION_WAIT); + Player_SetCsActionWithHaltedActors(sCutsceneMgr.play, NULL, PLAYER_CSACTION_WAIT); if (sCutsceneMgr.length == 0) { CutsceneManager_Stop(sCutsceneMgr.csId); } |
