forked from teamnwah/openmw-tes3coop
Handle marksmen weapon attack sequences
This commit is contained in:
parent
fecb8c1cc4
commit
4d157cb19a
1 changed files with 36 additions and 20 deletions
|
@ -413,9 +413,12 @@ bool CharacterController::updateNpcState()
|
|||
|
||||
if(cls.getCreatureStats(mPtr).getAttackingOrSpell())
|
||||
{
|
||||
if(mUpperBodyState == UpperCharState_WeapEquiped && mWeaponType != WeapType_Crossbow &&
|
||||
mWeaponType != WeapType_BowAndArrow && mWeaponType != WeapType_ThowWeapon &&
|
||||
mWeaponType != WeapType_PickProbe)
|
||||
if(mUpperBodyState == UpperCharState_WeapEquiped && mWeaponType != WeapType_PickProbe)
|
||||
{
|
||||
if(mWeaponType == WeapType_Crossbow || mWeaponType == WeapType_BowAndArrow ||
|
||||
mWeaponType == WeapType_ThowWeapon)
|
||||
mAttackType = "shoot";
|
||||
else
|
||||
{
|
||||
int attackType = cls.getCreatureStats(mPtr).getAttackType();
|
||||
if(isWeapon && Settings::Manager::getBool("best attack", "Game"))
|
||||
|
@ -427,6 +430,7 @@ bool CharacterController::updateNpcState()
|
|||
mAttackType = "slash";
|
||||
else
|
||||
mAttackType = "thrust";
|
||||
}
|
||||
|
||||
mAnimation->play(mCurrentWeapon, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
|
@ -467,6 +471,12 @@ bool CharacterController::updateNpcState()
|
|||
else if(mUpperBodyState == UpperCharState_MaxAttackToMinHit)
|
||||
{
|
||||
mAnimation->disable(mCurrentWeapon);
|
||||
if(mAttackType == "shoot")
|
||||
mAnimation->play(mCurrentWeapon, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
weapSpeed, mAttackType+" min hit", mAttackType+" follow start",
|
||||
0.0f, 0);
|
||||
else
|
||||
mAnimation->play(mCurrentWeapon, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
weapSpeed, mAttackType+" min hit", mAttackType+" hit",
|
||||
|
@ -476,6 +486,12 @@ bool CharacterController::updateNpcState()
|
|||
else if(mUpperBodyState == UpperCharState_MinHitToHit)
|
||||
{
|
||||
mAnimation->disable(mCurrentWeapon);
|
||||
if(mAttackType == "shoot")
|
||||
mAnimation->play(mCurrentWeapon, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, true,
|
||||
weapSpeed, mAttackType+" follow start", mAttackType+" follow stop",
|
||||
0.0f, 0);
|
||||
else
|
||||
mAnimation->play(mCurrentWeapon, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, true,
|
||||
weapSpeed, mAttackType+" large follow start", mAttackType+" large follow stop",
|
||||
|
|
Loading…
Reference in a new issue