NSMonster: add support for sequence
key, used by some sitting NPCs.
This commit is contained in:
parent
bd74c588da
commit
e9f9ae5829
2 changed files with 13 additions and 0 deletions
|
@ -596,6 +596,7 @@ private:
|
||||||
|
|
||||||
float m_flLeapDamage;
|
float m_flLeapDamage;
|
||||||
bool m_bLeapAttacked;
|
bool m_bLeapAttacked;
|
||||||
|
float m_flForceSequence;
|
||||||
|
|
||||||
nonvirtual void _LerpTurnToEnemy(void);
|
nonvirtual void _LerpTurnToEnemy(void);
|
||||||
nonvirtual void _LerpTurnToPos(vector);
|
nonvirtual void _LerpTurnToPos(vector);
|
||||||
|
|
|
@ -1476,6 +1476,15 @@ NSMonster::Physics(void)
|
||||||
if (!IsAlive)
|
if (!IsAlive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (m_flForceSequence) {
|
||||||
|
if (m_iSequenceState != SEQUENCESTATE_IDLE) {
|
||||||
|
SetFrame(m_flForceSequence);
|
||||||
|
}
|
||||||
|
m_flAnimTime = time + 999.0f;
|
||||||
|
frame = m_flForceSequence;
|
||||||
|
m_iSequenceState = SEQUENCESTATE_IDLE;
|
||||||
|
}
|
||||||
|
|
||||||
/* unset the leap attack */
|
/* unset the leap attack */
|
||||||
if (m_bLeapAttacked == true && HasFlags(FL_ONGROUND) == true) {
|
if (m_bLeapAttacked == true && HasFlags(FL_ONGROUND) == true) {
|
||||||
m_bLeapAttacked = false;
|
m_bLeapAttacked = false;
|
||||||
|
@ -2037,6 +2046,9 @@ NSMonster::SpawnKey(string strKey, string strValue)
|
||||||
case "frame":
|
case "frame":
|
||||||
_m_flFrame = ReadFloat(strValue);
|
_m_flFrame = ReadFloat(strValue);
|
||||||
break;
|
break;
|
||||||
|
case "sequence":
|
||||||
|
m_flForceSequence = ReadFloat(strValue);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
super::SpawnKey(strKey, strValue);
|
super::SpawnKey(strKey, strValue);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue