diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2024-12-01 04:57:08 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-30 09:57:08 -0800 |
| commit | 009708773e255ae782fc5d49e061301f4450d2fc (patch) | |
| tree | d0b3dca3c8760ad00e9cf3581e9d14794b78ae92 /src | |
| parent | 4c3fa3efd43a1c3a60760e4f5f0820a935ba10b7 (diff) | |
Player Docs: First 8 Start Modes (#1749)
* start mode docs
* better comments
* improve owl docs
* reorder comment to more important first
* brief comment
Diffstat (limited to 'src')
| -rw-r--r-- | src/code/z_player_lib.c | 2 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 2 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Test3/z_en_test3.c | 4 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Test7/z_en_test7.c | 2 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c | 10 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_player_actor/z_player.c | 238 |
6 files changed, 145 insertions, 113 deletions
diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 85bc4aae6..1f27a4702 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -155,7 +155,7 @@ void func_801229A0(PlayState* play, Player* player) { } // Update function -void func_801229EC(Actor* thisx, PlayState* play) { +void Player_DoNothing(Actor* thisx, PlayState* play) { } s16 sMaskObjectIds[PLAYER_MASK_MAX - 1] = { diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 15a9b2573..b3235daaf 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -141,7 +141,7 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { } else { s32 destinationIdx = DOORANA_GET_ENTRANCE(&this->actor); - Play_SetupRespawnPoint(play, RESPAWN_MODE_UNK_3, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_4)); + Play_SetupRespawnPoint(play, RESPAWN_MODE_UNK_3, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_GROTTO)); gSaveContext.respawn[RESPAWN_MODE_UNK_3].pos.y = this->actor.world.pos.y; gSaveContext.respawn[RESPAWN_MODE_UNK_3].yaw = this->actor.home.rot.y; diff --git a/src/overlays/actors/ovl_En_Test3/z_en_test3.c b/src/overlays/actors/ovl_En_Test3/z_en_test3.c index 5e6fc0551..d13d1b93f 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.c +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.c @@ -161,9 +161,9 @@ static PlayerAgeProperties sAgeProperties = { 29.4343f, // openChestAnim &gPlayerAnim_clink_demo_Tbox_open, - // unk_A4 + // timeTravelStartAnim &gPlayerAnim_clink_demo_goto_future, - // unk_A8 + // timeTravelEndAnim &gPlayerAnim_clink_demo_return_to_future, // unk_AC &gPlayerAnim_clink_normal_climb_startA, diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.c b/src/overlays/actors/ovl_En_Test7/z_en_test7.c index d45a51329..60e1ce94f 100644 --- a/src/overlays/actors/ovl_En_Test7/z_en_test7.c +++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.c @@ -662,7 +662,7 @@ void EnTest7_WarpCsWarp(EnTest7* this, PlayState* play) { } else if (OWL_WARP_CS_GET_OCARINA_MODE(&this->actor) == OCARINA_MODE_WARP_TO_ENTRANCE) { func_80169F78(play); gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams = - PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_START_MODE_6); + PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_START_MODE_OWL); gSaveContext.respawnFlag = -6; } else { play->nextEntrance = diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index a3cbb3d3c..d2636d9d2 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -60,11 +60,11 @@ static s16 sSpawnActorIds[OBJMURE_TYPE_MAX] = { }; static s16 sSpawnParams[OBJMURE_TYPE_MAX] = { - KUSA_BUSH_PARAMS(false, 0, false), // OBJMURE_TYPE_GRASS - PLAYER_PARAMS(2, PLAYER_START_MODE_0), // OBJMURE_TYPE_UNDEFINED - FISH_PARAMS(ENFISH_MINUS1), // OBJMURE_TYPE_FISH - ENINSECT_PARAMS(false), // OBJMURE_TYPE_BUGS - BUTTERFLY_PARAMS(BUTTERFLY_MINUS1), // OBJMURE_TYPE_BUTTERFLY + KUSA_BUSH_PARAMS(false, 0, false), // OBJMURE_TYPE_GRASS + PLAYER_PARAMS(2, PLAYER_START_MODE_NOTHING), // OBJMURE_TYPE_UNDEFINED + FISH_PARAMS(ENFISH_MINUS1), // OBJMURE_TYPE_FISH + ENINSECT_PARAMS(false), // OBJMURE_TYPE_BUGS + BUTTERFLY_PARAMS(BUTTERFLY_MINUS1), // OBJMURE_TYPE_BUTTERFLY }; static InitChainEntry sInitChain[] = { diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 5f60f79a7..4eaec33cb 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -80,6 +80,8 @@ void func_80838A20(PlayState* play, Player* this); void func_80839978(PlayState* play, Player* this); void func_80839A10(PlayState* play, Player* this); +void func_80859CE0(PlayState* play, Player* this, s32 arg2); + typedef enum AnimSfxType { /* 1 */ ANIMSFX_TYPE_GENERAL = 1, /* 2 */ ANIMSFX_TYPE_FLOOR, @@ -113,7 +115,7 @@ typedef struct AnimSfxEntry { } AnimSfxEntry; // size = 0x4 /* action funcs */ -void Player_Action_0(Player* this, PlayState* play); +void Player_Action_OwlSaveArrive(Player* this, PlayState* play); void Player_Action_1(Player* this, PlayState* play); void Player_Action_2(Player* this, PlayState* play); void Player_Action_3(Player* this, PlayState* play); @@ -179,7 +181,7 @@ void Player_Action_62(Player* this, PlayState* play); void Player_Action_63(Player* this, PlayState* play); void Player_Action_64(Player* this, PlayState* play); void Player_Action_65(Player* this, PlayState* play); -void Player_Action_66(Player* this, PlayState* play); +void Player_Action_TimeTravelEnd(Player* this, PlayState* play); void Player_Action_67(Player* this, PlayState* play); void Player_Action_68(Player* this, PlayState* play); void Player_Action_69(Player* this, PlayState* play); @@ -187,12 +189,12 @@ void Player_Action_70(Player* this, PlayState* play); void Player_Action_ExchangeItem(Player* this, PlayState* play); void Player_Action_72(Player* this, PlayState* play); void Player_Action_73(Player* this, PlayState* play); -void Player_Action_74(Player* this, PlayState* play); -void Player_Action_75(Player* this, PlayState* play); -void Player_Action_76(Player* this, PlayState* play); +void Player_Action_WaitForCutscene(Player* this, PlayState* play); +void Player_Action_StartWarpSongArrive(Player* this, PlayState* play); +void Player_Action_BlueWarpArrive(Player* this, PlayState* play); void Player_Action_77(Player* this, PlayState* play); -void Player_Action_78(Player* this, PlayState* play); -void Player_Action_79(Player* this, PlayState* play); +void Player_Action_TryOpeningDoor(Player* this, PlayState* play); +void Player_Action_ExitGrotto(Player* this, PlayState* play); void Player_Action_80(Player* this, PlayState* play); void Player_Action_81(Player* this, PlayState* play); void Player_Action_82(Player* this, PlayState* play); @@ -801,9 +803,9 @@ PlayerAgeProperties sPlayerAgeProperties[PLAYER_FORM_MAX] = { 44.15145f, // openChestAnim &gPlayerAnim_link_demo_Tbox_open, - // unk_A4 + // timeTravelStartAnim &gPlayerAnim_link_demo_back_to_past, - // unk_A8 + // timeTravelEndAnim &gPlayerAnim_link_demo_return_to_past, // unk_AC &gPlayerAnim_link_normal_climb_startA, @@ -897,9 +899,9 @@ PlayerAgeProperties sPlayerAgeProperties[PLAYER_FORM_MAX] = { 42.0f, // openChestAnim &gPlayerAnim_pg_Tbox_open, - // unk_A4 + // timeTravelStartAnim &gPlayerAnim_link_demo_back_to_past, - // unk_A8 + // timeTravelEndAnim &gPlayerAnim_link_demo_return_to_past, // unk_AC &gPlayerAnim_pg_climb_startA, @@ -993,9 +995,9 @@ PlayerAgeProperties sPlayerAgeProperties[PLAYER_FORM_MAX] = { 36.0f, // openChestAnim &gPlayerAnim_pz_Tbox_open, - // unk_A4 + // timeTravelStartAnim &gPlayerAnim_link_demo_back_to_past, - // unk_A8 + // timeTravelEndAnim &gPlayerAnim_link_demo_return_to_past, // unk_AC &gPlayerAnim_pz_climb_startA, @@ -1089,9 +1091,9 @@ PlayerAgeProperties sPlayerAgeProperties[PLAYER_FORM_MAX] = { 33.0f, // openChestAnim &gPlayerAnim_pn_Tbox_open, - // unk_A4 + // timeTravelStartAnim &gPlayerAnim_link_demo_back_to_past, - // unk_A8 + // timeTravelEndAnim &gPlayerAnim_link_demo_return_to_past, // unk_AC &gPlayerAnim_clink_normal_climb_startA, @@ -1185,9 +1187,9 @@ PlayerAgeProperties sPlayerAgeProperties[PLAYER_FORM_MAX] = { 29.4343f, // openChestAnim &gPlayerAnim_clink_demo_Tbox_open, - // unk_A4 + // timeTravelStartAnim &gPlayerAnim_clink_demo_goto_future, - // unk_A8 + // timeTravelEndAnim &gPlayerAnim_clink_demo_return_to_future, // unk_AC &gPlayerAnim_clink_normal_climb_startA, @@ -6797,8 +6799,9 @@ s32 Player_ActionHandler_1(Player* this, PlayState* play) { ((((this->doorType <= PLAYER_DOORTYPE_TALKING) && CutsceneManager_IsNext(CS_ID_GLOBAL_TALK)) || ((this->doorType >= PLAYER_DOORTYPE_HANDLE) && CutsceneManager_IsNext(CS_ID_GLOBAL_DOOR))) && (!(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && - (CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_A) || (Player_Action_78 == this->actionFunc) || - (this->doorType == PLAYER_DOORTYPE_STAIRCASE) || (this->doorType == PLAYER_DOORTYPE_PROXIMITY))))) { + (CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_A) || + (Player_Action_TryOpeningDoor == this->actionFunc) || (this->doorType == PLAYER_DOORTYPE_STAIRCASE) || + (this->doorType == PLAYER_DOORTYPE_PROXIMITY))))) { Actor* doorActor = this->doorActor; Actor* var_v0_3; @@ -10856,89 +10859,103 @@ s32 func_808411D4(PlayState* play, Player* this, f32* arg2, s32 arg3) { return sp2C; } -void Player_StartMode_0(PlayState* play, Player* this) { - this->actor.update = func_801229EC; +void Player_StartMode_Nothing(PlayState* play, Player* this) { + this->actor.update = Player_DoNothing; this->actor.draw = NULL; } -void Player_StartMode_2(PlayState* play, Player* this) { - Player_SetAction(play, this, Player_Action_76, 0); +void Player_StartMode_BlueWarp(PlayState* play, Player* this) { + Player_SetAction(play, this, Player_Action_BlueWarpArrive, 0); + this->stateFlags1 |= PLAYER_STATE1_20000000; PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_okarina_warp_goal, PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, 24.0f, ANIMMODE_ONCE, 0.0f); + + // Start high up in the air this->actor.world.pos.y += 800.0f; } -u8 D_8085D2B0[] = { - ITEM_SWORD_RAZOR, - ITEM_SWORD_KOKIRI, -}; - -// OoT leftover? -void func_80841358(PlayState* play, Player* this, s32 arg2) { - ItemId item; - PlayerItemAction itemAction; - +/** + * Put the sword item in hand. If `playSfx` is true, the sword unsheathing sound will play. + * Sword will depend on transformation, but due to improper carryover from OoT, + * this will lead to OoB for goron, deku or human. + * + * Note: This will not play an animation, the sword instantly appears in hand. + * It is expected that this function is called while an appropriate animation + * is already playing, for example in a cutscene. + */ +void Player_PutSwordInHand(PlayState* play, Player* this, s32 playSfx) { + static u8 sSwordItemIds[] = { ITEM_SWORD_RAZOR, ITEM_SWORD_KOKIRI }; //! @bug OoB read if player is goron, deku or human - item = D_8085D2B0[this->transformation]; - itemAction = sItemItemActions[item]; + ItemId swordItemId = sSwordItemIds[this->transformation]; + PlayerItemAction swordItemAction = sItemItemActions[swordItemId]; + Player_DestroyHookshot(this); Player_DetachHeldActor(play, this); - this->heldItemId = item; - this->nextModelGroup = Player_ActionToModelGroup(this, itemAction); - Player_InitItemAction(play, this, itemAction); + + this->heldItemId = swordItemId; + this->nextModelGroup = Player_ActionToModelGroup(this, swordItemAction); + + Player_InitItemAction(play, this, swordItemAction); func_808309CC(play, this); - if (arg2) { + + if (playSfx) { Player_PlaySfx(this, NA_SE_IT_SWORD_PICKOUT); } } -Vec3f D_8085D2B4 = { -1.0f, 69.0f, 20.0f }; +void Player_StartMode_TimeTravel(PlayState* play, Player* this) { + static Vec3f sPedestalPos = { -1.0f, 69.0f, 20.0f }; -void Player_StartMode_1(PlayState* play, Player* this) { - Player_SetAction(play, this, Player_Action_66, 0); + Player_SetAction(play, this, Player_Action_TimeTravelEnd, 0); this->stateFlags1 |= PLAYER_STATE1_20000000; - Math_Vec3f_Copy(&this->actor.world.pos, &D_8085D2B4); + + Math_Vec3f_Copy(&this->actor.world.pos, &sPedestalPos); this->yaw = this->actor.shape.rot.y = -0x8000; - PlayerAnimation_Change(play, &this->skelAnime, this->ageProperties->unk_A8, PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, 0.0f, - ANIMMODE_ONCE, 0.0f); + + // The start frame and end frame are both set to 0 so that that the animation is frozen. + // `Player_Action_TimeTravelEnd` will play the animation after `animDelayTimer` completes. + PlayerAnimation_Change(play, &this->skelAnime, this->ageProperties->timeTravelEndAnim, PLAYER_ANIM_ADJUSTED_SPEED, + 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); Player_AnimReplace_Setup( play, this, ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_80 | ANIM_FLAG_200); + if (this->transformation == PLAYER_FORM_FIERCE_DEITY) { - func_80841358(play, this, false); + Player_PutSwordInHand(play, this, false); } - this->av2.actionVar2 = 20; + + this->av2.animDelayTimer = 20; } -void Player_StartMode_3(PlayState* play, Player* this) { - Player_SetAction(play, this, Player_Action_78, 0); +void Player_StartMode_Door(PlayState* play, Player* this) { + Player_SetAction(play, this, Player_Action_TryOpeningDoor, 0); Player_AnimReplace_Setup(play, this, ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); } -void Player_StartMode_4(PlayState* play, Player* this) { +void Player_StartMode_Grotto(PlayState* play, Player* this) { func_80834DB8(this, &gPlayerAnim_link_normal_jump, 12.0f, play); - Player_SetAction(play, this, Player_Action_79, 0); + Player_SetAction(play, this, Player_Action_ExitGrotto, 0); this->stateFlags1 |= PLAYER_STATE1_20000000; this->fallStartHeight = this->actor.world.pos.y; } -void Player_StartMode_7(PlayState* play, Player* this) { +void Player_StartMode_KnockedOver(PlayState* play, Player* this) { func_80833B18(play, this, 1, 2.0f, 2.0f, this->actor.shape.rot.y + 0x8000, 0); } -void Player_StartMode_5(PlayState* play, Player* this) { - Player_SetAction(play, this, Player_Action_75, 0); - this->actor.draw = NULL; +void Player_StartMode_WarpSong(PlayState* play, Player* this) { + Player_SetAction(play, this, Player_Action_StartWarpSongArrive, 0); + this->actor.draw = NULL; // Start invisible this->stateFlags1 |= PLAYER_STATE1_20000000; } -void Player_StartMode_6(PlayState* play, Player* this) { +void Player_StartMode_Owl(PlayState* play, Player* this) { if (gSaveContext.save.isOwlSave) { - Player_SetAction(play, this, Player_Action_0, 0); + Player_SetAction(play, this, Player_Action_OwlSaveArrive, 0); Player_Anim_PlayLoopMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_nwait][this->modelAnimType]); this->stateFlags1 |= PLAYER_STATE1_20000000; - this->av2.actionVar2 = 0x28; + this->av2.actionVar2 = 40; gSaveContext.save.isOwlSave = false; } else { Player_SetAction(play, this, Player_Action_Idle, 0); @@ -11017,22 +11034,22 @@ typedef void (*PlayerStartModeFunc)(PlayState*, Player*); // Initialisation functions for various gameplay modes depending on spawn params. // There may be at most 0x10 due to it using a single nybble. PlayerStartModeFunc sStartModeFuncs[PLAYER_START_MODE_MAX] = { - Player_StartMode_0, // PLAYER_START_MODE_0 - Player_StartMode_1, // PLAYER_START_MODE_1 - Player_StartMode_2, // PLAYER_START_MODE_2 - Player_StartMode_3, // PLAYER_START_MODE_3 - Player_StartMode_4, // PLAYER_START_MODE_4 - Player_StartMode_5, // PLAYER_START_MODE_5 - Player_StartMode_6, // PLAYER_START_MODE_6 - Player_StartMode_7, // PLAYER_START_MODE_7 - Player_StartMode_WarpTag, // PLAYER_START_MODE_8 - Player_StartMode_WarpTag, // PLAYER_START_MODE_9 - Player_StartMode_E, // PLAYER_START_MODE_A - Player_StartMode_B, // PLAYER_START_MODE_B - Player_StartMode_Telescope, // PLAYER_START_MODE_TELESCOPE - Player_StartMode_D, // PLAYER_START_MODE_D - Player_StartMode_E, // PLAYER_START_MODE_E - Player_StartMode_F, // PLAYER_START_MODE_F + Player_StartMode_Nothing, // PLAYER_START_MODE_NOTHING + Player_StartMode_TimeTravel, // PLAYER_START_MODE_TIME_TRAVEL + Player_StartMode_BlueWarp, // PLAYER_START_MODE_BLUE_WARP + Player_StartMode_Door, // PLAYER_START_MODE_DOOR + Player_StartMode_Grotto, // PLAYER_START_MODE_GROTTO + Player_StartMode_WarpSong, // PLAYER_START_MODE_WARP_SONG + Player_StartMode_Owl, // PLAYER_START_MODE_OWL + Player_StartMode_KnockedOver, // PLAYER_START_MODE_KNOCKED_OVER + Player_StartMode_WarpTag, // PLAYER_START_MODE_8 + Player_StartMode_WarpTag, // PLAYER_START_MODE_9 + Player_StartMode_E, // PLAYER_START_MODE_A + Player_StartMode_B, // PLAYER_START_MODE_B + Player_StartMode_Telescope, // PLAYER_START_MODE_TELESCOPE + Player_StartMode_D, // PLAYER_START_MODE_D + Player_StartMode_E, // PLAYER_START_MODE_E + Player_StartMode_F, // PLAYER_START_MODE_F }; // sBlureInit @@ -11277,7 +11294,7 @@ void Player_Init(Actor* thisx, PlayState* play) { startMode = PLAYER_GET_START_MODE(&this->actor); - if (((startMode == PLAYER_START_MODE_5) || (startMode == PLAYER_START_MODE_6)) && + if (((startMode == PLAYER_START_MODE_WARP_SONG) || (startMode == PLAYER_START_MODE_OWL)) && (gSaveContext.save.cutsceneIndex >= 0xFFF0)) { startMode = PLAYER_START_MODE_D; } @@ -14099,7 +14116,7 @@ s32 Player_UpperAction_16(Player* this, PlayState* play) { return true; } -void Player_Action_0(Player* this, PlayState* play) { +void Player_Action_OwlSaveArrive(Player* this, PlayState* play) { PlayerAnimation_Update(play, &this->skelAnime); func_808323C0(this, play->playerCsIds[PLAYER_CS_ID_ITEM_BOTTLE]); @@ -17600,16 +17617,14 @@ void Player_Action_65(Player* this, PlayState* play) { } } -AnimSfxEntry D_8085D75C[] = { - ANIMSFX(ANIMSFX_TYPE_VOICE, 5, NA_SE_VO_LI_AUTO_JUMP, CONTINUE), - ANIMSFX(ANIMSFX_TYPE_FLOOR_LAND, 15, NA_SE_NONE, STOP), -}; - -void Player_Action_66(Player* this, PlayState* play) { +void Player_Action_TimeTravelEnd(Player* this, PlayState* play) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - if (this->av1.actionVar1 == 0) { - if (DECR(this->av2.actionVar2) == 0) { - this->av1.actionVar1 = 1; + if (!this->av1.startedAnim) { + if (DECR(this->av2.animDelayTimer) == 0) { + this->av1.startedAnim = true; + + // endFrame was previously set to 0 to freeze the animation. + // Set it properly to allow the animation to play. this->skelAnime.endFrame = this->skelAnime.animLength - 1.0f; } } else { @@ -17619,7 +17634,12 @@ void Player_Action_66(Player* this, PlayState* play) { PlayerAnimation_OnFrame(&this->skelAnime, 158.0f)) { Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_SWORD_N); } else if (this->transformation != PLAYER_FORM_FIERCE_DEITY) { - Player_PlayAnimSfx(this, D_8085D75C); + static AnimSfxEntry sJumpOffPedestalAnimSfxList[] = { + ANIMSFX(ANIMSFX_TYPE_VOICE, 5, NA_SE_VO_LI_AUTO_JUMP, CONTINUE), + ANIMSFX(ANIMSFX_TYPE_FLOOR_LAND, 15, NA_SE_NONE, STOP), + }; + + Player_PlayAnimSfx(this, sJumpOffPedestalAnimSfxList); } else { func_808484CC(this); } @@ -18057,32 +18077,39 @@ void Player_Action_73(Player* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, var_v0, 0x7D0); } -void func_80859CE0(PlayState* play, Player* this, s32 arg2); - -void Player_Action_74(Player* this, PlayState* play) { - if ((DECR(this->av2.actionVar2) == 0) && Player_StartCsAction(play, this)) { +/** + * Waits to start processing a Cutscene Action. + * First, the timer `csDelayTimer` much reach 0. + * Then, there must be a CS action available to start processing. + * + * When starting the cutscene action, `draw` will be set to make + * Player appear, if he was invisible. + */ +void Player_Action_WaitForCutscene(Player* this, PlayState* play) { + if ((DECR(this->av2.csDelayTimer) == 0) && Player_StartCsAction(play, this)) { func_80859CE0(play, this, 0); Player_SetAction(play, this, Player_Action_CsAction, 0); Player_Action_CsAction(this, play); } } -void Player_Action_75(Player* this, PlayState* play) { - Player_SetAction(play, this, Player_Action_74, 0); - this->av2.actionVar2 = 0x28; +void Player_Action_StartWarpSongArrive(Player* this, PlayState* play) { + Player_SetAction(play, this, Player_Action_WaitForCutscene, 0); + this->av2.csDelayTimer = 40; + Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0x10); } void Player_Cutscene_SetPosAndYawToStart(Player* this, CsCmdActorCue* cue); -void Player_Action_76(Player* this, PlayState* play) { +void Player_Action_BlueWarpArrive(Player* this, PlayState* play) { if (sPlayerYDistToFloor < 150.0f) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - if (this->av2.actionVar2 == 0) { + if (!this->av2.playedLandingSfx) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->skelAnime.endFrame = this->skelAnime.animLength - 1.0f; Player_AnimSfx_PlayFloorLand(this); - this->av2.actionVar2 = 1; + this->av2.playedLandingSfx = true; } } else { func_8085B384(this, play); @@ -18095,10 +18122,10 @@ void Player_Action_76(Player* this, PlayState* play) { if (play->csCtx.state != CS_STATE_IDLE) { if (play->csCtx.playerCue != NULL) { s32 pad; - f32 sp28 = this->actor.world.pos.y; + f32 savedYPos = this->actor.world.pos.y; Player_Cutscene_SetPosAndYawToStart(this, play->csCtx.playerCue); - this->actor.world.pos.y = sp28; + this->actor.world.pos.y = savedYPos; } } } @@ -18139,12 +18166,17 @@ void Player_Action_77(Player* this, PlayState* play) { } } -void Player_Action_78(Player* this, PlayState* play) { +/** + * Automatically open a door (no need for the A button). + * Note: If no door is in useable range, a softlock will occur. + */ +void Player_Action_TryOpeningDoor(Player* this, PlayState* play) { Player_ActionHandler_1(this, play); } -void Player_Action_79(Player* this, PlayState* play) { +void Player_Action_ExitGrotto(Player* this, PlayState* play) { this->actor.gravity = -1.0f; + PlayerAnimation_Update(play, &this->skelAnime); if (this->actor.velocity.y < 0.0f) { @@ -20512,7 +20544,7 @@ void func_80859CE0(PlayState* play, Player* this, s32 arg2) { } void Player_CsAction_17(PlayState* play, Player* this, CsCmdActorCue* cue) { - func_80841358(play, this, false); + Player_PutSwordInHand(play, this, false); Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_link_demo_return_to_past); } @@ -20563,7 +20595,7 @@ void Player_CsAction_20(PlayState* play, Player* this, CsCmdActorCue* cue) { Player_CsAction_End(play, this, cue); } else if (this->av2.actionVar2 == 0) { Item_Give(play, ITEM_SWORD_RAZOR); - func_80841358(play, this, false); + Player_PutSwordInHand(play, this, false); } else { func_808484CC(this); } @@ -20574,7 +20606,7 @@ void Player_CsAction_21(PlayState* play, Player* this, CsCmdActorCue* cue) { func_8083FCF0(play, this, 0.0f, 99.0f, this->skelAnime.endFrame - 8.0f); } if (this->heldItemAction != PLAYER_IA_SWORD_GILDED) { - func_80841358(play, this, true); + Player_PutSwordInHand(play, this, true); } } |
