Reduce tail speed if out of water (e.g., flying)

This commit is contained in:
NullBite 2022-03-25 10:10:50 -04:00
parent 4445c2e370
commit 25759bc004
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -845,7 +845,9 @@ function animateTick()
if aquaticTailVisible() then
old_state.anim_cycle=anim_cycle
local player_speed = math.sqrt(velocity.x^2 + velocity.y^2 + velocity.z^2)
anim_cycle=anim_cycle + (player_speed*5+0.75)
local animation=player.getAnimation()
local factor=(not player.isTouchingWater() and (animation=="FALL_FLYING" or animation=="SPIN_ATTACK")) and 0.5 or 5
anim_cycle=anim_cycle + (player_speed*factor+0.75)
-- bubble animation would go here but i don't have that (yet)
end