Faster Swim animations, full credit to kimimaru4000

Co-authored-by: kimimaru4000 <kimimaru@posteo.net>
This commit is contained in:
Pepper0ni
2023-10-20 12:28:37 +01:00
parent 35b4357776
commit b294188782
3 changed files with 16 additions and 3 deletions
@@ -5827,9 +5827,19 @@ s32 func_8083D12C(PlayState* play, Player* this, Input* arg2) {
}
func_80832340(play, this);
func_80832B0C(play, this,
(this->stateFlags1 & PLAYER_STATE1_ITEM_OVER_HEAD) ? &gPlayerAnim_link_swimer_swim_get
: &gPlayerAnim_link_swimer_swim_deep_end);
// Skip take breath animation on surface if Link didn't grab an item while underwater and the setting is enabled
if (CVarGetInteger("gSkipSwimDeepEndAnim", 0) && !(this->stateFlags1 & PLAYER_STATE1_ITEM_OVER_HEAD))
{
auto lastAnimFrame = Animation_GetLastFrame(&gPlayerAnim_link_swimer_swim_deep_end);
LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_swimer_swim_deep_end, 1.0f,
lastAnimFrame, lastAnimFrame, ANIMMODE_ONCE, -6.0f);
}
else
{
func_80832B0C(play, this,
(this->stateFlags1 & PLAYER_STATE1_ITEM_OVER_HEAD) ? &gPlayerAnim_link_swimer_swim_get
: &gPlayerAnim_link_swimer_swim_deep_end);
}
if (func_8083CFA8(play, this, this->actor.velocity.y, 500)) {
Player_PlaySfx(&this->actor, NA_SE_PL_FACE_UP);