mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 03:53:52 +00:00
activate whole-body attack animations
This commit is contained in:
parent
b85a4dd35e
commit
761f13d3ce
2 changed files with 25 additions and 3 deletions
|
@ -781,6 +781,13 @@ bool CharacterController::updateWeaponState()
|
||||||
stop = mAttackType+" max attack";
|
stop = mAttackType+" max attack";
|
||||||
mUpperBodyState = UpperCharState_MinAttackToMaxAttack;
|
mUpperBodyState = UpperCharState_MinAttackToMaxAttack;
|
||||||
break;
|
break;
|
||||||
|
case UpperCharState_MinAttackToMaxAttack:
|
||||||
|
//hack to avoid body pos desync when jumping/sneaking in 'max attack' state
|
||||||
|
if(!mAnimation->isPlaying(mCurrentWeapon))
|
||||||
|
mAnimation->play(mCurrentWeapon, Priority_Weapon,
|
||||||
|
MWRender::Animation::Group_UpperBody, false,
|
||||||
|
0, mAttackType+" min attack", mAttackType+" max attack", 0.999f, 0);
|
||||||
|
break;
|
||||||
case UpperCharState_MaxAttackToMinHit:
|
case UpperCharState_MaxAttackToMinHit:
|
||||||
if(mAttackType == "shoot")
|
if(mAttackType == "shoot")
|
||||||
{
|
{
|
||||||
|
@ -830,6 +837,22 @@ bool CharacterController::updateWeaponState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if playing combat animation and lowerbody is not busy switch to whole body animation
|
||||||
|
if((weaptype != WeapType_None || UpperCharState_UnEquipingWeap) && animPlaying)
|
||||||
|
{
|
||||||
|
if( mMovementState != CharState_None ||
|
||||||
|
mJumpState != JumpState_None ||
|
||||||
|
mHitState != CharState_None ||
|
||||||
|
MWBase::Environment::get().getWorld()->isSwimming(mPtr) ||
|
||||||
|
cls.getCreatureStats(mPtr).getMovementFlag(CreatureStats::Flag_Sneak))
|
||||||
|
{
|
||||||
|
mAnimation->changeGroups(mCurrentWeapon, MWRender::Animation::Group_UpperBody);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mAnimation->changeGroups(mCurrentWeapon, MWRender::Animation::Group_All);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MWWorld::ContainerStoreIterator torch = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
MWWorld::ContainerStoreIterator torch = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
||||||
if(torch != inv.end() && torch->getTypeName() == typeid(ESM::Light).name()
|
if(torch != inv.end() && torch->getTypeName() == typeid(ESM::Light).name()
|
||||||
|
|
|
@ -1050,9 +1050,8 @@ bool Animation::allowSwitchViewMode() const
|
||||||
{
|
{
|
||||||
for (AnimStateMap::const_iterator stateiter = mStates.begin(); stateiter != mStates.end(); ++stateiter)
|
for (AnimStateMap::const_iterator stateiter = mStates.begin(); stateiter != mStates.end(); ++stateiter)
|
||||||
{
|
{
|
||||||
if(stateiter->second.mGroups == Group_UpperBody
|
if(stateiter->second.mPriority > MWMechanics::Priority_Movement
|
||||||
|| (stateiter->first.size()==4 && stateiter->first.find("hit") != std::string::npos)
|
&& stateiter->second.mPriority < MWMechanics::Priority_Torch)
|
||||||
|| (stateiter->first.find("knock") != std::string::npos) )
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue