|
|
|
@ -238,10 +238,7 @@ std::string CharacterController::chooseRandomGroup (const std::string& prefix, i
|
|
|
|
|
return prefix + toString(roll);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterState movement, JumpingState jump, bool force)
|
|
|
|
|
{
|
|
|
|
|
// hit recoils/knockdown animations handling
|
|
|
|
|
if(mPtr.getClass().isActor())
|
|
|
|
|
void CharacterController::refreshHitRecoilAnims()
|
|
|
|
|
{
|
|
|
|
|
bool recovery = mPtr.getClass().getCreatureStats(mPtr).getHitRecovery();
|
|
|
|
|
bool knockdown = mPtr.getClass().getCreatureStats(mPtr).getKnockedDown();
|
|
|
|
@ -316,10 +313,8 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const WeaponInfo *weap = std::find_if(sWeaponTypeList, sWeaponTypeListEnd, FindWeaponType(mWeaponType));
|
|
|
|
|
if (!mPtr.getClass().isBipedal(mPtr))
|
|
|
|
|
weap = sWeaponTypeListEnd;
|
|
|
|
|
|
|
|
|
|
void CharacterController::refreshJumpAnims(const WeaponInfo* weap, JumpingState jump, bool force)
|
|
|
|
|
{
|
|
|
|
|
if(force || jump != mJumpState)
|
|
|
|
|
{
|
|
|
|
|
bool startAtLoop = (jump == mJumpState);
|
|
|
|
@ -358,7 +353,10 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|
|
|
|
1.0f, "loop stop", "stop", 0.0f, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CharacterController::refreshMovementAnims(const WeaponInfo* weap, CharacterState movement, bool force)
|
|
|
|
|
{
|
|
|
|
|
if(force || movement != mMovementState)
|
|
|
|
|
{
|
|
|
|
|
mMovementState = movement;
|
|
|
|
@ -466,16 +464,10 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|
|
|
|
1.f, ((mode!=2)?"start":"loop start"), "stop", 0.0f, ~0ul);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// idle handled last as it can depend on the other states
|
|
|
|
|
// FIXME: if one of the below states is close to their last animation frame (i.e. will be disabled in the coming update),
|
|
|
|
|
// the idle animation should be displayed
|
|
|
|
|
if ((mUpperBodyState != UpperCharState_Nothing
|
|
|
|
|
|| (mMovementState != CharState_None && mMovementState != CharState_TurnLeft && mMovementState != CharState_TurnRight)
|
|
|
|
|
|| mHitState != CharState_None)
|
|
|
|
|
&& !mPtr.getClass().isBipedal(mPtr))
|
|
|
|
|
idle = CharState_None;
|
|
|
|
|
|
|
|
|
|
void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterState idle, bool force)
|
|
|
|
|
{
|
|
|
|
|
if(force || idle != mIdleState)
|
|
|
|
|
{
|
|
|
|
|
mIdleState = idle;
|
|
|
|
@ -513,6 +505,30 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterState movement, JumpingState jump, bool force)
|
|
|
|
|
{
|
|
|
|
|
if (mPtr.getClass().isActor())
|
|
|
|
|
refreshHitRecoilAnims();
|
|
|
|
|
|
|
|
|
|
const WeaponInfo *weap = std::find_if(sWeaponTypeList, sWeaponTypeListEnd, FindWeaponType(mWeaponType));
|
|
|
|
|
if (!mPtr.getClass().isBipedal(mPtr))
|
|
|
|
|
weap = sWeaponTypeListEnd;
|
|
|
|
|
|
|
|
|
|
refreshJumpAnims(weap, jump, force);
|
|
|
|
|
refreshMovementAnims(weap, movement, force);
|
|
|
|
|
|
|
|
|
|
// idle handled last as it can depend on the other states
|
|
|
|
|
// FIXME: if one of the below states is close to their last animation frame (i.e. will be disabled in the coming update),
|
|
|
|
|
// the idle animation should be displayed
|
|
|
|
|
if ((mUpperBodyState != UpperCharState_Nothing
|
|
|
|
|
|| (mMovementState != CharState_None && mMovementState != CharState_TurnLeft && mMovementState != CharState_TurnRight)
|
|
|
|
|
|| mHitState != CharState_None)
|
|
|
|
|
&& !mPtr.getClass().isBipedal(mPtr))
|
|
|
|
|
idle = CharState_None;
|
|
|
|
|
|
|
|
|
|
refreshIdleAnims(weap, idle, force);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void getWeaponGroup(WeaponType weaptype, std::string &group)
|
|
|
|
|
{
|
|
|
|
|