mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
Merge pull request #3058 from akortunov/master
Rework knockdown and knockout animations fallbacks
This commit is contained in:
commit
d835204fdf
1 changed files with 18 additions and 8 deletions
|
@ -211,38 +211,48 @@ void CharacterController::refreshHitRecoilAnims(CharacterState& idle)
|
||||||
if(mHitState == CharState_None)
|
if(mHitState == CharState_None)
|
||||||
{
|
{
|
||||||
if ((mPtr.getClass().getCreatureStats(mPtr).getFatigue().getCurrent() < 0
|
if ((mPtr.getClass().getCreatureStats(mPtr).getFatigue().getCurrent() < 0
|
||||||
|| mPtr.getClass().getCreatureStats(mPtr).getFatigue().getBase() == 0)
|
|| mPtr.getClass().getCreatureStats(mPtr).getFatigue().getBase() == 0))
|
||||||
&& mAnimation->hasAnimation("knockout"))
|
|
||||||
{
|
{
|
||||||
mTimeUntilWake = Misc::Rng::rollClosedProbability() * 2 + 1; // Wake up after 1 to 3 seconds
|
mTimeUntilWake = Misc::Rng::rollClosedProbability() * 2 + 1; // Wake up after 1 to 3 seconds
|
||||||
if (isSwimming && mAnimation->hasAnimation("swimknockout"))
|
if (isSwimming && mAnimation->hasAnimation("swimknockout"))
|
||||||
{
|
{
|
||||||
mHitState = CharState_SwimKnockOut;
|
mHitState = CharState_SwimKnockOut;
|
||||||
mCurrentHit = "swimknockout";
|
mCurrentHit = "swimknockout";
|
||||||
|
mAnimation->play(mCurrentHit, Priority_Knockdown, MWRender::Animation::BlendMask_All, false, 1, "start", "stop", 0.0f, ~0ul);
|
||||||
}
|
}
|
||||||
else
|
else if (!isSwimming && mAnimation->hasAnimation("knockout"))
|
||||||
{
|
{
|
||||||
mHitState = CharState_KnockOut;
|
mHitState = CharState_KnockOut;
|
||||||
mCurrentHit = "knockout";
|
mCurrentHit = "knockout";
|
||||||
|
mAnimation->play(mCurrentHit, Priority_Knockdown, MWRender::Animation::BlendMask_All, false, 1, "start", "stop", 0.0f, ~0ul);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Knockout animations are missing. Fall back to idle animation, so target actor still can be killed via HtH.
|
||||||
|
mCurrentHit.erase();
|
||||||
}
|
}
|
||||||
|
|
||||||
mAnimation->play(mCurrentHit, Priority_Knockdown, MWRender::Animation::BlendMask_All, false, 1, "start", "stop", 0.0f, ~0ul);
|
|
||||||
mPtr.getClass().getCreatureStats(mPtr).setKnockedDown(true);
|
mPtr.getClass().getCreatureStats(mPtr).setKnockedDown(true);
|
||||||
}
|
}
|
||||||
else if(knockdown && mAnimation->hasAnimation("knockdown"))
|
else if (knockdown)
|
||||||
{
|
{
|
||||||
if (isSwimming && mAnimation->hasAnimation("swimknockdown"))
|
if (isSwimming && mAnimation->hasAnimation("swimknockdown"))
|
||||||
{
|
{
|
||||||
mHitState = CharState_SwimKnockDown;
|
mHitState = CharState_SwimKnockDown;
|
||||||
mCurrentHit = "swimknockdown";
|
mCurrentHit = "swimknockdown";
|
||||||
|
mAnimation->play(mCurrentHit, Priority_Knockdown, MWRender::Animation::BlendMask_All, true, 1, "start", "stop", 0.0f, 0);
|
||||||
}
|
}
|
||||||
else
|
else if (!isSwimming && mAnimation->hasAnimation("knockdown"))
|
||||||
{
|
{
|
||||||
mHitState = CharState_KnockDown;
|
mHitState = CharState_KnockDown;
|
||||||
mCurrentHit = "knockdown";
|
mCurrentHit = "knockdown";
|
||||||
|
mAnimation->play(mCurrentHit, Priority_Knockdown, MWRender::Animation::BlendMask_All, true, 1, "start", "stop", 0.0f, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Knockdown animation is missing. Cancel knockdown state.
|
||||||
|
mPtr.getClass().getCreatureStats(mPtr).setKnockedDown(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
mAnimation->play(mCurrentHit, Priority_Knockdown, MWRender::Animation::BlendMask_All, true, 1, "start", "stop", 0.0f, 0);
|
|
||||||
}
|
}
|
||||||
else if (recovery)
|
else if (recovery)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue