mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 10:53:51 +00:00
simplification + taking into account weapon speed. Seems too fast, but i'm not sure
This commit is contained in:
parent
8fc6e73649
commit
20341ae8b7
1 changed files with 33 additions and 43 deletions
|
@ -528,53 +528,43 @@ void CharacterController::update(float duration, Movement &movement)
|
|||
}
|
||||
}
|
||||
|
||||
if(cls.getCreatureStats(mPtr).getAttackingOrSpell())
|
||||
{
|
||||
if(mUpperBodyState == UpperCharState_WeapEquiped)
|
||||
{
|
||||
std::cout << "ATTaquiomg \n";
|
||||
std::string weapgroup;
|
||||
getWeaponGroup(mWeaponType, weapgroup);
|
||||
mAnimation->play(weapgroup, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
1.0f,"chop start", "chop min attack", 0.0f, 0);
|
||||
mUpperBodyState = UpperCharState_ChopStartToMinAttack;
|
||||
}
|
||||
}
|
||||
else if(mUpperBodyState == UpperCharState_ChopMinAttackToMaxAttack)
|
||||
{
|
||||
std::cout << "OMG \n";
|
||||
std::string weapgroup;
|
||||
getWeaponGroup(mWeaponType, weapgroup);
|
||||
std::string start;
|
||||
std::string stop;
|
||||
float complete;
|
||||
float speedMult;
|
||||
//mAnimation->
|
||||
if(mAnimation->getInfo(weapgroup,&complete,&speedMult,&start,&stop))
|
||||
{
|
||||
std::cout << "BLABLABLA";
|
||||
mAnimation->disable(weapgroup);
|
||||
mAnimation->play(weapgroup, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
1.0f,"chop max attack", "chop min hit", 1-complete, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
mAnimation->play(weapgroup, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
1.0f,"chop max attack", "chop min hit", 0, 0);
|
||||
}
|
||||
mUpperBodyState = UpperCharState_ChopMaxAttackToMinHit;
|
||||
}
|
||||
|
||||
std::string weapgroup;
|
||||
getWeaponGroup(mWeaponType, weapgroup);
|
||||
float weapSpeed = 1;
|
||||
if(weapon != inv.end()) {weapSpeed = weapon->get<ESM::Weapon>()->mBase->mData.mSpeed;std::cout << "setspeed "<< weapSpeed<< "\n";}
|
||||
std::string start;
|
||||
std::string stop;
|
||||
float complete;
|
||||
float speedMult;
|
||||
bool animPlaying = mAnimation->getInfo(weapgroup,&complete,&speedMult,&start,&stop);
|
||||
if(cls.getCreatureStats(mPtr).getAttackingOrSpell())
|
||||
{
|
||||
if(mUpperBodyState == UpperCharState_WeapEquiped)
|
||||
{
|
||||
mAnimation->play(weapgroup, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
weapSpeed,"chop start", "chop min attack", 0.0f, 0);
|
||||
mUpperBodyState = UpperCharState_ChopStartToMinAttack;
|
||||
}
|
||||
}
|
||||
else if(mUpperBodyState == UpperCharState_ChopMinAttackToMaxAttack)
|
||||
{
|
||||
if(animPlaying)
|
||||
{
|
||||
mAnimation->disable(weapgroup);
|
||||
mAnimation->play(weapgroup, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
weapSpeed,"chop max attack", "chop min hit", 1-complete, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
mAnimation->play(weapgroup, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
weapSpeed,"chop max attack", "chop min hit", 0, 0);
|
||||
}
|
||||
mUpperBodyState = UpperCharState_ChopMaxAttackToMinHit;
|
||||
}
|
||||
|
||||
if(mUpperBodyState == UpperCharState_EquipingWeap && !animPlaying) mUpperBodyState = UpperCharState_WeapEquiped;
|
||||
if(mUpperBodyState == UpperCharState_UnEquipingWeap && !animPlaying) mUpperBodyState = UpperCharState_Nothing;
|
||||
if(animPlaying)
|
||||
|
@ -584,7 +574,7 @@ void CharacterController::update(float duration, Movement &movement)
|
|||
mAnimation->disable(weapgroup);
|
||||
mAnimation->play(weapgroup, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
1.0f,"chop min attack", "chop max attack",0, 0);
|
||||
weapSpeed,"chop min attack", "chop max attack",0, 0);
|
||||
mUpperBodyState = UpperCharState_ChopMinAttackToMaxAttack;
|
||||
}
|
||||
else if(mUpperBodyState == UpperCharState_ChopMaxAttackToMinHit && complete == 1)
|
||||
|
@ -592,7 +582,7 @@ void CharacterController::update(float duration, Movement &movement)
|
|||
mAnimation->disable(weapgroup);
|
||||
mAnimation->play(weapgroup, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
1.0f,"chop min hit", "chop hit",0, 0);
|
||||
weapSpeed,"chop min hit", "chop hit",0, 0);
|
||||
mUpperBodyState = UpperCharState_ChopMinHitToHit;
|
||||
}
|
||||
else if(mUpperBodyState == UpperCharState_ChopMinHitToHit && complete == 1)
|
||||
|
@ -600,7 +590,7 @@ void CharacterController::update(float duration, Movement &movement)
|
|||
mAnimation->disable(weapgroup);
|
||||
mAnimation->play(weapgroup, Priority_Weapon,
|
||||
MWRender::Animation::Group_UpperBody, false,
|
||||
1.0f,"chop large follow start", "chop large follow stop",0, 0);
|
||||
weapSpeed,"chop large follow start", "chop large follow stop",0, 0);
|
||||
mUpperBodyState = UpperCharState_ChopLargeFollowStartToLargeFollowStop;
|
||||
}
|
||||
else if(mUpperBodyState == UpperCharState_ChopLargeFollowStartToLargeFollowStop && complete == 1)
|
||||
|
|
Loading…
Reference in a new issue