NSMonster: add support for `sequence` key, used by some sitting NPCs.

This commit is contained in:
Marco Cawthorne 2024-03-06 19:30:38 -08:00
parent bd74c588da
commit e9f9ae5829
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
2 changed files with 13 additions and 0 deletions

View File

@ -596,6 +596,7 @@ private:
float m_flLeapDamage;
bool m_bLeapAttacked;
float m_flForceSequence;
nonvirtual void _LerpTurnToEnemy(void);
nonvirtual void _LerpTurnToPos(vector);

View File

@ -1476,6 +1476,15 @@ NSMonster::Physics(void)
if (!IsAlive)
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 */
if (m_bLeapAttacked == true && HasFlags(FL_ONGROUND) == true) {
m_bLeapAttacked = false;
@ -2037,6 +2046,9 @@ NSMonster::SpawnKey(string strKey, string strValue)
case "frame":
_m_flFrame = ReadFloat(strValue);
break;
case "sequence":
m_flForceSequence = ReadFloat(strValue);
break;
default:
super::SpawnKey(strKey, strValue);
break;