forked from teamnwah/openmw-tes3coop
Implement SwimHit animation
This commit is contained in:
parent
3eb1308c0d
commit
1c6cfad3cc
2 changed files with 22 additions and 4 deletions
|
@ -283,7 +283,16 @@ void CharacterController::refreshHitRecoilAnims()
|
||||||
}
|
}
|
||||||
else if (recovery)
|
else if (recovery)
|
||||||
{
|
{
|
||||||
std::string anim = chooseRandomGroup("hit");
|
std::string anim = isSwimming ? chooseRandomGroup("swimhit") : chooseRandomGroup("hit");
|
||||||
|
if (isSwimming && mAnimation->hasAnimation(anim))
|
||||||
|
{
|
||||||
|
mHitState = CharState_SwimHit;
|
||||||
|
mCurrentHit = anim;
|
||||||
|
mAnimation->play(mCurrentHit, Priority_Hit, MWRender::Animation::BlendMask_All, true, 1, "start", "stop", 0.0f, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
anim = chooseRandomGroup("hit");
|
||||||
if (mAnimation->hasAnimation(anim))
|
if (mAnimation->hasAnimation(anim))
|
||||||
{
|
{
|
||||||
mHitState = CharState_Hit;
|
mHitState = CharState_Hit;
|
||||||
|
@ -291,6 +300,7 @@ void CharacterController::refreshHitRecoilAnims()
|
||||||
mAnimation->play(mCurrentHit, Priority_Hit, MWRender::Animation::BlendMask_All, true, 1, "start", "stop", 0.0f, 0);
|
mAnimation->play(mCurrentHit, Priority_Hit, MWRender::Animation::BlendMask_All, true, 1, "start", "stop", 0.0f, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (block && mAnimation->hasAnimation("shield"))
|
else if (block && mAnimation->hasAnimation("shield"))
|
||||||
{
|
{
|
||||||
mHitState = CharState_Block;
|
mHitState = CharState_Block;
|
||||||
|
@ -1157,7 +1167,7 @@ bool CharacterController::updateWeaponState()
|
||||||
mWeaponType > WeapType_HandToHand && mWeaponType < WeapType_Spell;
|
mWeaponType > WeapType_HandToHand && mWeaponType < WeapType_Spell;
|
||||||
|
|
||||||
if(weaptype != mWeaponType && !isKnockedOut() &&
|
if(weaptype != mWeaponType && !isKnockedOut() &&
|
||||||
!isKnockedDown() && mHitState != CharState_Hit)
|
!isKnockedDown() && !isRecovery())
|
||||||
{
|
{
|
||||||
forcestateupdate = true;
|
forcestateupdate = true;
|
||||||
|
|
||||||
|
@ -2267,6 +2277,12 @@ bool CharacterController::isKnockedOut() const
|
||||||
mHitState == CharState_SwimKnockOut;
|
mHitState == CharState_SwimKnockOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CharacterController::isRecovery() const
|
||||||
|
{
|
||||||
|
return mHitState == CharState_Hit ||
|
||||||
|
mHitState == CharState_SwimHit;
|
||||||
|
}
|
||||||
|
|
||||||
bool CharacterController::isAttackingOrSpell() const
|
bool CharacterController::isAttackingOrSpell() const
|
||||||
{
|
{
|
||||||
return mUpperBodyState != UpperCharState_Nothing &&
|
return mUpperBodyState != UpperCharState_Nothing &&
|
||||||
|
|
|
@ -103,6 +103,7 @@ enum CharacterState {
|
||||||
CharState_DeathKnockOut,
|
CharState_DeathKnockOut,
|
||||||
|
|
||||||
CharState_Hit,
|
CharState_Hit,
|
||||||
|
CharState_SwimHit,
|
||||||
CharState_KnockDown,
|
CharState_KnockDown,
|
||||||
CharState_KnockOut,
|
CharState_KnockOut,
|
||||||
CharState_SwimKnockDown,
|
CharState_SwimKnockDown,
|
||||||
|
@ -271,6 +272,7 @@ public:
|
||||||
bool isReadyToBlock() const;
|
bool isReadyToBlock() const;
|
||||||
bool isKnockedDown() const;
|
bool isKnockedDown() const;
|
||||||
bool isKnockedOut() const;
|
bool isKnockedOut() const;
|
||||||
|
bool isRecovery() const;
|
||||||
bool isSneaking() const;
|
bool isSneaking() const;
|
||||||
bool isRunning() const;
|
bool isRunning() const;
|
||||||
bool isAttackingOrSpell() const;
|
bool isAttackingOrSpell() const;
|
||||||
|
|
Loading…
Reference in a new issue