diff --git a/include/z64animation.h b/include/z64animation.h index 3ee160c00e..4c255a7396 100644 --- a/include/z64animation.h +++ b/include/z64animation.h @@ -12,6 +12,10 @@ struct Actor; struct SkelAnime; struct PlayerAnimationFrame; +// for indexing `jointTable[]` and `morphTable[]` +#define LIMB_ROOT_POS 0 // Translation/Offset of the root limb +#define LIMB_ROOT_ROT 1 // Rotation of the root limb + #define LIMB_DONE 0xFF #define BODYPART_NONE -1 @@ -186,7 +190,7 @@ typedef struct SkelAnime { } update; /* 0x34 */ s8 initFlags; // Flags used when initializing Player's skeleton /* 0x35 */ u8 moveFlags; // Flags used for animations that move the actor in worldspace. - /* 0x36 */ s16 prevRot; // Previous rotation in worldspace. + /* 0x36 */ s16 prevYaw; // Previous rotation in worldspace. /* 0x38 */ Vec3s prevTransl; // Previous modelspace translation. /* 0x3E */ Vec3s baseTransl; // Base modelspace translation. } SkelAnime; // size = 0x44 diff --git a/include/z64player.h b/include/z64player.h index 8adf2247a5..bfc5b91ff8 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -317,6 +317,13 @@ typedef enum PlayerDoorType { /* 5 */ PLAYER_DOORTYPE_PROXIMITY } PlayerDoorType; +// Some player animations are played at this reduced speed, for reasons yet unclear. +// Perhaps to compress animation data? +// This is called "adjusted" for now. +// z_en_horse also has many instances of this adjusted speed +#define PLAYER_ANIM_ADJUSTED_SPEED (2.0f / 3.0f) +#define PLAYER_ANIM_NORMAL_SPEED (3.0f / 3.0f) + typedef enum PlayerAnimType { /* 0 */ PLAYER_ANIMTYPE_DEFAULT, // DEFAULT /* 1 */ PLAYER_ANIMTYPE_1, diff --git a/src/code/z_en_hy_code.c b/src/code/z_en_hy_code.c index 3ca6b175d5..993876030e 100644 --- a/src/code/z_en_hy_code.c +++ b/src/code/z_en_hy_code.c @@ -187,8 +187,8 @@ void func_800F0BB4(EnHy* enHy, PlayState* play, EnDoor* door, s16 arg3, s16 arg4 phi_f0 = (offset.z >= 0.0f) ? 1.0f : -1.0f; animIndex = ((s8)phi_f0 < 0) ? 0 : 2; EnHy_ChangeObjectAndAnim(enHy, play, (animIndex == 0) ? arg3 : arg4); - enHy->skelAnime.baseTransl = *enHy->skelAnime.jointTable; - enHy->skelAnime.prevTransl = *enHy->skelAnime.jointTable; + enHy->skelAnime.baseTransl = enHy->skelAnime.jointTable[LIMB_ROOT_POS]; + enHy->skelAnime.prevTransl = enHy->skelAnime.jointTable[LIMB_ROOT_POS]; enHy->skelAnime.moveFlags |= (ANIM_FLAG_UPDATE_Y | ANIM_FLAG_1); AnimationContext_SetMoveActor(play, &enHy->actor, &enHy->skelAnime, 1.0f); door->knobDoor.playOpenAnim = true; diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index bb900b994b..7b33d9cf5e 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -100,11 +100,11 @@ void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, Over Matrix_Push(); rootLimb = Lib_SegmentedToVirtual(skeleton[0]); - pos.x = jointTable[0].x; - pos.y = jointTable[0].y; - pos.z = jointTable[0].z; + pos.x = jointTable[LIMB_ROOT_POS].x; + pos.y = jointTable[LIMB_ROOT_POS].y; + pos.z = jointTable[LIMB_ROOT_POS].z; - rot = jointTable[1]; + rot = jointTable[LIMB_ROOT_ROT]; dList = rootLimb->dLists[lod]; if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, actor)) { @@ -219,11 +219,11 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, Matrix_Push(); rootLimb = Lib_SegmentedToVirtual(skeleton[0]); - pos.x = jointTable[0].x; - pos.y = jointTable[0].y; - pos.z = jointTable[0].z; + pos.x = jointTable[LIMB_ROOT_POS].x; + pos.y = jointTable[LIMB_ROOT_POS].y; + pos.z = jointTable[LIMB_ROOT_POS].z; - rot = jointTable[1]; + rot = jointTable[LIMB_ROOT_ROT]; newDList = limbDList = rootLimb->dLists[lod]; @@ -326,11 +326,11 @@ void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Over Matrix_Push(); rootLimb = Lib_SegmentedToVirtual(skeleton[0]); - pos.x = jointTable[0].x; - pos.y = jointTable[0].y; - pos.z = jointTable[0].z; + pos.x = jointTable[LIMB_ROOT_POS].x; + pos.y = jointTable[LIMB_ROOT_POS].y; + pos.z = jointTable[LIMB_ROOT_POS].z; - rot = jointTable[1]; + rot = jointTable[LIMB_ROOT_ROT]; dList = rootLimb->dList; if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, actor)) { @@ -439,10 +439,10 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, rootLimb = Lib_SegmentedToVirtual(skeleton[0]); - pos.x = jointTable[0].x; - pos.y = jointTable[0].y; - pos.z = jointTable[0].z; - rot = jointTable[1]; + pos.x = jointTable[LIMB_ROOT_POS].x; + pos.y = jointTable[LIMB_ROOT_POS].y; + pos.z = jointTable[LIMB_ROOT_POS].z; + rot = jointTable[LIMB_ROOT_ROT]; newDList = limbDList = rootLimb->dList; @@ -575,10 +575,10 @@ void SkelAnime_DrawTransformFlexOpa(PlayState* play, void** skeleton, Vec3s* joi rootLimb = Lib_SegmentedToVirtual(skeleton[0]); - pos.x = jointTable[0].x; - pos.y = jointTable[0].y; - pos.z = jointTable[0].z; - rot = jointTable[1]; + pos.x = jointTable[LIMB_ROOT_POS].x; + pos.y = jointTable[LIMB_ROOT_POS].y; + pos.z = jointTable[LIMB_ROOT_POS].z; + rot = jointTable[LIMB_ROOT_ROT]; newDList = limbDList = rootLimb->dList; @@ -722,11 +722,11 @@ Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, Overrid rootLimb = Lib_SegmentedToVirtual(skeleton[0]); - pos.x = jointTable[0].x; - pos.y = jointTable[0].y; - pos.z = jointTable[0].z; + pos.x = jointTable[LIMB_ROOT_POS].x; + pos.y = jointTable[LIMB_ROOT_POS].y; + pos.z = jointTable[LIMB_ROOT_POS].z; - rot = jointTable[1]; + rot = jointTable[LIMB_ROOT_ROT]; dList = rootLimb->dList; @@ -838,11 +838,11 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 rootLimb = Lib_SegmentedToVirtual(skeleton[0]); - pos.x = jointTable[0].x; - pos.y = jointTable[0].y; - pos.z = jointTable[0].z; + pos.x = jointTable[LIMB_ROOT_POS].x; + pos.y = jointTable[LIMB_ROOT_POS].y; + pos.z = jointTable[LIMB_ROOT_POS].z; - rot = jointTable[1]; + rot = jointTable[LIMB_ROOT_ROT]; newDList = limbDList = rootLimb->dList; @@ -1236,7 +1236,7 @@ void SkelAnime_InitPlayer(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHea skelAnime->morphTable = (void*)ALIGN16((uintptr_t)morphTableBuffer); } - PlayerAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f); + PlayerAnimation_Change(play, skelAnime, animation, PLAYER_ANIM_NORMAL_SPEED, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f); } /** @@ -1386,8 +1386,8 @@ void PlayerAnimation_Change(PlayState* play, SkelAnime* skelAnime, PlayerAnimati * Immediately changes to a Player animation that plays once at the default speed. */ void PlayerAnimation_PlayOnce(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation) { - PlayerAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(&animation->common), - ANIMMODE_ONCE, 0.0f); + PlayerAnimation_Change(play, skelAnime, animation, PLAYER_ANIM_NORMAL_SPEED, 0.0f, + Animation_GetLastFrame(&animation->common), ANIMMODE_ONCE, 0.0f); } /** @@ -1403,8 +1403,8 @@ void PlayerAnimation_PlayOnceSetSpeed(PlayState* play, SkelAnime* skelAnime, Pla * Immediately changes to a Player animation that loops at the default speed. */ void PlayerAnimation_PlayLoop(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation) { - PlayerAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(&animation->common), - ANIMMODE_LOOP, 0.0f); + PlayerAnimation_Change(play, skelAnime, animation, PLAYER_ANIM_NORMAL_SPEED, 0.0f, + Animation_GetLastFrame(&animation->common), ANIMMODE_LOOP, 0.0f); } /** @@ -1564,7 +1564,6 @@ void SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade if (jointTable == NULL) { skelAnime->jointTable = ZeldaArena_Malloc(sizeof(*skelAnime->jointTable) * skelAnime->limbCount); - skelAnime->morphTable = ZeldaArena_Malloc(sizeof(*skelAnime->morphTable) * skelAnime->limbCount); } else { skelAnime->jointTable = jointTable; @@ -1932,29 +1931,30 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) { diff->x = 0.0f; } else { // `angle` rotation around y axis. - x = skelAnime->jointTable->x - skelAnime->prevTransl.x; - z = skelAnime->jointTable->z - skelAnime->prevTransl.z; + x = skelAnime->jointTable[LIMB_ROOT_POS].x - skelAnime->prevTransl.x; + z = skelAnime->jointTable[LIMB_ROOT_POS].z - skelAnime->prevTransl.z; sin = Math_SinS(angle); cos = Math_CosS(angle); diff->x = x * cos + z * sin; diff->z = z * cos - x * sin; } - skelAnime->prevTransl.x = skelAnime->jointTable->x; - skelAnime->jointTable->x = skelAnime->baseTransl.x; - skelAnime->prevTransl.z = skelAnime->jointTable->z; - skelAnime->jointTable->z = skelAnime->baseTransl.z; + skelAnime->prevTransl.x = skelAnime->jointTable[LIMB_ROOT_POS].x; + skelAnime->jointTable[LIMB_ROOT_POS].x = skelAnime->baseTransl.x; + skelAnime->prevTransl.z = skelAnime->jointTable[LIMB_ROOT_POS].z; + skelAnime->jointTable[LIMB_ROOT_POS].z = skelAnime->baseTransl.z; + if (skelAnime->moveFlags & ANIM_FLAG_UPDATE_Y) { if (skelAnime->moveFlags & ANIM_FLAG_NOMOVE) { diff->y = 0.0f; } else { - diff->y = skelAnime->jointTable->y - skelAnime->prevTransl.y; + diff->y = skelAnime->jointTable[LIMB_ROOT_POS].y - skelAnime->prevTransl.y; } - skelAnime->prevTransl.y = skelAnime->jointTable->y; - skelAnime->jointTable->y = skelAnime->baseTransl.y; + skelAnime->prevTransl.y = skelAnime->jointTable[LIMB_ROOT_POS].y; + skelAnime->jointTable[LIMB_ROOT_POS].y = skelAnime->baseTransl.y; } else { diff->y = 0.0f; - skelAnime->prevTransl.y = skelAnime->jointTable->y; + skelAnime->prevTransl.y = skelAnime->jointTable[LIMB_ROOT_POS].y; } skelAnime->moveFlags &= ~ANIM_FLAG_NOMOVE; } diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c index e630ed150e..3cc7ffb87b 100644 --- a/src/code/z_sub_s.c +++ b/src/code/z_sub_s.c @@ -121,10 +121,10 @@ Gfx* SubS_DrawTransformFlex(PlayState* play, void** skeleton, Vec3s* jointTable, gSPSegment(gfx++, 0x0D, mtx); Matrix_Push(); rootLimb = Lib_SegmentedToVirtual(skeleton[0]); - pos.x = jointTable->x; - pos.y = jointTable->y; - pos.z = jointTable->z; - rot = jointTable[1]; + pos.x = jointTable[LIMB_ROOT_POS].x; + pos.y = jointTable[LIMB_ROOT_POS].y; + pos.z = jointTable[LIMB_ROOT_POS].z; + rot = jointTable[LIMB_ROOT_ROT]; newDlist = rootLimb->dList; limbDList = rootLimb->dList; diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index d4bc604ebd..c7f2ecd556 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -285,7 +285,7 @@ s32 DemoEffect_OverrideLimbDrawTimewarp(PlayState* play, SkelCurve* skelCurve, s CLOSE_DISPS(play->state.gfxCtx); if (limbIndex == 0) { - s16* transform = skelCurve->jointTable[0]; + s16* transform = skelCurve->jointTable[LIMB_ROOT_POS]; transform[2] = transform[0] = 1024; transform[1] = 1024; diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 3c3bbe0f53..2fb74563f1 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -1432,7 +1432,7 @@ void EnHorse_JumpLanding(EnHorse* this, PlayState* play) { this->animIndex = ENHORSE_ANIM_GALLOP; Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); jointTable = this->skin.skelAnime.jointTable; - y = jointTable->y; + y = jointTable[LIMB_ROOT_POS].y; this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f; this->postDrawFunc = NULL; } @@ -1721,7 +1721,7 @@ void EnHorse_StartLowJump(EnHorse* this, PlayState* play) { this->actor.velocity.y = 0.0f; jointTable = this->skin.skelAnime.jointTable; - y = jointTable->y; + y = jointTable[LIMB_ROOT_POS].y; this->riderPos.y -= ((y * 0.01f) * this->unk_528) * 0.01f; if (this->type == HORSE_TYPE_2) { @@ -1775,7 +1775,7 @@ void EnHorse_LowJump(EnHorse* this, PlayState* play) { } } else { jointTable = this->skin.skelAnime.jointTable; - temp_f0 = jointTable->y; + temp_f0 = jointTable[LIMB_ROOT_POS].y; this->actor.world.pos.y = this->jumpStartY + (temp_f0 * 0.01f * this->unk_528 * 0.01f); } @@ -1818,7 +1818,7 @@ void EnHorse_StartHighJump(EnHorse* this, PlayState* play) { this->actor.velocity.y = 0.0f; jointTable = this->skin.skelAnime.jointTable; - y = jointTable->y; + y = jointTable[LIMB_ROOT_POS].y; this->riderPos.y -= ((y * 0.01f) * this->unk_528) * 0.01f; this->stateFlags |= ENHORSE_CALC_RIDER_POS; @@ -1873,7 +1873,7 @@ void EnHorse_HighJump(EnHorse* this, PlayState* play) { } } else { jointTable = this->skin.skelAnime.jointTable; - temp_f0 = jointTable->y; + temp_f0 = jointTable[LIMB_ROOT_POS].y; this->actor.world.pos.y = this->jumpStartY + (temp_f0 * 0.01f * this->unk_528 * 0.01f); } @@ -2334,7 +2334,7 @@ void func_80881398(EnHorse* this, PlayState* play) { } } else { jointTable = this->skin.skelAnime.jointTable; - y = jointTable->y; + y = jointTable[LIMB_ROOT_POS].y; this->actor.world.pos.y = this->jumpStartY + (y * 0.01f * this->unk_528 * 0.01f); } @@ -2363,7 +2363,7 @@ void func_8088159C(EnHorse* this, PlayState* play) { this->animIndex = ENHORSE_ANIM_GALLOP; Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); jointTable = this->skin.skelAnime.jointTable; - y = jointTable->y; + y = jointTable[LIMB_ROOT_POS].y; this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f; this->postDrawFunc = NULL; } @@ -2551,7 +2551,7 @@ void EnHorse_CsPlayHighJumpAnim(EnHorse* this, PlayState* play) { this->actor.velocity.y = 0.0f; jointTable = this->skin.skelAnime.jointTable; - y = jointTable->y; + y = jointTable[LIMB_ROOT_POS].y; this->riderPos.y -= y * 0.01f * this->unk_528 * 0.01f; this->stateFlags |= ENHORSE_ANIM_HIGH_JUMP; @@ -2596,7 +2596,7 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { } } else { jointTable = this->skin.skelAnime.jointTable; - y = jointTable->y; + y = jointTable[LIMB_ROOT_POS].y; this->actor.world.pos.y = this->jumpStartY + (y * 0.01f * this->unk_528 * 0.01f); } @@ -2621,7 +2621,7 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { sPlaybackSpeeds[6]); jointTable = this->skin.skelAnime.jointTable; - y = jointTable->y; + y = jointTable[LIMB_ROOT_POS].y; this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f; this->postDrawFunc = NULL; @@ -4231,7 +4231,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { this->stateFlags &= ~ENHORSE_OBSTACLE; this->unk_3EC = thisx->world.rot.y; if ((this->animIndex == ENHORSE_ANIM_STOPPING) || (this->animIndex == ENHORSE_ANIM_REARING)) { - this->skin.skelAnime.jointTable[0].y += 0x154; + this->skin.skelAnime.jointTable[LIMB_ROOT_POS].y += 0x154; } this->curFrame = this->skin.skelAnime.curFrame; @@ -4265,7 +4265,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { this->rider->actor.shape.rot.y = thisx->shape.rot.y; } else if (this->action == ENHORSE_ACTION_6) { EnIn* in = this->rider; - s16 jnt = in->jointTable[0].y; + s16 jnt = in->jointTable[LIMB_ROOT_POS].y; in->actor.world.pos.x = this->riderPos.x; in->actor.world.pos.y = this->riderPos.y - (jnt * 0.01f * this->unk_528 * 0.01f); @@ -4712,9 +4712,9 @@ void EnHorse_Draw(Actor* thisx, PlayState* play) { } } else { if (this->stateFlags & ENHORSE_JUMPING) { - this->skin.skelAnime.jointTable->x = 0; - this->skin.skelAnime.jointTable->y = 0; - this->skin.skelAnime.jointTable->z = 0; + this->skin.skelAnime.jointTable[LIMB_ROOT_POS].x = 0; + this->skin.skelAnime.jointTable[LIMB_ROOT_POS].y = 0; + this->skin.skelAnime.jointTable[LIMB_ROOT_POS].z = 0; } SkelAnime_DrawFlexOpa(play, this->skin.skelAnime.skeleton, this->skin.skelAnime.jointTable, this->skin.skelAnime.dListCount, func_80888D18, NULL, &this->actor); diff --git a/src/overlays/actors/ovl_En_Rz/z_en_rz.c b/src/overlays/actors/ovl_En_Rz/z_en_rz.c index ebd8523ad4..5026a71cc3 100644 --- a/src/overlays/actors/ovl_En_Rz/z_en_rz.c +++ b/src/overlays/actors/ovl_En_Rz/z_en_rz.c @@ -223,12 +223,12 @@ void EnRz_ChangeAnim(PlayState* play, EnRz* this, s16 animIndex, u8 animMode, f3 endFrame = Animation_GetLastFrame(sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)]); if (animMode == ANIMMODE_LOOP) { PlayerAnimation_Change(play, &this->skelAnime, - sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)], 2.0f / 3.0f, 0.0f, - endFrame, ANIMMODE_LOOP, morphFrames); + sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)], + PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, endFrame, ANIMMODE_LOOP, morphFrames); } else { PlayerAnimation_Change(play, &this->skelAnime, - sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)], 2.0f / 3.0f, 0.0f, - endFrame, ANIMMODE_LOOP, morphFrames); + sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)], + PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, endFrame, ANIMMODE_LOOP, morphFrames); } } else { Animation_Change(&this->skelAnime, animationPtr[animIndex], 1.0f, 0.0f, diff --git a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c index fee13a23f2..e6762053e8 100644 --- a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c +++ b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c @@ -370,7 +370,7 @@ void EnSyatekiOkuta_UpdateCollision(EnSyatekiOkuta* this, PlayState* play) { } this->collider.dim.pos.x = this->actor.world.pos.x; - // jointTable->y is the y-translation of the skeleton root + // jointTable->y is the y-translation of the skeleton root, see `LIMB_ROOT_POS` this->collider.dim.pos.y = this->actor.world.pos.y + (this->skelAnime.jointTable->y * this->actor.scale.y); this->collider.dim.pos.z = this->actor.world.pos.z; CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); 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 c2cb794edb..79a7623e81 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.c +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.c @@ -320,7 +320,8 @@ s32 func_80A3E898(EnTest3* this, PlayState* play) { Message_ContinueTextbox(play, textId); } if (textId == 0x296B) { - PlayerAnimation_PlayOnceSetSpeed(play, &this->player.skelAnime, &gPlayerAnim_al_yareyare, 2.0f / 3.0f); + PlayerAnimation_PlayOnceSetSpeed(play, &this->player.skelAnime, &gPlayerAnim_al_yareyare, + PLAYER_ANIM_ADJUSTED_SPEED); } return false; } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 1b5ae4b03e..c5b571a8f9 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -319,25 +319,27 @@ void Player_CsAction_46(PlayState* play, Player* this, CsCmdActorCue* cue); void Player_CsAction_End(PlayState* play, Player* this, CsCmdActorCue* cue); void Player_CsAction_48(PlayState* play, Player* this, CsCmdActorCue* cue); -void Player_CsAnim_1(PlayState* play, Player* this, void* arg2); // void* arg2 -void Player_CsAnim_2(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_3(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_4(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_5(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_6(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_7(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_8(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_9(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_10(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_11(PlayState* play, Player* this, void* cue); // CsCmdActorCue* cue -void Player_CsAnim_12(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_13(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_14(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_15(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_16(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_17(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim -void Player_CsAnim_18(PlayState* play, Player* this, void* entry); // AnimSfxEntry* entry -void Player_CsAnim_19(PlayState* play, Player* this, void* anim); // PlayerAnimationHeader* anim +// Mostly PlayerAnimationHeader* anim + +void Player_CsAnim_StopHorizontalMovement(PlayState* play, Player* this, void* arg2); // void* arg2 +void Player_CsAnim_PlayOnceMorphReset(PlayState* play, Player* this, void* anim); +void Player_CsAnim_PlayOnceSlowMorphAdjustedReset(PlayState* play, Player* this, void* anim); +void Player_CsAnim_PlayLoopSlowMorphAdjustedReset(PlayState* play, Player* this, void* anim); +void Player_CsAnim_ReplacePlayOnceNormalAdjusted(PlayState* play, Player* this, void* anim); +void Player_CsAnim_ReplacePlayOnce(PlayState* play, Player* this, void* anim); +void Player_CsAnim_ReplacePlayLoopNormalAdjusted(PlayState* play, Player* this, void* anim); +void Player_CsAnim_ReplacePlayLoop(PlayState* play, Player* this, void* anim); +void Player_CsAnim_PlayOnce(PlayState* play, Player* this, void* anim); +void Player_CsAnim_PlayLoop(PlayState* play, Player* this, void* anim); +void Player_CsAnim_Update(PlayState* play, Player* this, void* cue); // CsCmdActorCue* cue +void Player_CsAnim_PlayLoopAdjustedSlowMorphAnimSfxReset(PlayState* play, Player* this, void* anim); +void Player_CsAnim_PlayLoopNormalAdjustedOnceFinished(PlayState* play, Player* this, void* anim); +void Player_CsAnim_PlayOnceFreezeReset(PlayState* play, Player* this, void* anim); +void Player_CsAnim_PlayOnceAdjusted(PlayState* play, Player* this, void* anim); +void Player_CsAnim_PlayLoopAdjusted(PlayState* play, Player* this, void* anim); +void Player_CsAnim_PlayLoopAdjustedOnceFinished(PlayState* play, Player* this, void* anim); +void Player_CsAnim_PlayAnimSfx(PlayState* play, Player* this, void* entry); // AnimSfxEntry* entry +void Player_CsAnim_ReplacePlayOnceAdjustedReverse(PlayState* play, Player* this, void* anim); typedef struct struct_8085C2A4 { /* 0x0 */ PlayerAnimationHeader* unk_0; @@ -546,29 +548,29 @@ s32 func_8082DAFC(PlayState* play) { return CHECK_FLAG_ALL(player->actor.flags, ACTOR_FLAG_TALK_REQUESTED); } -void Player_AnimationPlayOnce(PlayState* play, Player* this, PlayerAnimationHeader* anim) { +void Player_Anim_PlayOnce(PlayState* play, Player* this, PlayerAnimationHeader* anim) { PlayerAnimation_PlayOnce(play, &this->skelAnime, anim); } -void Player_AnimationPlayLoop(PlayState* play, Player* this, PlayerAnimationHeader* anim) { +void Player_Anim_PlayLoop(PlayState* play, Player* this, PlayerAnimationHeader* anim) { PlayerAnimation_PlayLoop(play, &this->skelAnime, anim); } -void func_8082DB60(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_PlayLoopSetSpeed(play, &this->skelAnime, anim, 2.0f / 3.0f); +void Player_Anim_PlayLoopAdjusted(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_PlayLoopSetSpeed(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED); } -void func_8082DB90(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, 2.0f / 3.0f); +void Player_Anim_PlayOnceAdjusted(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED); } -void Player_AnimationPlayOnceReverse(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_Change(play, &this->skelAnime, anim, -2.0f / 3.0f, Animation_GetLastFrame(anim), 0.0f, - ANIMMODE_ONCE, 0.0f); +void Player_Anim_PlayOnceAdjustedReverse(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_Change(play, &this->skelAnime, anim, -PLAYER_ANIM_ADJUSTED_SPEED, Animation_GetLastFrame(anim), + 0.0f, ANIMMODE_ONCE, 0.0f); } -void func_8082DC28(Player* this) { - this->skelAnime.jointTable[PLAYER_LIMB_WAIST - 1].y = 0; +void Player_Anim_ResetModelRotY(Player* this) { + this->skelAnime.jointTable[LIMB_ROOT_ROT].y = 0; } void func_8082DC38(Player* this) { @@ -1752,7 +1754,7 @@ ColliderQuadInit D_8085C394 = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -f32 D_8085C3E4 = 1.0f; +f32 sPlayerWaterSpeedScale = 1.0f; f32 D_8085C3E8 = 1.0f; // ANIMSFX_TYPE_VOICE @@ -1874,81 +1876,83 @@ void Player_PlayAnimSfx(Player* this, AnimSfxEntry* entry) { } while (cond); } -void func_8082E438(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_Change(play, &this->skelAnime, anim, 3.0f / 3.0f, 0.0f, Animation_GetLastFrame(anim), ANIMMODE_ONCE, - -6.0f); +void Player_Anim_PlayOnceMorph(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_NORMAL_SPEED, 0.0f, Animation_GetLastFrame(anim), + ANIMMODE_ONCE, -6.0f); } -void func_8082E4A4(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_Change(play, &this->skelAnime, anim, 2.0f / 3.0f, 0.0f, Animation_GetLastFrame(anim), ANIMMODE_ONCE, - -6.0f); +void Player_Anim_PlayOnceMorphAdjusted(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, Animation_GetLastFrame(anim), + ANIMMODE_ONCE, -6.0f); } -void func_8082E514(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_Change(play, &this->skelAnime, anim, 3.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f); +void Player_Anim_PlayLoopMorph(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_NORMAL_SPEED, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f); } -void func_8082E55C(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_Change(play, &this->skelAnime, anim, 2.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f); +void Player_Anim_PlayLoopMorphAdjusted(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f); } -void func_8082E5A8(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_Change(play, &this->skelAnime, anim, 3.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); +void Player_Anim_PlayOnceFreeze(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_NORMAL_SPEED, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); } -void func_8082E5EC(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_Change(play, &this->skelAnime, anim, 2.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); +void Player_Anim_PlayOnceFreezeAdjusted(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); } -void func_8082E634(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_Change(play, &this->skelAnime, anim, 3.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -16.0f); +void Player_Anim_PlayLoopSlowMorph(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_NORMAL_SPEED, 0.0f, 0.0f, ANIMMODE_LOOP, -16.0f); } -// Player_AnimationPlayLoopIfCurrentFinished -s32 func_8082E67C(PlayState* play, Player* this, PlayerAnimationHeader* anim) { +s32 Player_Anim_PlayLoopOnceFinished(PlayState* play, Player* this, PlayerAnimationHeader* anim) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - Player_AnimationPlayLoop(play, this, anim); + Player_Anim_PlayLoop(play, this, anim); return true; } else { return false; } } -void func_8082E6D0(Player* this) { +void Player_Anim_ResetPrevTranslRot(Player* this) { this->skelAnime.prevTransl = this->skelAnime.baseTransl; - this->skelAnime.prevRot = this->actor.shape.rot.y; + this->skelAnime.prevYaw = this->actor.shape.rot.y; } -void func_8082E6F8(Player* this) { - func_8082E6D0(this); +void Player_Anim_ResetPrevTranslRotFormScale(Player* this) { + Player_Anim_ResetPrevTranslRot(this); this->skelAnime.prevTransl.x *= this->ageProperties->unk_08; this->skelAnime.prevTransl.y *= this->ageProperties->unk_08; this->skelAnime.prevTransl.z *= this->ageProperties->unk_08; } -void func_8082E784(Player* this) { - this->skelAnime.jointTable[PLAYER_LIMB_WAIST - 1].y = 0; +void Player_Anim_ZeroModelYaw(Player* this) { + this->skelAnime.jointTable[LIMB_ROOT_ROT].y = 0; } -void func_8082E794(Player* this) { +void Player_Anim_ResetMove(Player* this) { if (this->skelAnime.moveFlags) { - func_8082DC28(this); - this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].x = this->skelAnime.baseTransl.x; - this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].z = this->skelAnime.baseTransl.z; + Player_Anim_ResetModelRotY(this); + this->skelAnime.jointTable[LIMB_ROOT_POS].x = this->skelAnime.baseTransl.x; + this->skelAnime.jointTable[LIMB_ROOT_POS].z = this->skelAnime.baseTransl.z; if (this->skelAnime.moveFlags & ANIM_FLAG_8) { if (this->skelAnime.moveFlags & ANIM_FLAG_UPDATE_Y) { - this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].y = this->skelAnime.prevTransl.y; + this->skelAnime.jointTable[LIMB_ROOT_POS].y = this->skelAnime.prevTransl.y; } } else { - this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].y = this->skelAnime.baseTransl.y; + this->skelAnime.jointTable[LIMB_ROOT_POS].y = this->skelAnime.baseTransl.y; } - func_8082E6D0(this); + Player_Anim_ResetPrevTranslRot(this); this->skelAnime.moveFlags = 0; } } -void func_8082E820(Player* this, s32 moveFlags) { +/** + * Only used for ledge climbing + */ +void Player_AnimReplace_SetupLedgeClimb(Player* this, s32 moveFlags) { Vec3f pos; this->skelAnime.moveFlags = moveFlags; @@ -1969,17 +1973,17 @@ void func_8082E820(Player* this, s32 moveFlags) { this->actor.world.pos.y += pos.y * this->actor.scale.y; } - func_8082DC28(this); + Player_Anim_ResetModelRotY(this); } -void func_8082E920(PlayState* play, Player* this, s32 moveFlags) { +void Player_AnimReplace_Setup(PlayState* play, Player* this, s32 moveFlags) { if (moveFlags & ANIM_FLAG_200) { - func_8082E6F8(this); + Player_Anim_ResetPrevTranslRotFormScale(this); } else if ((moveFlags & ANIM_FLAG_100) || this->skelAnime.moveFlags) { - func_8082E6D0(this); + Player_Anim_ResetPrevTranslRot(this); } else { - this->skelAnime.prevTransl = this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1]; - this->skelAnime.prevRot = this->actor.shape.rot.y; + this->skelAnime.prevTransl = this->skelAnime.jointTable[LIMB_ROOT_POS]; + this->skelAnime.prevYaw = this->actor.shape.rot.y; } this->skelAnime.moveFlags = moveFlags; @@ -1987,38 +1991,40 @@ void func_8082E920(PlayState* play, Player* this, s32 moveFlags) { AnimationContext_DisableQueue(play); } -void func_8082E9C8(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags, f32 playSpeed) { +void Player_AnimReplace_PlayOnceSetSpeed(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags, + f32 playSpeed) { PlayerAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, playSpeed); - func_8082E920(play, this, moveFlags); + Player_AnimReplace_Setup(play, this, moveFlags); } -void func_8082EA10(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags) { - func_8082E9C8(play, this, anim, moveFlags, 3.0f / 3.0f); +void Player_AnimReplace_PlayOnce(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags) { + Player_AnimReplace_PlayOnceSetSpeed(play, this, anim, moveFlags, PLAYER_ANIM_NORMAL_SPEED); } -void func_8082EA38(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags) { - func_8082E9C8(play, this, anim, moveFlags, 2.0f / 3.0f); +void Player_AnimReplace_PlayOnceAdjusted(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags) { + Player_AnimReplace_PlayOnceSetSpeed(play, this, anim, moveFlags, PLAYER_ANIM_ADJUSTED_SPEED); } -void func_8082EA60(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - func_8082EA38(play, this, anim, ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_200); +void Player_AnimReplace_PlayOnceNormalAdjusted(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + Player_AnimReplace_PlayOnceAdjusted(play, this, anim, ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_200); } -void func_8082EA80(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags, f32 playSpeed) { +void Player_AnimReplace_PlayLoopSetSpeed(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags, + f32 playSpeed) { PlayerAnimation_PlayLoopSetSpeed(play, &this->skelAnime, anim, playSpeed); - func_8082E920(play, this, moveFlags); + Player_AnimReplace_Setup(play, this, moveFlags); } -void func_8082EAC8(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags) { - func_8082EA80(play, this, anim, moveFlags, 3.0f / 3.0f); +void Player_AnimReplace_PlayLoop(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags) { + Player_AnimReplace_PlayLoopSetSpeed(play, this, anim, moveFlags, PLAYER_ANIM_NORMAL_SPEED); } -void func_8082EAF0(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags) { - func_8082EA80(play, this, anim, moveFlags, 2.0f / 3.0f); +void Player_AnimReplace_PlayLoopAdjusted(PlayState* play, Player* this, PlayerAnimationHeader* anim, s32 moveFlags) { + Player_AnimReplace_PlayLoopSetSpeed(play, this, anim, moveFlags, PLAYER_ANIM_ADJUSTED_SPEED); } -void func_8082EB18(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - func_8082EAF0(play, this, anim, ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE); +void Player_AnimReplace_PlayLoopNormalAdjusted(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + Player_AnimReplace_PlayLoopAdjusted(play, this, anim, ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE); } void Player_ProcessControlStick(PlayState* play, Player* this) { @@ -2050,8 +2056,8 @@ void Player_ProcessControlStick(PlayState* play, Player* this) { this->unk_AE3[this->unk_ADE] = var_v0; } -void func_8082EC9C(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - PlayerAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, D_8085C3E4); +void Player_Anim_PlayOnceWaterAdjustment(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + PlayerAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, sPlayerWaterSpeedScale); } s32 func_8082ECCC(Player* this) { @@ -4009,8 +4015,8 @@ s32 func_80830B88(PlayState* play, Player* this) { PlayerAnimationHeader* anim = func_80830A58(play, this); f32 endFrame = Animation_GetLastFrame(anim); - PlayerAnimation_Change(play, &this->skelAnimeUpper, anim, 3.0f / 3.0f, endFrame, endFrame, - ANIMMODE_ONCE, 0.0f); + PlayerAnimation_Change(play, &this->skelAnimeUpper, anim, PLAYER_ANIM_NORMAL_SPEED, endFrame, + endFrame, ANIMMODE_ONCE, 0.0f); func_80830AE8(this); return true; } @@ -4081,9 +4087,9 @@ s32 func_80830E30(Player* this, PlayState* play) { } if (this->stateFlags1 & PLAYER_STATE1_800000) { - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_uma_anim_walk); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_uma_anim_walk); } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->transformation != PLAYER_FORM_ZORA)) { - Player_AnimationPlayLoop(play, this, func_8082ED20(this)); + Player_Anim_PlayLoop(play, this, func_8082ED20(this)); } return true; @@ -4256,7 +4262,7 @@ s32 Player_SetAction(PlayState* play, Player* this, PlayerActionFunc actionFunc, } func_80831454(this); - func_8082E794(this); + Player_Anim_ResetMove(this); this->stateFlags1 &= ~(PLAYER_STATE1_40 | PLAYER_STATE1_4000000 | PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000 | PLAYER_STATE1_80000000); @@ -4481,7 +4487,7 @@ void func_80831F34(PlayState* play, Player* this, PlayerAnimationHeader* anim) { func_8082DE50(play, this); Player_SetAction(play, this, sp24 ? Player_Action_62 : Player_Action_24, 0); - Player_AnimationPlayOnce(play, this, anim); + Player_Anim_PlayOnce(play, this, anim); if (anim == &gPlayerAnim_link_derth_rebirth) { this->skelAnime.endFrame = 84.0f; @@ -4531,8 +4537,9 @@ bool Player_UpdateUpperBody(Player* this, PlayState* play) { if (!(this->stateFlags1 & PLAYER_STATE1_800000) && (this->actor.parent != NULL) && Player_IsHoldingHookshot(this)) { Player_SetAction(play, this, Player_Action_92, 1); this->stateFlags3 |= PLAYER_STATE3_80; - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_hook_fly_start); - func_8082E920(play, this, (ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80)); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_hook_fly_start); + Player_AnimReplace_Setup(play, this, + (ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80)); func_8082DAD4(this); this->currentYaw = this->actor.shape.rot.y; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; @@ -5233,8 +5240,8 @@ void func_808334D4(PlayState* play, Player* this) { } func_8082DC38(this); - PlayerAnimation_Change(play, &this->skelAnime, anim, 1.0f, 8.0f, Animation_GetLastFrame(anim), ANIMMODE_ONCE, - -9.0f); + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_NORMAL_SPEED, 8.0f, Animation_GetLastFrame(anim), + ANIMMODE_ONCE, -9.0f); func_808332A0(play, this, 2 << 8, false); } @@ -5369,11 +5376,11 @@ void func_80833864(PlayState* play, Player* this, PlayerMeleeWeaponAnimation mel } this->meleeWeaponAnimation = meleeWeaponAnim; - func_8082DB90(play, this, sMeleeAttackAnimInfo[meleeWeaponAnim].unk_0); + Player_Anim_PlayOnceAdjusted(play, this, sMeleeAttackAnimInfo[meleeWeaponAnim].unk_0); this->unk_ADC = this->skelAnime.animLength + 4.0f; if ((meleeWeaponAnim < PLAYER_MWA_FLIPSLASH_START) || (meleeWeaponAnim > PLAYER_MWA_ZORA_JUMPKICK_START)) { - func_8082E920(play, this, (ANIM_FLAG_1 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE)); + Player_AnimReplace_Setup(play, this, (ANIM_FLAG_1 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE)); } this->currentYaw = this->actor.shape.rot.y; } @@ -5412,13 +5419,13 @@ s32 func_808339D4(PlayState* play, Player* this, s32 damage) { } void func_80833A64(Player* this) { - this->skelAnime.prevTransl = this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1]; - func_8082E820(this, 1 | ANIM_FLAG_UPDATE_Y); + this->skelAnime.prevTransl = this->skelAnime.jointTable[LIMB_ROOT_POS]; + Player_AnimReplace_SetupLedgeClimb(this, ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y); } void func_80833AA0(Player* this, PlayState* play) { if (Player_SetAction(play, this, Player_Action_25, 0)) { - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_normal_landing_wait); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_normal_landing_wait); this->av2.actionVar2 = 1; } if (this->unk_AA5 != PLAYER_UNKAA5_4) { @@ -5479,7 +5486,7 @@ void func_80833B18(PlayState* play, Player* this, s32 arg2, f32 speed, f32 veloc Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_FREEZE); } else if (arg2 == 4) { Player_SetAction(play, this, Player_Action_83, 0); - func_8082DB60(play, this, &gPlayerAnim_link_normal_electric_shock); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_link_normal_electric_shock); func_8082DAD4(this); this->av2.actionVar2 = 20; @@ -5520,7 +5527,7 @@ void func_80833B18(PlayState* play, Player* this, s32 arg2, f32 speed, f32 veloc this->linearVelocity = 3.0f; this->actor.velocity.y = 6.0f; - func_8082E5A8(play, this, D_8085BE84[PLAYER_ANIMGROUP_3][this->modelAnimType]); + Player_Anim_PlayOnceFreeze(play, this, D_8085BE84[PLAYER_ANIMGROUP_3][this->modelAnimType]); Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_DAMAGE_S); } else { this->actor.speed = speed; @@ -5583,7 +5590,7 @@ void func_80833B18(PlayState* play, Player* this, s32 arg2, f32 speed, f32 veloc this->stateFlags1 |= PLAYER_STATE1_4000000; if (anim != NULL) { - func_8082DB90(play, this, anim); + Player_Anim_PlayOnceAdjusted(play, this, anim); } } @@ -5612,7 +5619,8 @@ void func_80834140(PlayState* play, Player* this, PlayerAnimationHeader* anim) { this->av2.actionVar2 = -30; } this->stateFlags1 |= PLAYER_STATE1_80; - PlayerAnimation_Change(play, &this->skelAnime, anim, 1.0f, 0.0f, 84.0f, ANIMMODE_ONCE, -6.0f); + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_NORMAL_SPEED, 0.0f, 84.0f, ANIMMODE_ONCE, + -6.0f); this->av1.actionVar1 = 1; this->linearVelocity = 0.0f; } @@ -5780,7 +5788,7 @@ s32 func_80834600(Player* this, PlayState* play) { : D_8085CFCC[Player_IsHoldingTwoHandedWeapon(this)]; PlayerAnimation_PlayOnce(play, &this->skelAnimeUpper, var_a2); } else { - Player_AnimationPlayOnce(play, this, D_8085CFDC[Player_IsHoldingTwoHandedWeapon(this)]); + Player_Anim_PlayOnce(play, this, D_8085CFDC[Player_IsHoldingTwoHandedWeapon(this)]); } } @@ -5867,7 +5875,7 @@ s32 func_80834600(Player* this, PlayState* play) { } void func_80834CD0(Player* this, f32 arg1, u16 sfxId) { - this->actor.velocity.y = arg1 * D_8085C3E4; + this->actor.velocity.y = arg1 * sPlayerWaterSpeedScale; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; if (sfxId != NA_SE_NONE) { @@ -5882,7 +5890,7 @@ void func_80834CD0(Player* this, f32 arg1, u16 sfxId) { void func_80834D50(PlayState* play, Player* this, PlayerAnimationHeader* anim, f32 speed, u16 sfxId) { Player_SetAction(play, this, Player_Action_25, 1); if (anim != NULL) { - func_8082DB90(play, this, anim); + Player_Anim_PlayOnceAdjusted(play, this, anim); } func_80834CD0(this, speed, sfxId); } @@ -6008,18 +6016,18 @@ void func_80835324(PlayState* play, Player* this, f32 arg2, s16 arg3) { this->unk_3A0.x = Math_SinS(arg3) * arg2 + this->actor.world.pos.x; this->unk_3A0.z = Math_CosS(arg3) * arg2 + this->actor.world.pos.z; - Player_AnimationPlayOnce(play, this, func_8082ED20(this)); + Player_Anim_PlayOnce(play, this, func_8082ED20(this)); } void func_808353DC(PlayState* play, Player* this) { Player_SetAction(play, this, Player_Action_54, 0); - func_8082E634(play, this, &gPlayerAnim_link_swimer_swim_wait); + Player_Anim_PlayLoopSlowMorph(play, this, &gPlayerAnim_link_swimer_swim_wait); } s32 func_80835428(PlayState* play, Player* this) { if (!func_8082DA90(play) && (this->stateFlags1 & PLAYER_STATE1_80000000)) { func_80834104(play, this); - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_normal_landing_wait); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_normal_landing_wait); Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_FALL_S); Audio_PlaySfx_2(NA_SE_OC_SECRET_WARP_IN); return true; @@ -6083,7 +6091,7 @@ void func_808354A4(PlayState* play, s32 exitIndex, s32 arg2) { void func_808355D8(PlayState* play, Player* this, PlayerAnimationHeader* anim) { func_80833AA0(this, play); this->av2.actionVar2 = -2; - func_8082E5EC(play, this, anim); + Player_Anim_PlayOnceFreezeAdjusted(play, this, anim); func_8082E1F0(this, NA_SE_IT_DEKUNUTS_FLOWER_CLOSE); } @@ -6320,7 +6328,7 @@ void Player_Door_Staircase(PlayState* play, Player* this, Actor* door) { if (this->doorTimer != 0) { this->av2.actionVar2 = 0; - func_8082E438(play, this, func_8082ED20(this)); + Player_Anim_PlayOnceMorph(play, this, func_8082ED20(this)); this->skelAnime.endFrame = 0.0f; } else { this->linearVelocity = 0.1f; @@ -6367,7 +6375,7 @@ void Player_Door_Sliding(PlayState* play, Player* this, Actor* door) { if (this->doorTimer != 0) { this->av2.actionVar2 = 0; - func_8082E438(play, this, func_8082ED20(this)); + Player_Anim_PlayOnceMorph(play, this, func_8082ED20(this)); this->skelAnime.endFrame = 0.0f; } else { this->linearVelocity = 0.1f; @@ -6440,15 +6448,15 @@ void Player_Door_Knob(PlayState* play, Player* this, Actor* door) { this->currentYaw = this->actor.shape.rot.y; temp_fv0 = this->doorDirection * 22.0f; func_80835BF8(&knobDoor->dyna.actor.world.pos, knobDoor->dyna.actor.shape.rot.y, temp_fv0, &this->actor.world.pos); - func_8082EC9C(play, this, anim); + Player_Anim_PlayOnceWaterAdjustment(play, this, anim); if (this->doorTimer != 0) { this->skelAnime.endFrame = 0.0f; } func_8082DAD4(this); - func_8082E920(play, this, - ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_80 | ANIM_FLAG_200); + Player_AnimReplace_Setup( + play, this, ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_80 | ANIM_FLAG_200); knobDoor->playOpenAnim = true; if (this->doorType != PLAYER_DOORTYPE_FAKE) { CollisionPoly* poly; @@ -6555,13 +6563,13 @@ void func_80836888(Player* this, PlayState* play) { } this->unk_B44 = this->unk_B40; - Player_AnimationPlayLoop(play, this, anim); + Player_Anim_PlayLoop(play, this, anim); this->currentYaw = this->actor.shape.rot.y; } void func_8083692C(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_3, 1); - func_8082E438(play, this, func_8082ED20(this)); + Player_Anim_PlayOnceMorph(play, this, func_8082ED20(this)); this->currentYaw = this->actor.shape.rot.y; } @@ -6597,7 +6605,7 @@ void func_80836A5C(Player* this, PlayState* play) { void func_80836A98(Player* this, PlayerAnimationHeader* anim, PlayState* play) { func_80836A5C(this, play); - func_8082EC9C(play, this, anim); + Player_Anim_PlayOnceWaterAdjustment(play, this, anim); } void func_80836AD8(PlayState* play, Player* this) { @@ -6619,13 +6627,13 @@ void func_80836B3C(PlayState* play, Player* this, f32 arg2) { if (this->transformation == PLAYER_FORM_GORON) { func_80836AD8(play, this); PlayerAnimation_Change(play, &this->skelAnime, D_8085BE84[PLAYER_ANIMGROUP_15][this->modelAnimType], - 1.5f * D_8085C3E4, 0.0f, 6.0f, ANIMMODE_ONCE, 0.0f); + 1.5f * sPlayerWaterSpeedScale, 0.0f, 6.0f, ANIMMODE_ONCE, 0.0f); } else { PlayerAnimationHeader* anim = D_8085BE84[PLAYER_ANIMGROUP_15][this->modelAnimType]; Player_SetAction(play, this, Player_Action_26, 0); - PlayerAnimation_Change(play, &this->skelAnime, anim, 1.25f * D_8085C3E4, arg2, Animation_GetLastFrame(anim), - ANIMMODE_ONCE, 0.0f); + PlayerAnimation_Change(play, &this->skelAnime, anim, 1.25f * sPlayerWaterSpeedScale, arg2, + Animation_GetLastFrame(anim), ANIMMODE_ONCE, 0.0f); } } @@ -6662,7 +6670,7 @@ s32 func_80836DC0(PlayState* play, Player* this) { if ((MREG(48) != 0) || func_800C9DDC(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId)) { Player_SetAction(play, this, Player_Action_93, 0); this->stateFlags1 &= ~(PLAYER_STATE1_20000 | PLAYER_STATE1_40000000); - func_8082E438(play, this, &gPlayerAnim_pn_attack); + Player_Anim_PlayOnceMorph(play, this, &gPlayerAnim_pn_attack); Player_StopHorizontalMovement(this); func_80836D8C(this); this->actor.shape.shadowDraw = ActorShadow_DrawCircle; @@ -6818,7 +6826,7 @@ void func_80837134(PlayState* play, Player* this) { } void func_808373A4(PlayState* play, Player* this) { - func_8082E438(play, this, &gPlayerAnim_pn_attack); + Player_Anim_PlayOnceMorph(play, this, &gPlayerAnim_pn_attack); this->unk_B10[0] = 20000.0f; this->unk_B10[1] = 0x30000; Player_PlaySfx(this, NA_SE_PL_DEKUNUTS_ATTACK); @@ -6976,7 +6984,7 @@ void func_808379C0(PlayState* play, Player* this) { anim = D_8085BE84[PLAYER_ANIMGROUP_12][this->modelAnimType]; } - Player_AnimationPlayOnce(play, this, anim); + Player_Anim_PlayOnce(play, this, anim); } else { func_80836988(this, play); this->stateFlags1 &= ~PLAYER_STATE1_800; @@ -7032,7 +7040,7 @@ void func_80837CEC(PlayState* play, Player* this, CollisionPoly* arg2, f32 arg3, Player_SetAction(play, this, Player_Action_48, 0); func_8082DE50(play, this); - Player_AnimationPlayOnce(play, this, anim); + Player_Anim_PlayOnce(play, this, anim); this->actor.world.pos.x -= (arg3 + 1.0f) * nx; this->actor.world.pos.z -= (arg3 + 1.0f) * nz; @@ -7041,7 +7049,7 @@ void func_80837CEC(PlayState* play, Player* this, CollisionPoly* arg2, f32 arg3, func_8082DAD4(this); this->actor.velocity.y = 0.0f; - func_8082E6D0(this); + Player_Anim_ResetPrevTranslRot(this); } s32 func_80837DEC(Player* this, PlayState* play) { @@ -7113,9 +7121,9 @@ s32 func_80837DEC(Player* this, PlayState* play) { this->actor.shape.rot.y = this->currentYaw += 0x8000; this->stateFlags1 |= PLAYER_STATE1_200000; - func_8082E920(play, this, - ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | - ANIM_FLAG_NOMOVE | ANIM_FLAG_80); + Player_AnimReplace_Setup(play, this, + ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | + ANIM_FLAG_NOMOVE | ANIM_FLAG_80); this->av2.actionVar2 = -1; this->av1.actionVar1 = var_v1_2; } else { @@ -7241,7 +7249,7 @@ void func_8083827C(Player* this, PlayState* play) { // Checking if the ledge is tall enough for Player to hang from if ((sPlayerPrevFloorProperty == FLOOR_PROPERTY_9) || (sPlayerYDistToFloor <= this->ageProperties->unk_34) || !func_80837DEC(this, play)) { - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_normal_landing_wait); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_normal_landing_wait); } } else { this->fallStartHeight = this->actor.world.pos.y; @@ -7326,7 +7334,7 @@ PlayerAnimationHeader* D_8085D160[PLAYER_FORM_MAX] = { void func_808388B8(PlayState* play, Player* this, PlayerTransformation playerForm) { func_8082DE50(play, this); Player_SetAction_PreserveItemAction(play, this, Player_Action_86, 0); - func_8082E4A4(play, this, D_8085D160[this->transformation]); + Player_Anim_PlayOnceMorphAdjusted(play, this, D_8085D160[this->transformation]); gSaveContext.save.playerForm = playerForm; this->stateFlags1 |= PLAYER_STATE1_2; @@ -7337,14 +7345,14 @@ void func_808388B8(PlayState* play, Player* this, PlayerTransformation playerFor void func_808389BC(PlayState* play, Player* this) { Player_SetAction_PreserveItemAction(play, this, Player_Action_89, 0); - func_8082E4A4(play, this, &gPlayerAnim_cl_setmask); + Player_Anim_PlayOnceMorphAdjusted(play, this, &gPlayerAnim_cl_setmask); this->stateFlags1 |= (PLAYER_STATE1_100 | PLAYER_STATE1_20000000); func_8082DAD4(this); } void func_80838A20(PlayState* play, Player* this) { Player_SetAction_PreserveItemAction(play, this, Player_Action_90, 0); - func_8082DB90(play, this, &gPlayerAnim_cl_maskoff); + Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_cl_maskoff); this->currentMask = PLAYER_MASK_NONE; this->stateFlags1 |= (PLAYER_STATE1_100 | PLAYER_STATE1_20000000); func_8082DAD4(this); @@ -7538,10 +7546,10 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { this->currentYaw = talkActor->yawTowardsPlayer + 0x8000; this->actor.shape.rot.y = this->currentYaw; if (talkActor->xzDistToPlayer < 40.0f) { - func_8082DB90(play, this, &gPlayerAnim_link_normal_backspace); - func_8082E920(play, this, ANIM_FLAG_1 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE); + Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_link_normal_backspace); + Player_AnimReplace_Setup(play, this, ANIM_FLAG_1 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE); } else { - func_8082E438(play, this, D_8085BE84[31][this->modelAnimType]); + Player_Anim_PlayOnceMorph(play, this, D_8085BE84[31][this->modelAnimType]); } this->stateFlags1 |= PLAYER_STATE1_20000000; this->av2.actionVar2 = 80; @@ -7563,7 +7571,7 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_TALK_REQUESTED; this->exchangeItemAction = this->itemAction; if (this->av1.actionVar1 >= 0) { - Player_AnimationPlayOnce(play, this, D_8085D1F8[this->av1.actionVar1]); + Player_Anim_PlayOnce(play, this, D_8085D1F8[this->av1.actionVar1]); } func_8082DAD4(this); return true; @@ -7574,17 +7582,17 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { Player_StopCutscene(this); if (bottleAction >= PLAYER_BOTTLE_FAIRY) { Player_SetAction_PreserveItemAction(play, this, Player_Action_69, 0); - func_8082DB90(play, this, &gPlayerAnim_link_bottle_bug_out); + Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_link_bottle_bug_out); } else if ((bottleAction > PLAYER_BOTTLE_EMPTY) && (bottleAction < PLAYER_BOTTLE_POE)) { Player_SetAction_PreserveItemAction(play, this, Player_Action_70, 0); - func_8082DB90(play, this, &gPlayerAnim_link_bottle_fish_out); + Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_link_bottle_fish_out); this->csId = play->playerCsIds[PLAYER_CS_ID_ITEM_BOTTLE]; } else { Player_SetAction_PreserveItemAction(play, this, Player_Action_67, 0); - func_8082E4A4(play, this, - (this->transformation == PLAYER_FORM_DEKU) - ? &gPlayerAnim_pn_drinkstart - : &gPlayerAnim_link_bottle_drink_demo_start); + Player_Anim_PlayOnceMorphAdjusted(play, this, + (this->transformation == PLAYER_FORM_DEKU) + ? &gPlayerAnim_pn_drinkstart + : &gPlayerAnim_link_bottle_drink_demo_start); } } else { Actor* actorUnkA90 = this->unk_A90; @@ -7601,7 +7609,7 @@ s32 Player_ActionChange_13(Player* this, PlayState* play) { if ((this->skelAnime.playSpeed < 0.0f) || ((this->skelAnime.animation != D_8085D17C[this->transformation]) && (this->skelAnime.animation != D_8085D190[this->transformation]))) { - func_8082DB90(play, this, D_8085D17C[this->transformation]); + Player_Anim_PlayOnceAdjusted(play, this, D_8085D17C[this->transformation]); } this->stateFlags2 |= PLAYER_STATE2_8000000; if (actorUnkA90 != NULL) { @@ -7825,8 +7833,8 @@ void func_80839978(PlayState* play, Player* this) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->itemAction = PLAYER_IA_OCARINA; Player_SetAction_PreserveItemAction(play, this, Player_Action_11, 0); - func_8082DB60(play, this, &gPlayerAnim_clink_normal_okarina_walk); - func_8082E920(play, this, ANIM_FLAG_4 | ANIM_FLAG_200); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_clink_normal_okarina_walk); + Player_AnimReplace_Setup(play, this, ANIM_FLAG_4 | ANIM_FLAG_200); this->stateFlags3 |= PLAYER_STATE3_20000000; this->unk_B48 = this->linearVelocity; Audio_PlayFanfare(NA_BGM_BREMEN_MARCH); @@ -7837,7 +7845,7 @@ void func_80839A10(PlayState* play, Player* this) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->itemAction = PLAYER_IA_NONE; Player_SetAction_PreserveItemAction(play, this, Player_Action_12, 0); - func_8082DB60(play, this, &gPlayerAnim_alink_dance_loop); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_alink_dance_loop); this->stateFlags2 |= PLAYER_STATE2_2000000; Audio_PlayFanfare(NA_BGM_KAMARO_DANCE); } @@ -7916,8 +7924,8 @@ void func_80839CD8(Player* this, PlayState* play) { var_fv0 = var_fv0 / 12.0f; } - PlayerAnimation_Change(play, &this->skelAnime, anim, 1.0f, 0.0f, Animation_GetLastFrame(anim), ANIMMODE_ONCE, - 4.0f * var_fv0); + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_NORMAL_SPEED, 0.0f, Animation_GetLastFrame(anim), + ANIMMODE_ONCE, 4.0f * var_fv0); this->currentYaw = this->actor.shape.rot.y; } @@ -7928,7 +7936,7 @@ void func_80839E3C(Player* this, PlayState* play) { void func_80839E74(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_4, 1); - Player_AnimationPlayOnce(play, this, func_8082ED20(this)); + Player_Anim_PlayOnce(play, this, func_8082ED20(this)); this->currentYaw = this->actor.shape.rot.y; } @@ -7956,8 +7964,8 @@ s32 func_80839F98(PlayState* play, Player* this) { return true; } func_80836AD8(play, this); - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pg_maru_change, 2.0f / 3.0f, 0.0f, 7.0f, - ANIMMODE_ONCE, 0.0f); + PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pg_maru_change, PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, + 7.0f, ANIMMODE_ONCE, 0.0f); return true; } return false; @@ -8047,7 +8055,7 @@ s32 Player_ActionChange_11(Player* this, PlayState* play) { } endFrame = Animation_GetLastFrame(anim); - PlayerAnimation_Change(play, &this->skelAnime, anim, 2.0f / 3.0f, + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED, (anim == &gPlayerAnim_pn_gurd) ? 0.0f : endFrame, endFrame, ANIMMODE_ONCE, 0.0f); } @@ -8104,7 +8112,7 @@ s32 Player_ActionChange_8(Player* this, PlayState* play) { s32 func_8083A658(PlayState* play, Player* this) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Player_SetAction(play, this, Player_Action_64, 0); - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_normal_light_bom); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_normal_light_bom); this->unk_AA5 = PLAYER_UNKAA5_0; return true; } @@ -8123,7 +8131,7 @@ s32 func_8083A6C0(PlayState* play, Player* this) { if (this->actor.depthInWater > 12.0f) { this->av2.actionVar2 = 1; } - func_8082DB90(play, this, D_8085D200[this->av2.actionVar2].unk_0); + Player_Anim_PlayOnceAdjusted(play, this, D_8085D200[this->av2.actionVar2].unk_0); Player_PlaySfx(this, NA_SE_IT_SWORD_SWING); Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_AUTO_JUMP); return true; @@ -8138,7 +8146,7 @@ void func_8083A794(Player* this, PlayState* play) { this->unk_B70 = 0; this->unk_B34 = 0.0f; this->unk_B38 = 0.0f; - func_8082E514(play, this, D_8085BE84[PLAYER_ANIMGROUP_2][this->modelAnimType]); + Player_Anim_PlayLoopMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_2][this->modelAnimType]); } Player_SetAction(play, this, func_8082FBE8(this) ? Player_Action_14 : Player_Action_13, 1); @@ -8159,7 +8167,7 @@ s32 func_8083A878(PlayState* play, Player* this, f32 arg2) { ySurface -= this->actor.world.pos.y; if (this->ageProperties->unk_24 <= ySurface) { Player_SetAction(play, this, Player_Action_55, 0); - func_8082E634(play, this, &gPlayerAnim_link_swimer_swim); + Player_Anim_PlayLoopSlowMorph(play, this, &gPlayerAnim_link_swimer_swim); this->stateFlags1 |= (PLAYER_STATE1_8000000 | PLAYER_STATE1_20000000); this->av2.actionVar2 = 20; this->linearVelocity = 2.0f; @@ -8331,12 +8339,12 @@ void func_8083AECC(Player* this, s16 currentYaw, PlayState* play) { void func_8083AF30(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_5, 1); - func_8082E514(play, this, D_8085BE84[PLAYER_ANIMGROUP_1][this->modelAnimType]); + Player_Anim_PlayLoopMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_1][this->modelAnimType]); } void func_8083AF8C(Player* this, s16 currentYaw, PlayState* play) { Player_SetAction(play, this, Player_Action_15, 1); - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_anchor_back_walk, 1.0f, 0.0f, + PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_anchor_back_walk, PLAYER_ANIM_NORMAL_SPEED, 0.0f, Animation_GetLastFrame(&gPlayerAnim_link_anchor_back_walk), ANIMMODE_ONCE, -6.0f); this->linearVelocity = 8.0f; this->currentYaw = currentYaw; @@ -8344,7 +8352,7 @@ void func_8083AF8C(Player* this, s16 currentYaw, PlayState* play) { void func_8083B030(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_9, 1); - func_8082E514(play, this, D_8085BE84[PLAYER_ANIMGROUP_24][this->modelAnimType]); + Player_Anim_PlayLoopMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_24][this->modelAnimType]); this->unk_B38 = 0.0f; } @@ -8357,9 +8365,9 @@ void func_8083B0E4(PlayState* play, Player* this, s16 currentYaw) { this->currentYaw = currentYaw; Player_SetAction(play, this, Player_Action_10, 1); this->unk_B4E = 1200; - this->unk_B4E *= D_8085C3E4; - PlayerAnimation_Change(play, &this->skelAnime, D_8085BE84[PLAYER_ANIMGROUP_25][this->modelAnimType], 1.0f, 0.0f, - 0.0f, ANIMMODE_LOOP, -6.0f); + this->unk_B4E *= sPlayerWaterSpeedScale; + PlayerAnimation_Change(play, &this->skelAnime, D_8085BE84[PLAYER_ANIMGROUP_25][this->modelAnimType], + PLAYER_ANIM_NORMAL_SPEED, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f); } void func_8083B1A0(Player* this, PlayState* play) { @@ -8371,13 +8379,13 @@ void func_8083B1A0(Player* this, PlayState* play) { } else { anim = D_8085BE84[PLAYER_ANIMGROUP_26][this->modelAnimType]; } - Player_AnimationPlayOnce(play, this, anim); + Player_Anim_PlayOnce(play, this, anim); this->currentYaw = this->actor.shape.rot.y; } void func_8083B23C(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_2, 1); - func_8082E438(play, this, D_8085BE84[PLAYER_ANIMGROUP_6][this->modelAnimType]); + Player_Anim_PlayOnceMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_6][this->modelAnimType]); this->av2.actionVar2 = 1; } @@ -8421,7 +8429,7 @@ s32 func_8083B3B4(PlayState* play, Player* this, Input* input) { Player_SetAction(play, this, Player_Action_59, 0); } - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_swimer_swim_deep_start); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_swimer_swim_deep_start); this->unk_AAA = 0; this->stateFlags2 |= PLAYER_STATE2_400; this->actor.velocity.y = 0.0f; @@ -8474,9 +8482,9 @@ s32 func_8083B3B4(PlayState* play, Player* this, Input* input) { this->av2.actionVar2 = 2; } - func_8082E438(play, this, - (this->stateFlags1 & PLAYER_STATE1_800) ? &gPlayerAnim_link_swimer_swim_get - : &gPlayerAnim_link_swimer_swim_deep_end); + Player_Anim_PlayOnceMorph(play, this, + (this->stateFlags1 & PLAYER_STATE1_800) ? &gPlayerAnim_link_swimer_swim_get + : &gPlayerAnim_link_swimer_swim_deep_end); return true; } @@ -8485,7 +8493,7 @@ s32 func_8083B3B4(PlayState* play, Player* this, Input* input) { void func_8083B73C(PlayState* play, Player* this, s16 currentYaw) { Player_SetAction(play, this, Player_Action_57, 0); - func_8082E634(play, this, &gPlayerAnim_link_swimer_swim); + Player_Anim_PlayLoopSlowMorph(play, this, &gPlayerAnim_link_swimer_swim); this->actor.shape.rot.y = currentYaw; this->currentYaw = currentYaw; } @@ -8493,11 +8501,11 @@ void func_8083B73C(PlayState* play, Player* this, s16 currentYaw) { void func_8083B798(PlayState* play, Player* this) { if (this->transformation == PLAYER_FORM_ZORA) { Player_SetAction(play, this, Player_Action_57, 0); - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_swimer_swim, 1.0f, + PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_swimer_swim, PLAYER_ANIM_NORMAL_SPEED, Animation_GetLastFrame(&gPlayerAnim_link_swimer_swim), 0.0f, ANIMMODE_LOOP, 0.0f); this->unk_B48 = 2.0f; } else { - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_swimer_swim); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_swimer_swim); this->av2.actionVar2 = 1; } @@ -8536,7 +8544,7 @@ void func_8083B930(PlayState* play, Player* this) { } else if ((this->transformation == PLAYER_FORM_ZORA) && (Player_Action_27 == this->actionFunc)) { func_8083B850(play, this); this->stateFlags3 |= PLAYER_STATE3_8000; - func_8082DB60(play, this, &gPlayerAnim_pz_fishswim); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_pz_fishswim); } else if ((this->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER) && (this->stateFlags2 & PLAYER_STATE2_400)) { this->stateFlags2 &= ~PLAYER_STATE2_400; func_8083B3B4(play, this, NULL); @@ -8546,9 +8554,10 @@ void func_8083B930(PlayState* play, Player* this) { func_8083B798(play, this); } else { Player_SetAction(play, this, Player_Action_54, 1); - func_8082E438(play, this, - (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ? &gPlayerAnim_link_swimer_wait2swim_wait - : &gPlayerAnim_link_swimer_land2swim_wait); + Player_Anim_PlayOnceMorph(play, this, + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) + ? &gPlayerAnim_link_swimer_wait2swim_wait + : &gPlayerAnim_link_swimer_land2swim_wait); } } if (!(this->stateFlags1 & PLAYER_STATE1_8000000) || (this->actor.depthInWater < this->ageProperties->unk_2C)) { @@ -8975,9 +8984,9 @@ s32 Player_ActionChange_3(Player* this, PlayState* play) { this->currentYaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; Actor_MountHorse(play, this, &rideActor->actor); - Player_AnimationPlayOnce(play, this, entry->anim); - func_8082E920(play, this, - ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); + Player_Anim_PlayOnce(play, this, entry->anim); + Player_AnimReplace_Setup( + play, this, ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); this->actor.parent = this->rideActor; func_8082DAD4(this); Actor_DeactivateLens(play); @@ -9024,7 +9033,7 @@ s32 Player_HandleSlopes(PlayState* play, Player* this) { } else { Player_SetAction(play, this, Player_Action_73, 0); func_8082DE50(play, this); - func_8082E514(play, this, sPlayerSlopeSlipAnims[this->av1.actionVar1]); + Player_Anim_PlayLoopMorph(play, this, sPlayerSlopeSlipAnims[this->av1.actionVar1]); this->linearVelocity = sqrtf(SQXZ(this->actor.velocity)); this->currentYaw = downwardSlopeYaw; if (sPlayerFloorPitchShape >= 0) { @@ -9076,10 +9085,10 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { (this->currentBoots == PLAYER_BOOTS_ZORA_UNDERWATER)) { Player_StopCutscene(this); func_808324EC(play, this, func_80837C78, play->playerCsIds[PLAYER_CS_ID_ITEM_GET]); - func_8082DB90(play, this, - (this->transformation == PLAYER_FORM_DEKU) - ? &gPlayerAnim_pn_getB - : &gPlayerAnim_link_demo_get_itemB); + Player_Anim_PlayOnceAdjusted(play, this, + (this->transformation == PLAYER_FORM_DEKU) + ? &gPlayerAnim_pn_getB + : &gPlayerAnim_link_demo_get_itemB); } this->stateFlags1 |= (PLAYER_STATE1_400 | PLAYER_STATE1_800 | PLAYER_STATE1_20000000); @@ -9125,14 +9134,14 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { if ((giEntry->itemId != ITEM_NONE) && (giEntry->gid >= 0) && (Item_CheckObtainability(giEntry->itemId) == ITEM_NONE)) { this->csId = chest->csId2; - func_8082DB90(play, this, this->ageProperties->openChestAnim); - func_8082E920(play, this, - ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | - ANIM_FLAG_NOMOVE | ANIM_FLAG_80); + Player_Anim_PlayOnceAdjusted(play, this, this->ageProperties->openChestAnim); + Player_AnimReplace_Setup(play, this, + ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | + ANIM_FLAG_NOMOVE | ANIM_FLAG_80); this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER; chest->unk_1EC = 1; } else { - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_normal_box_kick); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_normal_box_kick); chest->unk_1EC = -1; } @@ -9171,7 +9180,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { // Player_SetAction_Throwing void func_8083D6DC(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_42, 1); - Player_AnimationPlayOnce(play, this, D_8085BE84[PLAYER_ANIMGROUP_28][this->modelAnimType]); + Player_Anim_PlayOnce(play, this, D_8085BE84[PLAYER_ANIMGROUP_28][this->modelAnimType]); } // Determines whether a held actor should be dropped or thrown: false implies droppable. @@ -9190,7 +9199,7 @@ s32 Player_ActionChange_9(Player* this, PlayState* play) { if (!func_808313A8(play, this, this->heldActor)) { if (!func_8083D738(this, this->heldActor)) { Player_SetAction(play, this, Player_Action_41, 1); - Player_AnimationPlayOnce(play, this, D_8085BE84[PLAYER_ANIMGROUP_29][this->modelAnimType]); + Player_Anim_PlayOnce(play, this, D_8085BE84[PLAYER_ANIMGROUP_29][this->modelAnimType]); return true; } func_8083D6DC(this, play); @@ -9305,10 +9314,10 @@ s32 func_8083D860(Player* this, PlayState* play) { this->actor.world.pos.z = (distToInteractWall * wallPolyNormalZ) + sp74; func_8082DAD4(this); Math_Vec3f_Copy(&this->actor.prevPos, &this->actor.world.pos); - Player_AnimationPlayOnce(play, this, anim); - func_8082E920(play, this, - ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | - ANIM_FLAG_80); + Player_Anim_PlayOnce(play, this, anim); + Player_AnimReplace_Setup(play, this, + ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | + ANIM_FLAG_NOMOVE | ANIM_FLAG_80); return true; } } @@ -9374,7 +9383,7 @@ void func_8083DF38(Player* this, PlayerAnimationHeader* anim, PlayState* play) { Player_SetAction(play, this, Player_Action_45, 0); } - Player_AnimationPlayOnce(play, this, anim); + Player_Anim_PlayOnce(play, this, anim); func_8082DAD4(this); this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; @@ -9429,20 +9438,20 @@ s32 func_8083E14C(PlayState* play, Player* this) { } func_808369F4(this, play); - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_normal_push_wait_end); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_normal_push_wait_end); this->stateFlags2 &= ~PLAYER_STATE2_10; return true; } void func_8083E234(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_46, 0); - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_normal_push_start); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_normal_push_start); this->stateFlags2 |= PLAYER_STATE2_10; } void func_8083E28C(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_47, 0); - Player_AnimationPlayOnce(play, this, D_8085BE84[PLAYER_ANIMGROUP_34][this->modelAnimType]); + Player_Anim_PlayOnce(play, this, D_8085BE84[PLAYER_ANIMGROUP_34][this->modelAnimType]); this->stateFlags2 |= PLAYER_STATE2_10; } @@ -9687,8 +9696,8 @@ void Player_ChooseIdleAnim(PlayState* play, Player* this) { morphFrames = -6.0f; } - PlayerAnimation_Change(play, &this->skelAnime, anim, (2.0f / 3.0f) * D_8085C3E4, 0.0f, endFrame, ANIMMODE_ONCE, - morphFrames); + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED * sPlayerWaterSpeedScale, 0.0f, + endFrame, ANIMMODE_ONCE, morphFrames); } void func_8083EE60(Player* this, PlayState* play) { @@ -9737,7 +9746,7 @@ void func_8083EE60(Player* this, PlayState* play) { void func_8083F144(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_7, 1); - func_8082E438(play, this, &gPlayerAnim_link_normal_back_brake); + Player_Anim_PlayOnceMorph(play, this, &gPlayerAnim_link_normal_back_brake); } s32 func_8083F190(Player* this, f32* arg1, s16* arg2, PlayState* play) { @@ -9759,7 +9768,7 @@ s32 func_8083F190(Player* this, f32* arg1, s16* arg2, PlayState* play) { void func_8083F230(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_8, 1); - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_normal_back_brake_end); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_normal_back_brake_end); } void func_8083F27C(PlayState* play, Player* this) { @@ -9979,7 +9988,7 @@ s32 func_8083FD80(Player* this, PlayState* play) { (this->transformation != PLAYER_FORM_ZORA) && sPlayerUseHeldItem) { //! Calling this function sets the meleeWeaponQuads' damage properties correctly, patching "Power Crouch Stab". func_8083375C(this, PLAYER_MWA_STAB_1H); - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_normal_defense_kiru); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_normal_defense_kiru); this->av1.actionVar1 = 1; this->meleeWeaponAnimation = PLAYER_MWA_STAB_1H; this->currentYaw = this->actor.shape.rot.y + this->upperLimbRot.y; @@ -10071,7 +10080,7 @@ void func_808400CC(PlayState* play, Player* this) { } else { var_v1 = 0; } - func_8082DB90(play, this, D_8085D294[Player_IsHoldingTwoHandedWeapon(this) + var_v1]); + Player_Anim_PlayOnceAdjusted(play, this, D_8085D294[Player_IsHoldingTwoHandedWeapon(this) + var_v1]); } } @@ -10217,13 +10226,13 @@ void func_80840770(PlayState* play, Player* this) { this->av2.actionVar2--; if (this->av2.actionVar2 == 0) { if (this->stateFlags1 & PLAYER_STATE1_8000000) { - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_swimer_swim_wait, 1.0f, 0.0f, - Animation_GetLastFrame(&gPlayerAnim_link_swimer_swim_wait), ANIMMODE_ONCE, - -16.0f); + PlayerAnimation_Change( + play, &this->skelAnime, &gPlayerAnim_link_swimer_swim_wait, PLAYER_ANIM_NORMAL_SPEED, 0.0f, + Animation_GetLastFrame(&gPlayerAnim_link_swimer_swim_wait), ANIMMODE_ONCE, -16.0f); } else { - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_derth_rebirth, 1.0f, 99.0f, - Animation_GetLastFrame(&gPlayerAnim_link_derth_rebirth), ANIMMODE_ONCE, - 0.0f); + PlayerAnimation_Change( + play, &this->skelAnime, &gPlayerAnim_link_derth_rebirth, PLAYER_ANIM_NORMAL_SPEED, 99.0f, + Animation_GetLastFrame(&gPlayerAnim_link_derth_rebirth), ANIMMODE_ONCE, 0.0f); } gSaveContext.healthAccumulator = 0xA0; this->av2.actionVar2 = -1; @@ -10310,12 +10319,12 @@ s32 func_80840A30(PlayState* play, Player* this, f32* arg2, f32 arg3) { if (!(this->stateFlags3 & PLAYER_STATE3_1000)) { if ((this->stateFlags3 & PLAYER_STATE3_8000) && (Player_Action_28 != this->actionFunc)) { Player_SetAction(play, this, Player_Action_61, 0); - func_8082DB90(play, this, &gPlayerAnim_link_swimer_swim_hit); + Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_link_swimer_swim_hit); func_8082DD2C(play, this); this->linearVelocity *= 0.2f; } else { Player_SetAction(play, this, Player_Action_26, 0); - Player_AnimationPlayOnce(play, this, D_8085BE84[PLAYER_ANIMGROUP_16][this->modelAnimType]); + Player_Anim_PlayOnce(play, this, D_8085BE84[PLAYER_ANIMGROUP_16][this->modelAnimType]); this->av2.actionVar2 = 1; } } @@ -10368,13 +10377,13 @@ void func_80840E24(Player* this, PlayState* play) { void func_80840E5C(Player* this, PlayState* play) { func_808369F4(this, play); func_8082DC38(this); - func_8082E438(play, this, D_8085CF68[Player_IsHoldingTwoHandedWeapon(this)]); + Player_Anim_PlayOnceMorph(play, this, D_8085CF68[Player_IsHoldingTwoHandedWeapon(this)]); this->currentYaw = this->actor.shape.rot.y; } void func_80840EC0(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_30, 1); - Player_AnimationPlayLoop(play, this, D_8085CF60[Player_IsHoldingTwoHandedWeapon(this)]); + Player_Anim_PlayLoop(play, this, D_8085CF60[Player_IsHoldingTwoHandedWeapon(this)]); this->av2.actionVar2 = 1; this->unk_B38 = 0.0f; } @@ -10451,8 +10460,8 @@ void Player_InitMode_0(PlayState* play, Player* this) { void Player_InitMode_2(PlayState* play, Player* this) { Player_SetAction(play, this, Player_Action_76, 0); this->stateFlags1 |= PLAYER_STATE1_20000000; - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_okarina_warp_goal, 2.0f / 3.0f, 0.0f, 24.0f, - ANIMMODE_ONCE, 0.0f); + PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_okarina_warp_goal, PLAYER_ANIM_ADJUSTED_SPEED, + 0.0f, 24.0f, ANIMMODE_ONCE, 0.0f); this->actor.world.pos.y += 800.0f; } @@ -10487,10 +10496,10 @@ void Player_InitMode_1(PlayState* play, Player* this) { this->stateFlags1 |= PLAYER_STATE1_20000000; Math_Vec3f_Copy(&this->actor.world.pos, &D_8085D2B4); this->currentYaw = this->actor.shape.rot.y = -0x8000; - PlayerAnimation_Change(play, &this->skelAnime, this->ageProperties->unk_A8, 2.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, - 0.0f); - func_8082E920(play, this, - ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_80 | ANIM_FLAG_200); + PlayerAnimation_Change(play, &this->skelAnime, this->ageProperties->unk_A8, 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); } @@ -10499,7 +10508,8 @@ void Player_InitMode_1(PlayState* play, Player* this) { void Player_InitMode_3(PlayState* play, Player* this) { Player_SetAction(play, this, Player_Action_78, 0); - func_8082E920(play, this, ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); + Player_AnimReplace_Setup(play, this, + ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); } void Player_InitMode_4(PlayState* play, Player* this) { @@ -10522,13 +10532,13 @@ void Player_InitMode_5(PlayState* play, Player* this) { void Player_InitMode_6(PlayState* play, Player* this) { if (gSaveContext.save.isOwlSave) { Player_SetAction(play, this, Player_Action_0, 0); - func_8082E514(play, this, D_8085BE84[PLAYER_ANIMGROUP_43][this->modelAnimType]); + Player_Anim_PlayLoopMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_43][this->modelAnimType]); this->stateFlags1 |= PLAYER_STATE1_20000000; this->av2.actionVar2 = 0x28; gSaveContext.save.isOwlSave = false; } else { Player_SetAction(play, this, Player_Action_4, 0); - func_8082E514(play, this, D_8085BE84[PLAYER_ANIMGROUP_43][this->modelAnimType]); + Player_Anim_PlayLoopMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_43][this->modelAnimType]); this->stateFlags1 |= PLAYER_STATE1_20000000; this->stateFlags2 |= PLAYER_STATE2_20000000; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_TEST7, this->actor.world.pos.x, this->actor.world.pos.y, @@ -10540,11 +10550,11 @@ void Player_InitMode_6(PlayState* play, Player* this) { void func_80841744(PlayState* play, Player* this) { Player_SetAction(play, this, Player_Action_91, 0); if (PLAYER_GET_INITMODE(&this->actor) == PLAYER_INITMODE_8) { - Player_AnimationPlayOnceReverse(play, this, D_8085D17C[this->transformation]); + Player_Anim_PlayOnceAdjustedReverse(play, this, D_8085D17C[this->transformation]); this->itemAction = PLAYER_IA_OCARINA; Player_SetModels(this, Player_ActionToModelGroup(this, this->itemAction)); } else { - func_8082DB60(play, this, D_8085BE84[PLAYER_ANIMGROUP_43][this->modelAnimType]); + Player_Anim_PlayLoopAdjusted(play, this, D_8085BE84[PLAYER_ANIMGROUP_43][this->modelAnimType]); } this->stateFlags1 |= PLAYER_STATE1_20000000; this->unk_ABC = -10000.0f; @@ -10754,12 +10764,12 @@ void Player_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.y = this->currentYaw; if (this->prevMask != PLAYER_MASK_NONE) { - func_8082DB90(play, this, &gPlayerAnim_cl_maskoff); + Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_cl_maskoff); } else if (this->transformation == PLAYER_FORM_HUMAN) { - PlayerAnimation_Change(play, &this->skelAnime, D_8085D160[this->transformation], -2.0f / 3.0f, 9.0f, - 0.0f, ANIMMODE_ONCE, 0.0f); + PlayerAnimation_Change(play, &this->skelAnime, D_8085D160[this->transformation], + -PLAYER_ANIM_ADJUSTED_SPEED, 9.0f, 0.0f, ANIMMODE_ONCE, 0.0f); } else { - func_8082DB60(play, this, &gPlayerAnim_cl_setmaskend); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_cl_setmaskend); } this->stateFlags1 |= (PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000); @@ -12038,8 +12048,9 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { this->actor.parent = this->rideActor; func_80837BD0(play, this); this->av2.actionVar2 = -1; - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_uma_wait_1); - func_8082E920(play, this, ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_uma_wait_1); + Player_AnimReplace_Setup(play, this, + ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); } if (this->unk_ADC == 0) { @@ -12200,8 +12211,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { func_808425B4(this); Player_ProcessControlStick(play, this); - D_8085C3E4 = (this->stateFlags1 & PLAYER_STATE1_8000000) ? 0.5f : 1.0f; - D_8085C3E8 = 1.0f / D_8085C3E4; + sPlayerWaterSpeedScale = (this->stateFlags1 & PLAYER_STATE1_8000000) ? 0.5f : 1.0f; + D_8085C3E8 = 1.0f / sPlayerWaterSpeedScale; sPlayerUseHeldItem = sPlayerHeldItemButtonIsHeldDown = false; @@ -12905,7 +12916,7 @@ s32 func_80847880(PlayState* play, Player* this) { if (!func_800B7118(this) || Player_IsHoldingHookshot(this)) { Player_UseItem(play, this, ITEM_BOW); } - Player_AnimationPlayOnce(play, this, func_8082ED20(this)); + Player_Anim_PlayOnce(play, this, func_8082ED20(this)); this->csAction = PLAYER_CSACTION_NONE; this->stateFlags1 |= PLAYER_STATE1_100000; Player_StopHorizontalMovement(this); @@ -13016,9 +13027,9 @@ s32 func_80847BF0(Player* this, PlayState* play) { Player_SetAction_PreserveMoveFlags(play, this, Player_Action_53, 0); this->unk_B48 = sp34 - rideActor->actor.world.pos.y; - Player_AnimationPlayOnce(play, this, - (this->mountSide < 0) ? &gPlayerAnim_link_uma_left_down - : &gPlayerAnim_link_uma_right_down); + Player_Anim_PlayOnce(play, this, + (this->mountSide < 0) ? &gPlayerAnim_link_uma_left_down + : &gPlayerAnim_link_uma_right_down); return true; } @@ -13086,7 +13097,7 @@ void func_80847FF8(Player* this, f32* arg1, f32 arg2, s16 arg3) { void func_80848048(PlayState* play, Player* this) { Player_SetAction(play, this, Player_Action_58, 0); - func_8082E634(play, this, &gPlayerAnim_link_swimer_swim); + Player_Anim_PlayLoopSlowMorph(play, this, &gPlayerAnim_link_swimer_swim); } s32 func_80848094(PlayState* play, Player* this, f32* arg2, s16* arg3) { @@ -13120,7 +13131,7 @@ s32 func_80848094(PlayState* play, Player* this, f32* arg2, s16* arg3) { } if (anim != this->skelAnime.animation) { - func_8082E634(play, this, anim); + Player_Anim_PlayLoopSlowMorph(play, this, anim); return true; } return false; @@ -13144,7 +13155,7 @@ void func_80848250(PlayState* play, Player* this) { void func_80848294(PlayState* play, Player* this) { func_80848250(play, this); - func_8082DC28(this); + Player_Anim_ResetModelRotY(this); func_80839E74(this, play); this->currentYaw = this->actor.shape.rot.y; } @@ -13304,7 +13315,7 @@ s32 Player_UpperAction_ChangeHeldItem(Player* this, PlayState* play) { if (func_8082ED94(this) != 0) { Player_WaitToFinishItemChange(play, this); - Player_AnimationPlayOnce(play, this, func_8082ED20(this)); + Player_Anim_PlayOnce(play, this, func_8082ED20(this)); this->unk_AA4 = 0; } else { Player_WaitToFinishItemChange(play, this); @@ -13334,7 +13345,8 @@ s32 Player_UpperAction_4(Player* this, PlayState* play) { anim = func_80830A58(play, this); endFrame = Animation_GetLastFrame(anim); - PlayerAnimation_Change(play, &this->skelAnimeUpper, anim, 1.0f, endFrame, endFrame, ANIMMODE_ONCE, 0.0f); + PlayerAnimation_Change(play, &this->skelAnimeUpper, anim, PLAYER_ANIM_NORMAL_SPEED, endFrame, endFrame, + ANIMMODE_ONCE, 0.0f); } this->stateFlags1 |= PLAYER_STATE1_400000; @@ -13428,7 +13440,7 @@ s32 Player_UpperAction_7(Player* this, PlayState* play) { if (this->transformation == PLAYER_FORM_DEKU) { PlayerAnimation_PlayOnceSetSpeed(play, &this->skelAnimeUpper, &gPlayerAnim_pn_tamahaki, - 2.0f / 3.0f); + PLAYER_ANIM_ADJUSTED_SPEED); } } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_80831194(play, this); @@ -13705,7 +13717,7 @@ void Player_Action_1(Player* this, PlayState* play) { this->linearVelocity = 0.0f; this->currentYaw = this->actor.shape.rot.y; this->actor.velocity.y = 0.0f; - Player_AnimationPlayOnce(play, this, func_8082ED20(this)); + Player_Anim_PlayOnce(play, this, func_8082ED20(this)); if ((play->roomCtx.curRoom.num == this->unk_3CE) && (play->roomCtx.prevRoom.num < 0)) { this->av2.actionVar2 = 5; @@ -13748,8 +13760,8 @@ void Player_Action_2(Player* this, PlayState* play) { if (this->av2.actionVar2 != 0) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - func_8082E794(this); - Player_AnimationPlayLoop(play, this, func_8082EF54(this)); + Player_Anim_ResetMove(this); + Player_Anim_PlayLoop(play, this, func_8082EF54(this)); this->av2.actionVar2 = 0; this->stateFlags3 &= ~PLAYER_STATE3_8; } @@ -13808,8 +13820,8 @@ void Player_Action_3(Player* this, PlayState* play) { s32 temp_v0; if (PlayerAnimation_Update(play, &this->skelAnime)) { - func_8082E794(this); - Player_AnimationPlayOnce(play, this, func_8082ED20(this)); + Player_Anim_ResetMove(this); + Player_Anim_PlayOnce(play, this, func_8082ED20(this)); this->stateFlags3 &= ~PLAYER_STATE3_8; } @@ -13873,10 +13885,10 @@ void Player_Action_4(Player* this, PlayState* play) { this->skelAnime.endFrame = this->skelAnime.animLength - 1.0f; } - this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].y = - (this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].y + ((this->av2.actionVar2 & 1) * 0x50)) - 0x28; + this->skelAnime.jointTable[LIMB_ROOT_POS].y = + (this->skelAnime.jointTable[LIMB_ROOT_POS].y + ((this->av2.actionVar2 & 1) * 0x50)) - 0x28; } else { - func_8082E794(this); + Player_Anim_ResetMove(this); Player_ChooseIdleAnim(play, this); } this->stateFlags3 &= ~PLAYER_STATE3_8; @@ -14335,11 +14347,11 @@ void Player_Action_16(Player* this, PlayState* play) { void Player_Action_17(Player* this, PlayState* play) { if (this->skelAnime.animation == &gPlayerAnim_link_normal_backspace) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - func_8082E794(this); - func_8082E438(play, this, D_8085BE84[PLAYER_ANIMGROUP_31][this->modelAnimType]); + Player_Anim_ResetMove(this); + Player_Anim_PlayOnceMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_31][this->modelAnimType]); } } else { - func_8082E67C(play, this, D_8085BE84[PLAYER_ANIMGROUP_32][this->modelAnimType]); + Player_Anim_PlayLoopOnceFinished(play, this, D_8085BE84[PLAYER_ANIMGROUP_32][this->modelAnimType]); } if (DECR(this->av2.actionVar2) == 0) { @@ -14378,7 +14390,7 @@ void Player_Action_18(Player* this, PlayState* play) { if (PlayerAnimation_Update(play, &this->skelAnime)) { if (!Player_IsGoronOrDeku(this)) { - Player_AnimationPlayLoop(play, this, D_8085BE84[PLAYER_ANIMGROUP_20][this->modelAnimType]); + Player_Anim_PlayLoop(play, this, D_8085BE84[PLAYER_ANIMGROUP_20][this->modelAnimType]); } this->av2.actionVar2 = 1; @@ -14435,7 +14447,7 @@ void Player_Action_18(Player* this, PlayState* play) { if (Player_IsGoronOrDeku(this)) { func_80836A5C(this, play); - PlayerAnimation_Change(play, &this->skelAnime, this->skelAnime.animation, 1.0f, + PlayerAnimation_Change(play, &this->skelAnime, this->skelAnime.animation, PLAYER_ANIM_NORMAL_SPEED, Animation_GetLastFrame(this->skelAnime.animation), 0.0f, 2, 0.0f); } else { if (this->itemAction <= PLAYER_IA_MINUS1) { @@ -14479,7 +14491,8 @@ void Player_Action_19(Player* this, PlayState* play) { Player_SetModelsForHoldingShield(this); anim = D_8085BE84[PLAYER_ANIMGROUP_19][this->modelAnimType]; endFrame = Animation_GetLastFrame(anim); - PlayerAnimation_Change(play, &this->skelAnime, anim, 1.0f, endFrame, endFrame, ANIMMODE_ONCE, 0.0f); + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_NORMAL_SPEED, endFrame, endFrame, + ANIMMODE_ONCE, 0.0f); } } } @@ -14533,10 +14546,9 @@ void Player_Action_21(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_4000000; } - Player_AnimationPlayOnce(play, this, - (this->currentYaw != this->actor.shape.rot.y) - ? &gPlayerAnim_link_normal_front_downB - : &gPlayerAnim_link_normal_back_downB); + Player_Anim_PlayOnce(play, this, + (this->currentYaw != this->actor.shape.rot.y) ? &gPlayerAnim_link_normal_front_downB + : &gPlayerAnim_link_normal_back_downB); Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_FREEZE); } } @@ -14558,9 +14570,10 @@ void Player_Action_22(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_4000000; } - func_8082DB90(play, this, - (this->currentYaw != this->actor.shape.rot.y) ? &gPlayerAnim_link_normal_front_down_wake - : &gPlayerAnim_link_normal_back_down_wake); + Player_Anim_PlayOnceAdjusted(play, this, + (this->currentYaw != this->actor.shape.rot.y) + ? &gPlayerAnim_link_normal_front_down_wake + : &gPlayerAnim_link_normal_back_down_wake); this->currentYaw = this->actor.shape.rot.y; } } @@ -14681,8 +14694,8 @@ void Player_Action_25(Player* this, PlayState* play) { func_80840980(this, NA_SE_VO_LI_FALL_S); this->stateFlags3 &= ~PLAYER_STATE3_10000; } - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_normal_landing, 1.0f, 0.0f, 0.0f, - ANIMMODE_ONCE, 8.0f); + PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_normal_landing, + PLAYER_ANIM_NORMAL_SPEED, 0.0f, 0.0f, ANIMMODE_ONCE, 8.0f); this->av2.actionVar2 = -1; } } else { @@ -14807,7 +14820,7 @@ void Player_Action_27(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_20; if (PlayerAnimation_Update(play, &this->skelAnime)) { - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_normal_run_jump_water_fall_wait); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_normal_run_jump_water_fall_wait); } Math_StepToF(&this->linearVelocity, 0.0f, 0.05f); @@ -14825,7 +14838,7 @@ void Player_Action_28(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_20; if (PlayerAnimation_Update(play, &this->skelAnime)) { - func_8082DB60(play, this, &gPlayerAnim_pz_fishswim); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_pz_fishswim); } Math_SmoothStepToS(&this->unk_B86[1], 0, 6, 0x7D0, 0x190); @@ -14882,10 +14895,10 @@ void Player_Action_30(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_1000; if (PlayerAnimation_Update(play, &this->skelAnime)) { - func_8082E794(this); + Player_Anim_ResetMove(this); func_8083133C(this); this->stateFlags1 &= ~PLAYER_STATE1_20000; - Player_AnimationPlayLoop(play, this, D_8085CF60[Player_IsHoldingTwoHandedWeapon(this)]); + Player_Anim_PlayLoop(play, this, D_8085CF60[Player_IsHoldingTwoHandedWeapon(this)]); this->av2.actionVar2 = -1; } @@ -15127,7 +15140,7 @@ void Player_Action_35(Player* this, PlayState* play) { this->av2.actionVar2 = 1; } } else if (this->av1.actionVar1 == 0) { - f32 sp6C = 5.0f * D_8085C3E4; + f32 sp6C = 5.0f * sPlayerWaterSpeedScale; s32 var_t0 = func_808411D4(play, this, &sp6C, -1); if (this->unk_397 == 4) { @@ -15360,7 +15373,7 @@ void Player_Action_38(Player* this, PlayState* play) { func_80832F24(this); if (PlayerAnimation_Update(play, &this->skelAnime)) { - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_silver_wait); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_silver_wait); this->av2.actionVar2 = 1; } else if (this->av2.actionVar2 == 0) { if (PlayerAnimation_OnFrame(&this->skelAnime, 27.0f)) { @@ -15374,7 +15387,7 @@ void Player_Action_38(Player* this, PlayState* play) { } } else if (CHECK_BTN_ANY(sPlayerControlInput->press.button, BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_B | BTN_A)) { Player_SetAction(play, this, Player_Action_39, 1); - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_silver_throw); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_silver_throw); } } @@ -15396,7 +15409,7 @@ void Player_Action_39(Player* this, PlayState* play) { void Player_Action_40(Player* this, PlayState* play) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_normal_nocarry_free_wait); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_normal_nocarry_free_wait); this->av2.actionVar2 = 15; } else if (this->av2.actionVar2 != 0) { this->av2.actionVar2--; @@ -15526,14 +15539,14 @@ void Player_Action_44(Player* this, PlayState* play) { } } else if (!func_80123420(this) && PlayerAnimation_Update(play, &this->skelAnime)) { if (this->skelAnime.moveFlags != 0) { - func_8082E794(this); + Player_Anim_ResetMove(this); if ((this->talkActor->category == ACTORCAT_NPC) && (this->heldItemAction != PLAYER_IA_FISHING_ROD)) { - func_8082DB90(play, this, &gPlayerAnim_link_normal_talk_free); + Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_link_normal_talk_free); } else { - Player_AnimationPlayLoop(play, this, func_8082ED20(this)); + Player_Anim_PlayLoop(play, this, func_8082ED20(this)); } } else { - func_8082DB60(play, this, &gPlayerAnim_link_normal_talk_free_wait); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_link_normal_talk_free_wait); } } @@ -15545,9 +15558,9 @@ void Player_Action_44(Player* this, PlayState* play) { if (PlayerAnimation_Update(play, &this->skelAnimeUpper)) { this->av1.actionVar1--; if (this->av1.actionVar1 != 0) { - PlayerAnimation_Change(play, &this->skelAnimeUpper, &gPlayerAnim_link_normal_talk_free, 1.0f, - 0.0f, Animation_GetLastFrame(&gPlayerAnim_link_normal_talk_free), - ANIMMODE_ONCE, -6.0f); + PlayerAnimation_Change( + play, &this->skelAnimeUpper, &gPlayerAnim_link_normal_talk_free, PLAYER_ANIM_NORMAL_SPEED, + 0.0f, Animation_GetLastFrame(&gPlayerAnim_link_normal_talk_free), ANIMMODE_ONCE, -6.0f); } } } @@ -15594,7 +15607,7 @@ AnimSfxEntry D_8085D650[] = { void Player_Action_46(Player* this, PlayState* play) { this->stateFlags2 |= (PLAYER_STATE2_1 | PLAYER_STATE2_40 | PLAYER_STATE2_100); - if (func_8082E67C(play, this, &gPlayerAnim_link_normal_pushing)) { + if (Player_Anim_PlayLoopOnceFinished(play, this, &gPlayerAnim_link_normal_pushing)) { this->av2.actionVar2 = 1; } else if ((this->av2.actionVar2 == 0) && PlayerAnimation_OnFrame(&this->skelAnime, 11.0f)) { Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_PUSH); @@ -15637,7 +15650,7 @@ void Player_Action_47(Player* this, PlayState* play) { this->stateFlags2 |= (PLAYER_STATE2_1 | PLAYER_STATE2_40 | PLAYER_STATE2_100); - if (func_8082E67C(play, this, anim)) { + if (Player_Anim_PlayLoopOnceFinished(play, this, anim)) { this->av2.actionVar2 = 1; } else if (this->av2.actionVar2 == 0) { if (PlayerAnimation_OnFrame(&this->skelAnime, 11.0f)) { @@ -15697,9 +15710,9 @@ void Player_Action_48(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_40; if (PlayerAnimation_Update(play, &this->skelAnime)) { - Player_AnimationPlayLoop(play, this, - (this->av1.actionVar1 > 0) ? &gPlayerAnim_link_normal_fall_wait - : D_8085BE84[PLAYER_ANIMGROUP_39][this->modelAnimType]); + Player_Anim_PlayLoop(play, this, + (this->av1.actionVar1 > 0) ? &gPlayerAnim_link_normal_fall_wait + : D_8085BE84[PLAYER_ANIMGROUP_39][this->modelAnimType]); } else if (this->av1.actionVar1 == 0) { f32 frame; @@ -15747,8 +15760,8 @@ void Player_Action_49(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_40; if (PlayerAnimation_Update(play, &this->skelAnime)) { - this->currentYaw = this->skelAnime.jointTable[PLAYER_LIMB_WAIST - 1].y + this->actor.shape.rot.y; - func_8082E820(this, 1); + this->currentYaw = this->skelAnime.jointTable[LIMB_ROOT_ROT].y + this->actor.shape.rot.y; + Player_AnimReplace_SetupLedgeClimb(this, ANIM_FLAG_1); this->actor.shape.rot.y = this->currentYaw; func_80839E74(this, play); this->stateFlags1 &= ~(PLAYER_STATE1_4 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000); @@ -15848,7 +15861,7 @@ void Player_Action_50(Player* this, PlayState* play) { } } else { this->skelAnime.prevTransl = this->ageProperties->unk_4A[sp78]; - Player_AnimationPlayOnce(play, this, this->ageProperties->unk_B4[sp78]); + Player_Anim_PlayOnce(play, this, this->ageProperties->unk_B4[sp78]); } } else if ((this->actor.world.pos.y - this->actor.floorHeight) < 15.0f) { if (this->av1.actionVar1 != 0) { @@ -15875,7 +15888,7 @@ void Player_Action_50(Player* this, PlayState* play) { if (xStick > 0) { this->skelAnime.prevTransl = this->ageProperties->unk_7A[this->av2.actionVar2]; - Player_AnimationPlayOnce(play, this, anim2); + Player_Anim_PlayOnce(play, this, anim2); } else { this->skelAnime.prevTransl = this->ageProperties->unk_7A[this->av2.actionVar2 + 2]; PlayerAnimation_Change(play, &this->skelAnime, anim2, -1.0f, Animation_GetLastFrame(anim2), 0.0f, 2, @@ -16003,7 +16016,7 @@ u8 D_8085D6DC[][2] = { { 25, 42 }, }; -Vec3s D_8085D6E0 = { -0x45, 0x1BEA, -0x10A }; +Vec3s D_8085D6E0 = { -69, 7146, -266 }; AnimSfxEntry D_8085D6E8[] = { ANIMSFX(ANIMSFX_TYPE_GENERAL, 48, NA_SE_PL_CALM_HIT, CONTINUE), @@ -16061,7 +16074,7 @@ void Player_Action_52(Player* this, PlayState* play) { index = 1; } - Player_AnimationPlayOnce(play, this, D_8085D6D0[index]); + Player_Anim_PlayOnce(play, this, D_8085D6D0[index]); } else { this->skelAnime.animation = D_8085D688[animIndex - 2]; if (this->av2.actionVar2 >= 0) { @@ -16079,7 +16092,7 @@ void Player_Action_52(Player* this, PlayState* play) { if (this->av2.actionVar2 == 1) { if (D_80862B04 || func_8082DAFC(play)) { - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_uma_wait_3); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_uma_wait_3); } else if (PlayerAnimation_Update(play, &this->skelAnime)) { this->av2.actionVar2 = 0x63; } else if (this->skelAnime.animation == &gPlayerAnim_link_uma_wait_1) { @@ -16233,7 +16246,7 @@ s32 func_80850734(PlayState* play, Player* this) { (this->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER) && CHECK_BTN_ALL(sPlayerControlInput->cur.button, BTN_A)) { func_8083B850(play, this); this->stateFlags2 |= PLAYER_STATE2_400; - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pz_waterroll, 2.0f / 3.0f, 4.0f, + PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pz_waterroll, PLAYER_ANIM_ADJUSTED_SPEED, 4.0f, Animation_GetLastFrame(&gPlayerAnim_pz_waterroll), ANIMMODE_ONCE, -6.0f); this->av2.actionVar2 = 5; this->unk_B86[0] = 0; @@ -16260,7 +16273,7 @@ void Player_Action_54(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_20; - func_8082E67C(play, this, &gPlayerAnim_link_swimer_swim_wait); + Player_Anim_PlayLoopOnceFinished(play, this, &gPlayerAnim_link_swimer_swim_wait); func_808475B4(this); if (this->av2.actionVar2 != 0) { @@ -16380,9 +16393,9 @@ void Player_Action_56(Player* this, PlayState* play) { if (PlayerAnimation_Update(play, &this->skelAnime) && (DECR(this->av2.actionVar2) == 0)) { if (this->unk_B86[0] != 0) { this->stateFlags3 &= ~PLAYER_STATE3_8000; - func_8082DB90(play, this, &gPlayerAnim_pz_swimtowait); + Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_pz_swimtowait); } else { - func_8082DB60(play, this, &gPlayerAnim_pz_fishswim); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_pz_fishswim); } } else { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); @@ -16408,7 +16421,7 @@ void Player_Action_56(Player* this, PlayState* play) { if ((!func_8082DA90(play) && !CHECK_BTN_ALL(sPlayerControlInput->cur.button, BTN_A)) || (this->currentBoots != PLAYER_BOOTS_ZORA_LAND) || (this->windSpeed > 9.0f)) { this->stateFlags3 &= ~PLAYER_STATE3_8000; - func_8082DB90(play, this, &gPlayerAnim_pz_swimtowait); + Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_pz_swimtowait); this->unk_B86[0] = 1; } else { speedTarget = 9.0f; @@ -16565,7 +16578,7 @@ void Player_Action_59(Player* this, PlayState* play) { func_808481CC(play, this, -2.0f); } else { this->av1.actionVar1++; - func_8082E634(play, this, &gPlayerAnim_link_swimer_swim_wait); + Player_Anim_PlayLoopSlowMorph(play, this, &gPlayerAnim_link_swimer_swim_wait); } } @@ -16579,7 +16592,7 @@ void Player_Action_59(Player* this, PlayState* play) { if (this->unk_AAA < 0x2710) { this->av1.actionVar1++; this->av2.actionVar2 = this->actor.depthInWater; - func_8082E634(play, this, &gPlayerAnim_link_swimer_swim); + Player_Anim_PlayLoopSlowMorph(play, this, &gPlayerAnim_link_swimer_swim); } } else if (!func_8083B3B4(play, this, sPlayerControlInput)) { f32 var_fv1 = (this->av2.actionVar2 * 0.018f) + 4.0f; @@ -16656,7 +16669,7 @@ void func_80851D30(PlayState* play, Player* this) { s32 i; if (this->skelAnime.mode != ANIMMODE_LOOP) { - func_8082DB60(play, this, D_8085D190[this->transformation]); + Player_Anim_PlayLoopAdjusted(play, this, D_8085D190[this->transformation]); } func_80124618(D_801C03A0, this->skelAnime.curFrame, &sp50); @@ -16667,7 +16680,7 @@ void func_80851D30(PlayState* play, Player* this) { } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_ACTIVE) { if (play->msgCtx.ocarinaButtonIndex != OCARINA_BTN_INVALID) { var_s0[play->msgCtx.ocarinaButtonIndex] = 1.2f; - func_8082DB90(play, this, D_8085D190[this->transformation]); + Player_Anim_PlayOnceAdjusted(play, this, D_8085D190[this->transformation]); } else { s32 i; @@ -16745,7 +16758,7 @@ void func_80851F18(PlayState* play, Player* this) { void func_808521E0(PlayState* play, Player* this) { if (func_80851C40(play, this)) { if (this->skelAnime.animation != &gPlayerAnim_pg_gakkiplay) { - func_8082DB60(play, this, &gPlayerAnim_pg_gakkiplay); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_pg_gakkiplay); } func_80124618(D_801C0490, this->skelAnime.curFrame, &this->unk_AF0[1]); @@ -16762,7 +16775,7 @@ void func_808521E0(PlayState* play, Player* this) { void func_80852290(PlayState* play, Player* this) { if (func_80851C40(play, this)) { if (this->skelAnime.mode != ANIMMODE_LOOP) { - func_8082DB60(play, this, D_8085D190[this->transformation]); + Player_Anim_PlayLoopAdjusted(play, this, D_8085D190[this->transformation]); } this->unk_B8A = 8; @@ -16778,7 +16791,7 @@ void func_80852290(PlayState* play, Player* this) { this->unk_A94 = 0.0f; } - func_8082DB90(play, this, D_8085D190[this->transformation]); + Player_Anim_PlayOnceAdjusted(play, this, D_8085D190[this->transformation]); this->unk_B8A = 8; } @@ -16835,12 +16848,12 @@ void func_8085255C(PlayState* play, Player* this) { void func_808525C4(PlayState* play, Player* this) { if (this->av2.actionVar2++ >= 3) { if ((this->transformation == PLAYER_FORM_ZORA) || (this->transformation == PLAYER_FORM_DEKU)) { - func_8082E5A8(play, this, D_8085D190[this->transformation]); + Player_Anim_PlayOnceFreeze(play, this, D_8085D190[this->transformation]); } else if (this->transformation == PLAYER_FORM_GORON) { func_80851EAC(this); - func_8082DB60(play, this, &gPlayerAnim_pg_gakkiwait); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_pg_gakkiwait); } else { - func_8082DB60(play, this, D_8085D190[this->transformation]); + Player_Anim_PlayLoopAdjusted(play, this, D_8085D190[this->transformation]); } this->unk_B48 = 1.0f; @@ -16870,7 +16883,7 @@ void Player_Action_63(Player* this, PlayState* play) { Player_TalkWithPlayer(play, this->talkActor); } else if (!Player_ActionChange_13(this, play)) { func_80836A5C(this, play); - Player_AnimationPlayOnceReverse(play, this, D_8085D17C[this->transformation]); + Player_Anim_PlayOnceAdjustedReverse(play, this, D_8085D17C[this->transformation]); } } else { s32 var_v1 = (play->msgCtx.ocarinaMode >= OCARINA_MODE_WARP_TO_GREAT_BAY_COAST) && @@ -16909,7 +16922,7 @@ void Player_Action_63(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000; } else { func_80836A5C(this, play); - Player_AnimationPlayOnceReverse(play, this, D_8085D17C[this->transformation]); + Player_Anim_PlayOnceAdjustedReverse(play, this, D_8085D17C[this->transformation]); } } } else if ((play->msgCtx.ocarinaMode == OCARINA_MODE_EVENT) && @@ -16921,8 +16934,8 @@ void Player_Action_63(Player* this, PlayState* play) { Player_SetAction_PreserveItemAction(play, this, Player_Action_88, 0); this->stateFlags1 |= PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000; } else if (this->unk_AA5 == PLAYER_UNKAA5_4) { - f32 temp_fa0 = this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].x; - f32 temp_fa1 = this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].z; + f32 temp_fa0 = this->skelAnime.jointTable[LIMB_ROOT_POS].x; + f32 temp_fa1 = this->skelAnime.jointTable[LIMB_ROOT_POS].z; f32 var_fv1; var_fv1 = sqrtf(SQ(temp_fa0) + SQ(temp_fa1)); @@ -16931,8 +16944,8 @@ void Player_Action_63(Player* this, PlayState* play) { var_fv1 = CLAMP_MIN(var_fv1, 0.0f); } - this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].x = temp_fa0 * var_fv1; - this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].z = temp_fa1 * var_fv1; + this->skelAnime.jointTable[LIMB_ROOT_POS].x = temp_fa0 * var_fv1; + this->skelAnime.jointTable[LIMB_ROOT_POS].z = temp_fa1 * var_fv1; } else { func_8085255C(play, this); } @@ -17011,7 +17024,7 @@ void Player_Action_65(Player* this, PlayState* play) { } } } else { - func_8082E794(this); + Player_Anim_ResetMove(this); if ((this->getItemId == GI_STRAY_FAIRY) || (this->getItemId == GI_SKULL_TOKEN) || (this->getItemId == GI_ICE_TRAP)) { @@ -17025,18 +17038,20 @@ void Player_Action_65(Player* this, PlayState* play) { } } else { if (this->skelAnime.animation == &gPlayerAnim_link_normal_box_kick) { - func_8082DB90(play, this, - (this->transformation == PLAYER_FORM_DEKU) ? &gPlayerAnim_pn_getB - : &gPlayerAnim_link_demo_get_itemB); + Player_Anim_PlayOnceAdjusted(play, this, + (this->transformation == PLAYER_FORM_DEKU) + ? &gPlayerAnim_pn_getB + : &gPlayerAnim_link_demo_get_itemB); } else { - func_8082DB90(play, this, - (this->transformation == PLAYER_FORM_DEKU) ? &gPlayerAnim_pn_getA - : &gPlayerAnim_link_demo_get_itemA); + Player_Anim_PlayOnceAdjusted(play, this, + (this->transformation == PLAYER_FORM_DEKU) + ? &gPlayerAnim_pn_getA + : &gPlayerAnim_link_demo_get_itemA); } - func_8082E920(play, this, - ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | - ANIM_FLAG_80); + Player_AnimReplace_Setup(play, this, + ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_4 | ANIM_FLAG_8 | + ANIM_FLAG_NOMOVE | ANIM_FLAG_80); Player_StopCutscene(this); this->csId = play->playerCsIds[PLAYER_CS_ID_ITEM_GET]; this->av2.actionVar2 = 2; @@ -17156,9 +17171,10 @@ void Player_Action_67(Player* this, PlayState* play) { gSaveContext.jinxTimer = 0; } - func_8082DB60(play, this, - (this->transformation == PLAYER_FORM_DEKU) ? &gPlayerAnim_pn_drink - : &gPlayerAnim_link_bottle_drink_demo_wait); + Player_Anim_PlayLoopAdjusted(play, this, + (this->transformation == PLAYER_FORM_DEKU) + ? &gPlayerAnim_pn_drink + : &gPlayerAnim_link_bottle_drink_demo_wait); this->av2.actionVar2 = 1; //! FAKE @@ -17178,11 +17194,11 @@ void Player_Action_67(Player* this, PlayState* play) { } else if (this->av2.actionVar2 == 1) { if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.magicState != MAGIC_STATE_FILL)) { if (this->transformation == PLAYER_FORM_DEKU) { - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pn_drinkend, 2.0f / 3.0f, 0.0f, 5.0f, 2, - -6.0f); + PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pn_drinkend, PLAYER_ANIM_ADJUSTED_SPEED, + 0.0f, 5.0f, 2, -6.0f); this->av2.actionVar2 = -7; } else { - func_8082E4A4(play, this, &gPlayerAnim_link_bottle_drink_demo_end); + Player_Anim_PlayOnceMorphAdjusted(play, this, &gPlayerAnim_link_bottle_drink_demo_end); this->av2.actionVar2 = 2; } @@ -17276,7 +17292,7 @@ void Player_Action_68(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000; interactRangeActor->parent = &this->actor; Player_UpdateBottleHeld(play, this, entry->itemId, entry->itemAction); - func_8082DB90(play, this, sp24->unk_4); + Player_Anim_PlayOnceAdjusted(play, this, sp24->unk_4); } } } @@ -17446,7 +17462,7 @@ void Player_Action_72(Player* this, PlayState* play) { this->stateFlags2 |= (PLAYER_STATE2_20 | PLAYER_STATE2_40); if (PlayerAnimation_Update(play, &this->skelAnime)) { - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_normal_re_dead_attack_wait); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_normal_re_dead_attack_wait); } if (play->sceneId != SCENE_SEA_BS) { @@ -17781,7 +17797,7 @@ void Player_Action_84(Player* this, PlayState* play) { this->skelAnime.moveFlags = 0; Player_SetAction(play, this, Player_Action_4, 1); - func_8082EC9C(play, this, anim); + Player_Anim_PlayOnceWaterAdjustment(play, this, anim); this->currentYaw = this->actor.shape.rot.y; this->skelAnime.moveFlags = moveFlags; } @@ -17959,7 +17975,7 @@ AnimSfxEntry D_8085D904[] = { void func_80855218(PlayState* play, Player* this, struct_8085D910** arg2) { if (PlayerAnimation_Update(play, &this->skelAnime) && (this->skelAnime.animation == &gPlayerAnim_cl_setmask)) { - func_8082DB60(play, this, &gPlayerAnim_cl_setmaskend); + Player_Anim_PlayLoopAdjusted(play, this, &gPlayerAnim_cl_setmaskend); } else if ((this->skelAnime.animation == &gPlayerAnim_cl_setmask) || (this->skelAnime.animation == &gPlayerAnim_cl_setmaskend)) { if (this->av1.actionVar1 >= 58) { @@ -18102,8 +18118,8 @@ void Player_Action_87(Player* this, PlayState* play) { if (this->av1.actionVar1++ < 4) { if ((this->prevMask == PLAYER_MASK_NONE) && (this->av1.actionVar1 == 4)) { - PlayerAnimation_Change(play, &this->skelAnime, func_8082ED20(this), 1.0f, 0.0f, 20.0f, ANIMMODE_ONCE, - 20.0f); + PlayerAnimation_Change(play, &this->skelAnime, func_8082ED20(this), PLAYER_ANIM_NORMAL_SPEED, 0.0f, 20.0f, + ANIMMODE_ONCE, 20.0f); } } else { s32 pad; @@ -18176,7 +18192,7 @@ void Player_Action_90(Player* this, PlayState* play) { void Player_Action_91(Player* this, PlayState* play) { s16 sp3E; s32 pad; - PlayerAnimationHeader* sp34; + PlayerAnimationHeader* anim; s32 var_a0; func_808323C0(this, play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON]); @@ -18189,8 +18205,8 @@ void Player_Action_91(Player* this, PlayState* play) { } this->actor.shape.rot.y += this->av2.actionVar2; - this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].x = 0; - this->skelAnime.jointTable[PLAYER_LIMB_ROOT - 1].z = 0; + this->skelAnime.jointTable[LIMB_ROOT_POS].x = 0; + this->skelAnime.jointTable[LIMB_ROOT_POS].z = 0; this->unk_ABC += this->unk_B10[5]; if (this->unk_ABC >= 0.0f) { @@ -18200,10 +18216,10 @@ void Player_Action_91(Player* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; Player_StopCutscene(this); if (PLAYER_GET_INITMODE(&this->actor) == PLAYER_INITMODE_8) { - sp34 = D_8085D17C[this->transformation]; + anim = D_8085D17C[this->transformation]; func_80836A5C(this, play); - PlayerAnimation_Change(play, &this->skelAnime, sp34, -2.0f / 3.0f, Animation_GetLastFrame(sp34), - 0.0f, ANIMMODE_ONCE, -6.0f); + PlayerAnimation_Change(play, &this->skelAnime, anim, -PLAYER_ANIM_ADJUSTED_SPEED, + Animation_GetLastFrame(anim), 0.0f, ANIMMODE_ONCE, -6.0f); } else { func_80839E74(this, play); } @@ -18219,7 +18235,7 @@ void Player_Action_92(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_20; if (PlayerAnimation_Update(play, &this->skelAnime)) { - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_hook_fly_wait); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_hook_fly_wait); } Math_Vec3f_Sum(&this->actor.world.pos, &this->actor.velocity, &this->actor.world.pos); @@ -18568,7 +18584,7 @@ void Player_Action_94(Player* this, PlayState* play) { if ((this->av2.actionVar2 != 0) && (temp_fv1 > 300.0f)) { sp76 = 0x1770; if (this->skelAnime.animation != &gPlayerAnim_pn_kakku) { - func_8082E5EC(play, this, &gPlayerAnim_pn_kakkufinish); + Player_Anim_PlayOnceFreezeAdjusted(play, this, &gPlayerAnim_pn_kakkufinish); } else if (PlayerAnimation_OnFrame(&this->skelAnime, 8.0f)) { s32 i; @@ -18589,7 +18605,7 @@ void Player_Action_94(Player* this, PlayState* play) { sp76 = 0x1770 - (s32)((300.0f - temp_fv1) * 10.0f); if (this->skelAnime.animation != &gPlayerAnim_pn_batabata) { - func_8082E55C(play, this, &gPlayerAnim_pn_batabata); + Player_Anim_PlayLoopMorphAdjusted(play, this, &gPlayerAnim_pn_batabata); } else if (PlayerAnimation_OnFrame(&this->skelAnime, 6.0f)) { Player_PlaySfx(this, NA_SE_PL_DEKUNUTS_STRUGGLE); } @@ -18701,7 +18717,7 @@ void Player_Action_95(Player* this, PlayState* play) { this->stateFlags3 |= PLAYER_STATE3_100000; if (this->unk_B10[1] < 0.0f) { - func_8082E438(play, this, func_8082ED20(this)); + Player_Anim_PlayOnceMorph(play, this, func_8082ED20(this)); } } @@ -18776,8 +18792,8 @@ s32 func_80857950(PlayState* play, Player* this) { ((this->av1.actionVar1 == 3) && (this->actor.velocity.y < 0.0f))) { Player_SetAction(play, this, Player_Action_4, 1); Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos); - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pg_maru_change, -2.0f / 3.0f, 7.0f, 0.0f, - ANIMMODE_ONCE, 0.0f); + PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pg_maru_change, -PLAYER_ANIM_ADJUSTED_SPEED, 7.0f, + 0.0f, ANIMMODE_ONCE, 0.0f); Player_PlaySfx(this, NA_SE_PL_BALL_TO_GORON); return true; } @@ -18787,7 +18803,7 @@ s32 func_80857950(PlayState* play, Player* this) { s32 func_80857A44(PlayState* play, Player* this) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - func_8082E794(this); + Player_Anim_ResetMove(this); this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_800; @@ -19195,118 +19211,111 @@ void Player_Action_96(Player* this, PlayState* play) { } } -void func_80858C84(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - func_8082E784(this); - func_8082E438(play, this, anim); +void Player_CsAnimHelper_PlayOnceMorphReset(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + Player_Anim_ZeroModelYaw(this); + Player_Anim_PlayOnceMorph(play, this, anim); Player_StopHorizontalMovement(this); } -void func_80858CC8(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - func_8082E784(this); - PlayerAnimation_Change(play, &this->skelAnime, anim, 2.0f / 3.0f, 0.0f, Animation_GetLastFrame(anim), ANIMMODE_ONCE, - -8.0f); +void Player_CsAnimHelper_PlayOnceSlowMorphAdjustedReset(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + Player_Anim_ZeroModelYaw(this); + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, Animation_GetLastFrame(anim), + ANIMMODE_ONCE, -8.0f); Player_StopHorizontalMovement(this); } -void func_80858D48(PlayState* play, Player* this, PlayerAnimationHeader* anim) { - func_8082E784(this); - PlayerAnimation_Change(play, &this->skelAnime, anim, 2.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f); +void Player_CsAnimHelper_PlayLoopSlowMorphAdjustedReset(PlayState* play, Player* this, PlayerAnimationHeader* anim) { + Player_Anim_ZeroModelYaw(this); + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f); Player_StopHorizontalMovement(this); } PlayerCsAnim sPlayerCsActionAnimFuncs[] = { - NULL, // PLAYER_CSTYPE_NONE - Player_CsAnim_1, // PLAYER_CSTYPE_ANIM_1 - Player_CsAnim_2, // PLAYER_CSTYPE_ANIM_2 - Player_CsAnim_3, // PLAYER_CSTYPE_ANIM_3 - Player_CsAnim_4, // PLAYER_CSTYPE_ANIM_4 - Player_CsAnim_5, // PLAYER_CSTYPE_ANIM_5 - Player_CsAnim_6, // PLAYER_CSTYPE_ANIM_6 - Player_CsAnim_7, // PLAYER_CSTYPE_ANIM_7 - Player_CsAnim_8, // PLAYER_CSTYPE_ANIM_8 - Player_CsAnim_9, // PLAYER_CSTYPE_ANIM_9 - Player_CsAnim_10, // PLAYER_CSTYPE_ANIM_10 - Player_CsAnim_11, // PLAYER_CSTYPE_ANIM_11 - Player_CsAnim_12, // PLAYER_CSTYPE_ANIM_12 - Player_CsAnim_13, // PLAYER_CSTYPE_ANIM_13 - Player_CsAnim_14, // PLAYER_CSTYPE_ANIM_14 - Player_CsAnim_15, // PLAYER_CSTYPE_ANIM_15 - Player_CsAnim_16, // PLAYER_CSTYPE_ANIM_16 - Player_CsAnim_17, // PLAYER_CSTYPE_ANIM_17 - Player_CsAnim_18, // PLAYER_CSTYPE_ANIM_18 - Player_CsAnim_19, // PLAYER_CSTYPE_ANIM_19 + NULL, // PLAYER_CSTYPE_NONE + Player_CsAnim_StopHorizontalMovement, // PLAYER_CSTYPE_ANIM_1 + Player_CsAnim_PlayOnceMorphReset, // PLAYER_CSTYPE_ANIM_2 + Player_CsAnim_PlayOnceSlowMorphAdjustedReset, // PLAYER_CSTYPE_ANIM_3 + Player_CsAnim_PlayLoopSlowMorphAdjustedReset, // PLAYER_CSTYPE_ANIM_4 + Player_CsAnim_ReplacePlayOnceNormalAdjusted, // PLAYER_CSTYPE_ANIM_5 + Player_CsAnim_ReplacePlayOnce, // PLAYER_CSTYPE_ANIM_6 + Player_CsAnim_ReplacePlayLoopNormalAdjusted, // PLAYER_CSTYPE_ANIM_7 + Player_CsAnim_ReplacePlayLoop, // PLAYER_CSTYPE_ANIM_8 + Player_CsAnim_PlayOnce, // PLAYER_CSTYPE_ANIM_9 + Player_CsAnim_PlayLoop, // PLAYER_CSTYPE_ANIM_10 + Player_CsAnim_Update, // PLAYER_CSTYPE_ANIM_11 + Player_CsAnim_PlayLoopAdjustedSlowMorphAnimSfxReset, // PLAYER_CSTYPE_ANIM_12 + Player_CsAnim_PlayLoopNormalAdjustedOnceFinished, // PLAYER_CSTYPE_ANIM_13 + Player_CsAnim_PlayOnceFreezeReset, // PLAYER_CSTYPE_ANIM_14 + Player_CsAnim_PlayOnceAdjusted, // PLAYER_CSTYPE_ANIM_15 + Player_CsAnim_PlayLoopAdjusted, // PLAYER_CSTYPE_ANIM_16 + Player_CsAnim_PlayLoopAdjustedOnceFinished, // PLAYER_CSTYPE_ANIM_17 + Player_CsAnim_PlayAnimSfx, // PLAYER_CSTYPE_ANIM_18 + Player_CsAnim_ReplacePlayOnceAdjustedReverse, // PLAYER_CSTYPE_ANIM_19 }; -void Player_CsAnim_1(PlayState* play, Player* this, void* arg2) { +void Player_CsAnim_StopHorizontalMovement(PlayState* play, Player* this, void* arg2) { Player_StopHorizontalMovement(this); } -void Player_CsAnim_2(PlayState* play, Player* this, void* anim) { - func_80858C84(play, this, anim); +void Player_CsAnim_PlayOnceMorphReset(PlayState* play, Player* this, void* anim) { + Player_CsAnimHelper_PlayOnceMorphReset(play, this, anim); } -void Player_CsAnim_14(PlayState* play, Player* this, void* anim) { - func_8082E784(this); - func_8082E5A8(play, this, anim); +void Player_CsAnim_PlayOnceFreezeReset(PlayState* play, Player* this, void* anim) { + Player_Anim_ZeroModelYaw(this); + Player_Anim_PlayOnceFreeze(play, this, anim); Player_StopHorizontalMovement(this); } -void Player_CsAnim_3(PlayState* play, Player* this, void* anim) { - func_80858CC8(play, this, anim); +void Player_CsAnim_PlayOnceSlowMorphAdjustedReset(PlayState* play, Player* this, void* anim) { + Player_CsAnimHelper_PlayOnceSlowMorphAdjustedReset(play, this, anim); } -void Player_CsAnim_4(PlayState* play, Player* this, void* anim) { - func_80858D48(play, this, anim); +void Player_CsAnim_PlayLoopSlowMorphAdjustedReset(PlayState* play, Player* this, void* anim) { + Player_CsAnimHelper_PlayLoopSlowMorphAdjustedReset(play, this, anim); } -void Player_CsAnim_5(PlayState* play, Player* this, void* anim) { - func_8082EA60(play, this, anim); +void Player_CsAnim_ReplacePlayOnceNormalAdjusted(PlayState* play, Player* this, void* anim) { + Player_AnimReplace_PlayOnceNormalAdjusted(play, this, anim); } -void Player_CsAnim_6(PlayState* play, Player* this, void* anim) { - func_8082EA10(play, this, anim, ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); +void Player_CsAnim_ReplacePlayOnce(PlayState* play, Player* this, void* anim) { + Player_AnimReplace_PlayOnce(play, this, anim, ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); } -void Player_CsAnim_19(PlayState* play, Player* this, void* anim) { - Player_AnimationPlayOnceReverse(play, this, anim); - func_8082E920(play, this, ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); +void Player_CsAnim_ReplacePlayOnceAdjustedReverse(PlayState* play, Player* this, void* anim) { + Player_Anim_PlayOnceAdjustedReverse(play, this, anim); + Player_AnimReplace_Setup(play, this, ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); } -void Player_CsAnim_7(PlayState* play, Player* this, void* anim) { - func_8082EB18(play, this, anim); +void Player_CsAnim_ReplacePlayLoopNormalAdjusted(PlayState* play, Player* this, void* anim) { + Player_AnimReplace_PlayLoopNormalAdjusted(play, this, anim); } -void Player_CsAnim_8(PlayState* play, Player* this, void* anim) { - func_8082EAC8(play, this, anim, ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); +void Player_CsAnim_ReplacePlayLoop(PlayState* play, Player* this, void* anim) { + Player_AnimReplace_PlayLoop(play, this, anim, ANIM_FLAG_4 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80); } -void Player_CsAnim_9(PlayState* play, Player* this, void* anim) { - Player_AnimationPlayOnce(play, this, anim); +void Player_CsAnim_PlayOnce(PlayState* play, Player* this, void* anim) { + Player_Anim_PlayOnce(play, this, anim); } -void Player_CsAnim_10(PlayState* play, Player* this, void* anim) { - Player_AnimationPlayLoop(play, this, anim); +void Player_CsAnim_PlayLoop(PlayState* play, Player* this, void* anim) { + Player_Anim_PlayLoop(play, this, anim); } -void Player_CsAnim_15(PlayState* play, Player* this, void* anim) { - func_8082DB90(play, this, anim); +void Player_CsAnim_PlayOnceAdjusted(PlayState* play, Player* this, void* anim) { + Player_Anim_PlayOnceAdjusted(play, this, anim); } -void Player_CsAnim_16(PlayState* play, Player* this, void* anim) { - func_8082DB60(play, this, anim); +void Player_CsAnim_PlayLoopAdjusted(PlayState* play, Player* this, void* anim) { + Player_Anim_PlayLoopAdjusted(play, this, anim); } -void Player_CsAnim_11(PlayState* play, Player* this, void* cue) { +void Player_CsAnim_Update(PlayState* play, Player* this, void* cue) { PlayerAnimation_Update(play, &this->skelAnime); } -void func_80858FE8(Player* this) { - if (this->skelAnime.animation == &gPlayerAnim_lost_horse_wait) { - Player_AnimSfx_PlayFloor(this, NA_SE_PL_SLIP_LEVEL - SFX_FLAG); - Player_PlaySfx(this, NA_SE_VO_LK_DRAGGED_DAMAGE - SFX_FLAG); - } -} - AnimSfxEntry D_8085D9E0[] = { ANIMSFX(ANIMSFX_TYPE_FLOOR_LAND, 34, NA_SE_NONE, CONTINUE), ANIMSFX(ANIMSFX_TYPE_GENERAL, 45, NA_SE_PL_CALM_HIT, CONTINUE), @@ -19398,9 +19407,16 @@ AnimSfxEntry D_8085DA90[] = { ANIMSFX(ANIMSFX_TYPE_GENERAL, 18, NA_SE_PL_SIT_ON_HORSE, STOP), }; -void Player_CsAnim_12(PlayState* play, Player* this, void* anim) { +void Player_CsAnimHelper_PlayAnimSfxLostHorse(Player* this) { + if (this->skelAnime.animation == &gPlayerAnim_lost_horse_wait) { + Player_AnimSfx_PlayFloor(this, NA_SE_PL_SLIP_LEVEL - SFX_FLAG); + Player_PlaySfx(this, NA_SE_VO_LK_DRAGGED_DAMAGE - SFX_FLAG); + } +} + +void Player_CsAnim_PlayLoopAdjustedSlowMorphAnimSfxReset(PlayState* play, Player* this, void* anim) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - func_80858D48(play, this, anim); + Player_CsAnimHelper_PlayLoopSlowMorphAdjustedReset(play, this, anim); this->av2.actionVar2 = 1; } @@ -19417,25 +19433,25 @@ void Player_CsAnim_12(PlayState* play, Player* this, void* anim) { } else if (this->skelAnime.animation == &gPlayerAnim_cl_umanoru) { Player_PlayAnimSfx(this, D_8085DA90); } else { - func_80858FE8(this); + Player_CsAnimHelper_PlayAnimSfxLostHorse(this); } } -void Player_CsAnim_17(PlayState* play, Player* this, void* anim) { +void Player_CsAnim_PlayLoopAdjustedOnceFinished(PlayState* play, Player* this, void* anim) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - func_8082E794(this); - func_8082DB60(play, this, anim); + Player_Anim_ResetMove(this); + Player_Anim_PlayLoopAdjusted(play, this, anim); } } -void Player_CsAnim_13(PlayState* play, Player* this, void* anim) { +void Player_CsAnim_PlayLoopNormalAdjustedOnceFinished(PlayState* play, Player* this, void* anim) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - func_8082EB18(play, this, anim); + Player_AnimReplace_PlayLoopNormalAdjusted(play, this, anim); this->av2.actionVar2 = 1; } } -void Player_CsAnim_18(PlayState* play, Player* this, void* entry) { +void Player_CsAnim_PlayAnimSfx(PlayState* play, Player* this, void* entry) { PlayerAnimation_Update(play, &this->skelAnime); Player_PlayAnimSfx(this, entry); } @@ -19454,7 +19470,7 @@ void func_8085929C(PlayState* play, Player* this, UNK_TYPE arg2) { this->stateFlags1 |= PLAYER_STATE1_8000000; this->stateFlags2 |= PLAYER_STATE2_400; this->stateFlags1 &= ~(PLAYER_STATE1_40000 | PLAYER_STATE1_80000); - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_swimer_swim); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_swimer_swim); this->linearVelocity = 0.0f; } @@ -19472,9 +19488,9 @@ void func_80859300(PlayState* play, Player* this, UNK_TYPE arg2) { } else { if (PlayerAnimation_Update(play, &this->skelAnime)) { if (this->av1.actionVar1 == 1) { - func_8082E634(play, this, &gPlayerAnim_link_swimer_swim_wait); + Player_Anim_PlayLoopSlowMorph(play, this, &gPlayerAnim_link_swimer_swim_wait); } else { - Player_AnimationPlayLoop(play, this, &gPlayerAnim_link_swimer_swim_wait); + Player_Anim_PlayLoop(play, this, &gPlayerAnim_link_swimer_swim_wait); } } func_808475B4(this); @@ -19790,11 +19806,11 @@ void Player_CsAction_1(PlayState* play, Player* this, CsCmdActorCue* cue) { PlayerAnimationHeader* anim = D_8085BE84[PLAYER_ANIMGROUP_43][this->modelAnimType]; if ((this->cueId == PLAYER_CUEID_6) || (this->cueId == PLAYER_CUEID_46)) { - Player_AnimationPlayOnce(play, this, anim); + Player_Anim_PlayOnce(play, this, anim); } else { - func_8082E784(this); - PlayerAnimation_Change(play, &this->skelAnime, anim, 2.0f / 3.0f, 0.0f, Animation_GetLastFrame(anim), - ANIMMODE_LOOP, -4.0f); + Player_Anim_ZeroModelYaw(this); + PlayerAnimation_Change(play, &this->skelAnime, anim, PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, + Animation_GetLastFrame(anim), ANIMMODE_LOOP, -4.0f); } Player_StopHorizontalMovement(this); } @@ -19824,8 +19840,9 @@ void Player_CsAction_3(PlayState* play, Player* this, CsCmdActorCue* cue) { this->stateFlags1 |= PLAYER_STATE1_400; } - func_8082DB90(play, this, - (this->transformation == PLAYER_FORM_DEKU) ? &gPlayerAnim_pn_getA : &gPlayerAnim_link_demo_get_itemA); + Player_Anim_PlayOnceAdjusted(play, this, + (this->transformation == PLAYER_FORM_DEKU) ? &gPlayerAnim_pn_getA + : &gPlayerAnim_link_demo_get_itemA); } void Player_CsAction_4(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -19912,7 +19929,7 @@ void Player_CsAction_10(PlayState* play, Player* this, CsCmdActorCue* cue) { func_80859248(this); if (this->av2.actionVar2 != 0) { if (PlayerAnimation_Update(play, &this->skelAnime)) { - Player_AnimationPlayLoop(play, this, func_8082EF54(this)); + Player_Anim_PlayLoop(play, this, func_8082EF54(this)); this->av2.actionVar2 = 0; } func_8082FC60(this); @@ -19935,7 +19952,7 @@ void Player_CsAction_13(PlayState* play, Player* this, CsCmdActorCue* cue) { } void Player_CsAction_14(PlayState* play, Player* this, CsCmdActorCue* cue) { - func_80858CC8(play, this, &gPlayerAnim_link_normal_okarina_start); + Player_CsAnimHelper_PlayOnceSlowMorphAdjustedReset(play, this, &gPlayerAnim_link_normal_okarina_start); this->itemAction = PLAYER_IA_OCARINA; Player_SetModels(this, Player_ActionToModelGroup(this, this->itemAction)); } @@ -19963,7 +19980,7 @@ void Player_CsAction_15(PlayState* play, Player* this, CsCmdActorCue* cue) { } void Player_CsAction_16(PlayState* play, Player* this, CsCmdActorCue* cue) { - func_8082E514(play, this, D_8085BE84[PLAYER_ANIMGROUP_43][this->modelAnimType]); + Player_Anim_PlayLoopMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_43][this->modelAnimType]); Player_StopHorizontalMovement(this); } @@ -19973,7 +19990,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); - func_8082DB90(play, this, &gPlayerAnim_link_demo_return_to_past); + Player_Anim_PlayOnceAdjusted(play, this, &gPlayerAnim_link_demo_return_to_past); } void Player_CsAction_18(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -20004,7 +20021,7 @@ void Player_CsAction_19(PlayState* play, Player* this, CsCmdActorCue* cue) { Vec3f effectPos; Vec3f randPos; - Player_CsAnim_13(play, this, D_8085E354[this->transformation]); + Player_CsAnim_PlayLoopNormalAdjustedOnceFinished(play, this, D_8085E354[this->transformation]); if (this->rightHandType != 0xFF) { this->rightHandType = 0xFF; @@ -20096,7 +20113,7 @@ void Player_CsAction_26(PlayState* play, Player* this, CsCmdActorCue* cue) { } void Player_CsAction_27(PlayState* play, Player* this, CsCmdActorCue* cue) { - Player_AnimationPlayOnce(play, this, &gPlayerAnim_demo_rakka); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_demo_rakka); this->unk_AAA = -0x8000; } @@ -20107,7 +20124,7 @@ void Player_CsAction_28(PlayState* play, Player* this, CsCmdActorCue* cue) { } void Player_CsAction_29(PlayState* play, Player* this, CsCmdActorCue* cue) { - func_8082DB90(play, this, D_8085D17C[this->transformation]); + Player_Anim_PlayOnceAdjusted(play, this, D_8085D17C[this->transformation]); this->itemAction = PLAYER_IA_OCARINA; Player_SetModels(this, Player_ActionToModelGroup(this, this->itemAction)); } @@ -20124,13 +20141,13 @@ void Player_CsAction_30(PlayState* play, Player* this, CsCmdActorCue* cue) { } void Player_CsAction_31(PlayState* play, Player* this, CsCmdActorCue* cue) { - Player_AnimationPlayOnceReverse(play, this, D_8085D17C[this->transformation]); + Player_Anim_PlayOnceAdjustedReverse(play, this, D_8085D17C[this->transformation]); } void Player_CsAction_32(PlayState* play, Player* this, CsCmdActorCue* cue) { Player_Cutscene_Translate(play, this, cue); if (PlayerAnimation_Update(play, &this->skelAnime)) { - func_8082EB18(play, this, &gPlayerAnim_cl_umamiage_loop); + Player_AnimReplace_PlayLoopNormalAdjusted(play, this, &gPlayerAnim_cl_umamiage_loop); } if (this->skelAnime.animation == &gPlayerAnim_cl_nigeru) { @@ -20138,7 +20155,7 @@ void Player_CsAction_32(PlayState* play, Player* this, CsCmdActorCue* cue) { } else if (this->skelAnime.animation == &gPlayerAnim_alink_rakkatyu) { Actor_PlaySfx_FlaggedCentered1(&this->actor, NA_SE_PL_FLYING_AIR - SFX_FLAG); } else { - func_80858FE8(this); + Player_CsAnimHelper_PlayAnimSfxLostHorse(this); } } @@ -20155,7 +20172,7 @@ void Player_CsAction_33(PlayState* play, Player* this, CsCmdActorCue* cue) { void Player_CsAction_34(PlayState* play, Player* this, CsCmdActorCue* cue) { if (PlayerAnimation_Update(play, &this->skelAnime) && (this->av2.actionVar2 == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_normal_back_downB); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_normal_back_downB); this->av2.actionVar2 = 1; } if (this->av2.actionVar2 != 0) { @@ -20164,7 +20181,7 @@ void Player_CsAction_34(PlayState* play, Player* this, CsCmdActorCue* cue) { } void Player_CsAction_35(PlayState* play, Player* this, CsCmdActorCue* cue) { - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_normal_give_other, 1.0f, + PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_normal_give_other, PLAYER_ANIM_NORMAL_SPEED, (play->sceneId == SCENE_ALLEY) ? IREG(56) : 0.0f, Animation_GetLastFrame(&gPlayerAnim_link_normal_give_other), ANIMMODE_ONCE, -8.0f); } @@ -20172,8 +20189,8 @@ void Player_CsAction_35(PlayState* play, Player* this, CsCmdActorCue* cue) { void Player_CsAction_36(PlayState* play, Player* this, CsCmdActorCue* cue) { if (PlayerAnimation_Update(play, &this->skelAnime)) { if (this->av2.actionVar2++ >= 0x15) { - PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pz_wait, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, - -16.0f); + PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pz_wait, PLAYER_ANIM_NORMAL_SPEED, 0.0f, 0.0f, + ANIMMODE_LOOP, -16.0f); } } } @@ -20182,7 +20199,7 @@ void Player_CsAction_37(PlayState* play, Player* this, CsCmdActorCue* cue) { if (func_801242B4(this)) { func_8085929C(play, this, 0); } else { - Player_CsAnim_3(play, this, &gPlayerAnim_link_demo_kousan); + Player_CsAnim_PlayOnceSlowMorphAdjustedReset(play, this, &gPlayerAnim_link_demo_kousan); } } @@ -20190,12 +20207,12 @@ void Player_CsAction_38(PlayState* play, Player* this, CsCmdActorCue* cue) { if (func_801242B4(this)) { func_80859300(play, this, 0); } else { - Player_CsAnim_11(play, this, cue); + Player_CsAnim_Update(play, this, cue); } } void Player_CsAction_39(PlayState* play, Player* this, CsCmdActorCue* cue) { - Player_CsAnim_11(play, this, cue); + Player_CsAnim_Update(play, this, cue); if (Player_ActionChange_2(this, play)) { play->csCtx.state = CS_STATE_STOP; CutsceneManager_Stop(CutsceneManager_GetCurrentCsId()); @@ -20204,7 +20221,7 @@ void Player_CsAction_39(PlayState* play, Player* this, CsCmdActorCue* cue) { void Player_CsAction_40(PlayState* play, Player* this, CsCmdActorCue* cue) { func_80838830(this, OBJECT_GI_RESERVE_C_01); - Player_CsAnim_3(play, this, &gPlayerAnim_link_normal_give_other); + Player_CsAnim_PlayOnceSlowMorphAdjustedReset(play, this, &gPlayerAnim_link_normal_give_other); this->stateFlags2 &= ~PLAYER_STATE2_1000000; } @@ -20319,7 +20336,7 @@ void Player_Cutscene_8085ABA8(Player* this, CsCmdActorCue* cue) { } this->skelAnime.moveFlags = 0; - func_8082E784(this); + Player_Anim_ZeroModelYaw(this); } void func_8085AC9C(PlayState* play, Player* this, CsCmdActorCue* cue, PlayerCsActionEntry* csEntry) { @@ -20330,7 +20347,7 @@ void func_8085AC9C(PlayState* play, Player* this, CsCmdActorCue* cue, PlayerCsAc } if ((D_80862B6C & 4) && !(this->skelAnime.moveFlags & ANIM_FLAG_4)) { - this->skelAnime.morphTable[PLAYER_LIMB_ROOT - 1].y /= this->ageProperties->unk_08; + this->skelAnime.morphTable[LIMB_ROOT_POS].y /= this->ageProperties->unk_08; D_80862B6C = 0; } } @@ -20397,7 +20414,7 @@ void Player_CsAction_48(PlayState* play, Player* this, CsCmdActorCue* cue) { D_80862B6C = this->skelAnime.moveFlags; - func_8082E794(this); + Player_Anim_ResetMove(this); func_8085AD5C(play, this, ABS_ALT(csAction)); func_8085AC9C(play, this, playerCue, &sPlayerCsActionInitFuncs[ABS_ALT(csAction)]); @@ -20418,7 +20435,7 @@ void Player_CsAction_48(PlayState* play, Player* this, CsCmdActorCue* cue) { void Player_Action_CsAction(Player* this, PlayState* play) { if (this->csAction != this->prevCsAction) { D_80862B6C = this->skelAnime.moveFlags; - func_8082E794(this); + Player_Anim_ResetMove(this); this->prevCsAction = this->csAction; func_8085AD5C(play, this, this->csAction); @@ -20440,7 +20457,7 @@ s32 Player_StartFishing(PlayState* play) { void func_8085B170(PlayState* play, Player* this) { func_8082DE50(play, this); Player_SetAction(play, this, Player_Action_72, 0); - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_normal_re_dead_attack); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_normal_re_dead_attack); this->stateFlags2 |= PLAYER_STATE2_80; func_8082DAD4(this); Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_HELD); @@ -20495,7 +20512,7 @@ s32 Player_TryCsAction(PlayState* play, Player* this, PlayerCsAction csAction) { void func_8085B384(Player* this, PlayState* play) { Player_SetAction(play, this, Player_Action_4, 1); - func_8082E438(play, this, func_8082ED20(this)); + Player_Anim_PlayOnceMorph(play, this, func_8082ED20(this)); this->currentYaw = this->actor.shape.rot.y; } @@ -20551,27 +20568,27 @@ void Player_TalkWithPlayer(PlayState* play, Actor* actor) { } else { if (func_801242B4(player)) { func_80832558(play, player, func_80837B60); - func_8082E634(play, player, &gPlayerAnim_link_swimer_swim_wait); + Player_Anim_PlayLoopSlowMorph(play, player, &gPlayerAnim_link_swimer_swim_wait); } else if ((actor->category != ACTORCAT_NPC) || (player->heldItemAction == PLAYER_IA_FISHING_ROD)) { func_80837B60(play, player); if (!func_80123420(player)) { if ((actor != player->tatlActor) && (actor->xzDistToPlayer < (actor->colChkInfo.cylRadius + 40))) { - func_8082DB90(play, player, &gPlayerAnim_link_normal_backspace); + Player_Anim_PlayOnceAdjusted(play, player, &gPlayerAnim_link_normal_backspace); } else { - Player_AnimationPlayLoop(play, player, func_8082ED20(player)); + Player_Anim_PlayLoop(play, player, func_8082ED20(player)); } } } else { func_80832558(play, player, func_80837B60); - func_8082DB90(play, player, - (actor->xzDistToPlayer < (actor->colChkInfo.cylRadius + 40)) - ? &gPlayerAnim_link_normal_backspace - : &gPlayerAnim_link_normal_talk_free); + Player_Anim_PlayOnceAdjusted(play, player, + (actor->xzDistToPlayer < (actor->colChkInfo.cylRadius + 40)) + ? &gPlayerAnim_link_normal_backspace + : &gPlayerAnim_link_normal_talk_free); } if (player->skelAnime.animation == &gPlayerAnim_link_normal_backspace) { - func_8082E920(play, player, ANIM_FLAG_1 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE); + Player_AnimReplace_Setup(play, player, ANIM_FLAG_1 | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE); } func_8082DAD4(player); } @@ -20632,7 +20649,7 @@ PlayerItemAction func_8085B854(PlayState* play, Player* this, ItemId itemId) { Player_SetAction_PreserveItemAction(play, this, Player_Action_71, 0); this->csId = CS_ID_GLOBAL_TALK; this->itemAction = itemAction; - Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_normal_give_other); + Player_Anim_PlayOnce(play, this, &gPlayerAnim_link_normal_give_other); this->stateFlags1 |= (PLAYER_STATE1_40 | PLAYER_STATE1_20000000); this->getItemDrawIdPlusOne = GID_NONE + 1; this->exchangeItemAction = itemAction; @@ -20647,7 +20664,7 @@ s32 func_8085B930(PlayState* play, PlayerAnimationHeader* talkAnim, AnimationMod return false; } - PlayerAnimation_Change(play, &player->skelAnime, (talkAnim == NULL) ? func_8082ED20(player) : talkAnim, 2.0f / 3.0f, - 0.0f, Animation_GetLastFrame(talkAnim), animMode, -6.0f); + PlayerAnimation_Change(play, &player->skelAnime, (talkAnim == NULL) ? func_8082ED20(player) : talkAnim, + PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, Animation_GetLastFrame(talkAnim), animMode, -6.0f); return true; } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 8829bc6a0e..d4b5c05ff2 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -4248,12 +4248,12 @@ 0x8082DABC:("Player_StopHorizontalMovement",), 0x8082DAD4:("func_8082DAD4",), 0x8082DAFC:("func_8082DAFC",), - 0x8082DB18:("Player_AnimationPlayOnce",), - 0x8082DB3C:("Player_AnimationPlayLoop",), - 0x8082DB60:("func_8082DB60",), - 0x8082DB90:("func_8082DB90",), - 0x8082DBC0:("Player_AnimationPlayOnceReverse",), - 0x8082DC28:("func_8082DC28",), + 0x8082DB18:("Player_Anim_PlayOnce",), + 0x8082DB3C:("Player_Anim_PlayLoop",), + 0x8082DB60:("Player_Anim_PlayLoopAdjusted",), + 0x8082DB90:("Player_Anim_PlayOnceAdjusted",), + 0x8082DBC0:("Player_Anim_PlayOnceAdjustedReverse",), + 0x8082DC28:("Player_Anim_ResetModelRotY",), 0x8082DC38:("func_8082DC38",), 0x8082DC64:("func_8082DC64",), 0x8082DCA0:("Player_DetachHeldActor",), @@ -4274,30 +4274,30 @@ 0x8082E1BC:("Player_AnimSfx_PlayFloorLand",), 0x8082E1F0:("func_8082E1F0",), 0x8082E224:("Player_PlayAnimSfx",), - 0x8082E438:("func_8082E438",), - 0x8082E4A4:("func_8082E4A4",), - 0x8082E514:("func_8082E514",), - 0x8082E55C:("func_8082E55C",), - 0x8082E5A8:("func_8082E5A8",), - 0x8082E5EC:("func_8082E5EC",), - 0x8082E634:("func_8082E634",), - 0x8082E67C:("func_8082E67C",), - 0x8082E6D0:("func_8082E6D0",), - 0x8082E6F8:("func_8082E6F8",), - 0x8082E784:("func_8082E784",), - 0x8082E794:("func_8082E794",), - 0x8082E820:("func_8082E820",), - 0x8082E920:("func_8082E920",), - 0x8082E9C8:("func_8082E9C8",), - 0x8082EA10:("func_8082EA10",), - 0x8082EA38:("func_8082EA38",), - 0x8082EA60:("func_8082EA60",), - 0x8082EA80:("func_8082EA80",), - 0x8082EAC8:("func_8082EAC8",), - 0x8082EAF0:("func_8082EAF0",), - 0x8082EB18:("func_8082EB18",), + 0x8082E438:("Player_Anim_PlayOnceMorph",), + 0x8082E4A4:("Player_Anim_PlayOnceMorphAdjusted",), + 0x8082E514:("Player_Anim_PlayLoopMorph",), + 0x8082E55C:("Player_Anim_PlayLoopMorphAdjusted",), + 0x8082E5A8:("Player_Anim_PlayOnceFreeze",), + 0x8082E5EC:("Player_Anim_PlayOnceFreezeAdjusted",), + 0x8082E634:("Player_Anim_PlayLoopSlowMorph",), + 0x8082E67C:("Player_Anim_PlayLoopOnceFinished",), + 0x8082E6D0:("Player_Anim_ResetPrevTranslRot",), + 0x8082E6F8:("Player_Anim_ResetPrevTranslRotFormScale",), + 0x8082E784:("Player_Anim_ZeroModelYaw",), + 0x8082E794:("Player_Anim_ResetMove",), + 0x8082E820:("Player_AnimReplace_SetupLedgeClimb",), + 0x8082E920:("Player_AnimReplace_Setup",), + 0x8082E9C8:("Player_AnimReplace_PlayOnceSetSpeed",), + 0x8082EA10:("Player_AnimReplace_PlayOnce",), + 0x8082EA38:("Player_AnimReplace_PlayOnceAdjusted",), + 0x8082EA60:("Player_AnimReplace_PlayOnceNormalAdjusted",), + 0x8082EA80:("Player_AnimReplace_PlayLoopSetSpeed",), + 0x8082EAC8:("Player_AnimReplace_PlayLoop",), + 0x8082EAF0:("Player_AnimReplace_PlayLoopAdjusted",), + 0x8082EB18:("Player_AnimReplace_PlayLoopNormalAdjusted",), 0x8082EB38:("Player_ProcessControlStick",), - 0x8082EC9C:("func_8082EC9C",), + 0x8082EC9C:("Player_Anim_PlayOnceWaterAdjustment",), 0x8082ECCC:("func_8082ECCC",), 0x8082ECE0:("func_8082ECE0",), 0x8082ED20:("func_8082ED20",), @@ -4793,29 +4793,29 @@ 0x80857A44:("func_80857A44",), 0x80857AEC:("func_80857AEC",), 0x80857BE8:("Player_Action_96",), - 0x80858C84:("func_80858C84",), - 0x80858CC8:("func_80858CC8",), - 0x80858D48:("func_80858D48",), - 0x80858DB4:("Player_CsAnim_1",), - 0x80858DDC:("Player_CsAnim_2",), - 0x80858DFC:("Player_CsAnim_14",), - 0x80858E40:("Player_CsAnim_3",), - 0x80858E60:("Player_CsAnim_4",), - 0x80858E80:("Player_CsAnim_5",), - 0x80858EA0:("Player_CsAnim_6",), - 0x80858EC0:("Player_CsAnim_19",), - 0x80858EFC:("Player_CsAnim_7",), - 0x80858F1C:("Player_CsAnim_8",), - 0x80858F3C:("Player_CsAnim_9",), - 0x80858F5C:("Player_CsAnim_10",), - 0x80858F7C:("Player_CsAnim_15",), - 0x80858F9C:("Player_CsAnim_16",), - 0x80858FBC:("Player_CsAnim_11",), - 0x80858FE8:("func_80858FE8",), - 0x80859028:("Player_CsAnim_12",), - 0x80859168:("Player_CsAnim_17",), - 0x808591BC:("Player_CsAnim_13",), - 0x80859210:("Player_CsAnim_18",), + 0x80858C84:("Player_CsAnimHelper_PlayOnceMorphReset",), + 0x80858CC8:("Player_CsAnimHelper_PlayOnceSlowMorphAdjustedReset",), + 0x80858D48:("Player_CsAnimHelper_PlayLoopSlowMorphAdjustedReset",), + 0x80858DB4:("Player_CsAnim_StopHorizontalMovement",), + 0x80858DDC:("Player_CsAnim_PlayOnceMorphReset",), + 0x80858DFC:("Player_CsAnim_PlayOnceFreezeReset",), + 0x80858E40:("Player_CsAnim_PlayOnceSlowMorphAdjustedReset",), + 0x80858E60:("Player_CsAnim_PlayLoopSlowMorphAdjustedReset",), + 0x80858E80:("Player_CsAnim_ReplacePlayOnceNormalAdjusted",), + 0x80858EA0:("Player_CsAnim_ReplacePlayOnce",), + 0x80858EC0:("Player_CsAnim_ReplacePlayOnceAdjustedReverse",), + 0x80858EFC:("Player_CsAnim_ReplacePlayLoopNormalAdjusted",), + 0x80858F1C:("Player_CsAnim_ReplacePlayLoop",), + 0x80858F3C:("Player_CsAnim_PlayOnce",), + 0x80858F5C:("Player_CsAnim_PlayLoop",), + 0x80858F7C:("Player_CsAnim_PlayOnceAdjusted",), + 0x80858F9C:("Player_CsAnim_PlayLoopAdjusted",), + 0x80858FBC:("Player_CsAnim_Update",), + 0x80858FE8:("Player_CsAnimHelper_PlayAnimSfxLostHorse",), + 0x80859028:("Player_CsAnim_PlayLoopAdjustedSlowMorphAnimSfxReset",), + 0x80859168:("Player_CsAnim_PlayLoopAdjustedOnceFinished",), + 0x808591BC:("Player_CsAnim_PlayLoopNormalAdjustedOnceFinished",), + 0x80859210:("Player_CsAnim_PlayAnimSfx",), 0x80859248:("func_80859248",), 0x8085929C:("func_8085929C",), 0x80859300:("func_80859300",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 30490c0d6c..f0d079f396 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -4889,7 +4889,7 @@ 0x8085C318:("D_8085C318","UNK_TYPE1","",0x1), 0x8085C344:("D_8085C344","UNK_TYPE1","",0x1), 0x8085C394:("D_8085C394","UNK_TYPE1","",0x1), - 0x8085C3E4:("D_8085C3E4","f32","",0x4), + 0x8085C3E4:("sPlayerWaterSpeedScale","f32","",0x4), 0x8085C3E8:("D_8085C3E8","f32","",0x4), 0x8085C3EC:("D_8085C3EC","UNK_TYPE2","",0x2), 0x8085C3F4:("sGetItemTable","GetItemEntry","[0xB9]",0x456), diff --git a/tools/namefixer.py b/tools/namefixer.py index 65ce238464..c655e84687 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -987,7 +987,7 @@ wordReplace = { "skelAnime.transitionStep": "skelAnime.morphRate", "skelAnime.animUpdate": "skelAnime.update", "skelAnime.flags": "skelAnime.moveFlags", - "skelAnime.prevFrameRot": "skelAnime.prevRot", + "skelAnime.prevFrameRot": "skelAnime.prevYaw", "skelAnime.prevFramePos": "skelAnime.prevTransl", "skelAnime.unk3E": "skelAnime.baseTransl", "actor.unk20": "actor.halfDaysBits",