mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-24 23:21:26 -04:00
Player Docs: public facing csAction things (#1459)
* public cs * comments
This commit is contained in:
+25
-4
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user