Handle marksmen weapon attack sequences

This commit is contained in:
Chris Robinson 2013-07-23 06:13:08 -07:00
parent fecb8c1cc4
commit 4d157cb19a

View file

@ -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",