17var
bool autocvar_ai_enable =
true;
18var
bool autocvar_ai_debugLogic =
false;
20_NSMonster_Log(
string className,
string functionName,
float edictNum,
string warnMessage)
22 if (autocvar_g_logTimestamps)
23 printf(
"^9%f ^5%s (%d) ^7: %s\n", time, functionName, edictNum, warnMessage);
25 printf(
"^5%s (%d) ^7: %s\n", functionName, edictNum, warnMessage);
27#define NSMonsterLog(...) if (autocvar_ai_debugLogic == true) _NSMonster_Log(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__))
36 MONFL_CHANGED_ORIGIN_X,
37 MONFL_CHANGED_ORIGIN_Y,
38 MONFL_CHANGED_ORIGIN_Z,
39 MONFL_CHANGED_ANGLES_X,
40 MONFL_CHANGED_ANGLES_Y,
41 MONFL_CHANGED_ANGLES_Z,
42 MONFL_CHANGED_MODELINDEX,
47 MONFL_CHANGED_SKINHEALTH,
48 MONFL_CHANGED_MOVETYPE,
49 MONFL_CHANGED_EFFECTS,
52 MONFL_CHANGED_VELOCITY,
53 MONFL_CHANGED_RENDERCOLOR,
54 MONFL_CHANGED_RENDERAMT,
55 MONFL_CHANGED_RENDERMODE,
115 SEQUENCESTATE_ACTIVE,
144 MTRIG_SEEPLAYER_ANGRY,
148 MTRIG_SQUADMEMBERDEAD,
149 MTRIG_SQUADLEADERDEAD,
151 MTRIG_HEARENEMYPLAYER,
154 MTRIG_SEEPLAYER_RELAXED,
249 virtual void Save(
float);
250 virtual void Restore(
string,
string);
253 virtual void Touch(entity);
257 virtual void Input(entity,
string,
string);
258 virtual void Pain(entity, entity,
int, vector, vector,
int);
259 virtual void Death(entity, entity,
int, vector, vector,
int);
261 virtual void Gib(
int, vector);
262 virtual void Sound(
string);
263 virtual void SpawnKey(
string,
string);
267 virtual void RunAI(
void);
292 virtual float SeeFOV(
void);
374 virtual void StateChanged(monsterState_t,monsterState_t);
376 nonvirtual
void SetState(monsterState_t);
378 nonvirtual monsterState_t
GetState(
void);
386 virtual void Trigger(entity, triggermode_t);
404 nonvirtual
void _RenderDebugViewCone();
407 PREDICTED_FLOAT(m_flHeadYaw)
408 PREDICTED_FLOAT_N(subblendfrac)
409 PREDICTED_FLOAT_N(bonecontrol1)
414 vector oldnet_velocity;
422 string m_strRouteEnded;
423 int m_iSequenceRemove;
424 int m_iSequenceState;
425 float m_flSequenceEnd;
426 float m_flSequenceSpeed;
427 vector m_vecSequenceAngle;
428 int m_iSequenceFlags;
429 movementState_t m_iMoveState;
430 string m_strSequenceKillTarget;
432 int m_iTriggerCondition;
433 string m_strTriggerTarget;
440 float m_flAttackThink;
441 monsterState_t m_iMState;
442 monsterState_t m_iOldMState;
451 float m_flTrackingTime;
453 PREDICTED_VECTOR_N(view_ofs)
459 float _m_flMeleeAttempts;
460 float _m_flMeleeDelay;
461 float _m_flBurstCount;
462 bool _m_bShouldThrow;
467 float _m_flReloadTracker;
476 string m_sndFootstep;
478 string m_sndChatterCombat;
481 string m_sndMeleeAttack;
482 string m_sndMeleeAttackHit;
483 string m_sndMeleeAttackMiss;
489 string m_defSpecial1;
490 float m_flSpecial1Range;
491 string m_defSpecial2;
492 float m_flSpecial2Range;
494 float m_flRanged1Range;
496 float m_flRanged2Range;
499 int m_iNumProjectiles;
500 float m_flProjectileDelay;
501 float m_flProjectileSpread;
504 float m_flAttackCone;
505 float m_flAttackAccuracy;
509 float m_flMeleeRange;
511 string m_sndRangedAttack;
512 float m_flReloadCount;
513 float m_flReloadDelay;
515 float m_flReserveAmmo;
517 string m_sndRangedAttack2;
519 bool m_bWeaponStartsDrawn;
520 string m_strBodyOnDraw;
525 float m_flLeapDamage;
526 bool m_bLeapAttacked;
527 float m_flForceSequence;
535 nonvirtual
void _LerpTurnToEnemy(
void);
536 nonvirtual
void _LerpTurnToPos(vector);
537 nonvirtual
void _LerpTurnToYaw(vector);
538 virtual void _Alerted(
void);
539 nonvirtual
void _ChaseAfterSpawn(
void);
545string Sentences_ProcessSample(
string);
549void NSMonster_AlertEnemyAlliance(vector pos,
float radius,
int alliance);
550entity NSMonster_FindClosestPlayer(entity);
554.float baseframe1time;
555.float baseframe2time;
564.float basesubblendfrac;
565.float basesubblend2frac;
This entity class represents an object with choreographed/free-form movement.
Definition: NSNavAI.h:50
This entity class represents non-player characters.
Definition: NSMonster.h:243
virtual bool MeleeCondition(void)
Returns whether or not we should attempt a melee attack.
Definition: NSMonster.qc:560
virtual bool IsAlive(void)
Returns if they're considered alive.
Definition: NSMonster.qc:1525
virtual void TriggerTargets(void)
Call to trigger their targets manually.
Definition: NSMonster.qc:112
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition: NSMonster.qc:124
virtual void WalkRoute(void)
Internal use only.
Definition: NSMonster.qc:1326
virtual void HasBeenKilled(void)
Overridable: Called once, when the monster has died.
Definition: NSMonster.qc:1841
virtual void EvaluateEntity(void)
Run each tic after physics are run to determine if we need to send updates over the network.
Definition: NSMonster.qc:2292
virtual bool IsOnRoute(void)
Returns TRUE if the monster is currently on route to a position.
Definition: NSMonster.qc:650
virtual float GetChaseSpeed(void)
Overridable: Returns the chase speed in Quake units per second.
Definition: NSMonster.qc:793
nonvirtual bool InSequence(void)
Returns if they're currently in a scripted sequence.
Definition: NSMonster.qc:1583
virtual void Restore(string, string)
Similar to NSIO::SpawnKey but for save-game fields.
Definition: NSMonster.qc:209
virtual void AlertNoise(void)
Overridable: Called when this monster gets 'alerted' to something new.
Definition: NSMonster.qc:528
virtual void HasBeenGibbed(void)
Definition: NSMonster.qc:1847
virtual void Gib(int, vector)
Definition: NSMonster.qc:497
nonvirtual monsterState_t GetState(void)
Returns the current state of this NSMonster.
Definition: NSMonster.qc:1571
virtual float MeleeMaxDistance(void)
Overridable: Returns the distance in qu of what'll be a successfull melee attack.
Definition: NSMonster.qc:553
virtual void RouteEnded(void)
Internal use only.
Definition: NSMonster.qc:1301
virtual void FreeStateMoved(void)
Internal use only.
Definition: NSMonster.qc:1267
nonvirtual void AnimReset(void)
Definition: NSMonster.qc:479
nonvirtual vector GetHeadAngles(void)
Definition: NSMonster.qc:99
virtual void Trigger(entity, triggermode_t)
Called whenever we're legacy triggered by another object or function.
Definition: NSMonster.qc:2107
virtual void Touch(entity)
Called whenever we're touching another entity.
Definition: NSMonster.qc:1702
virtual float SeeFOV(void)
Overridable: Returns the field of view in degrees.
Definition: NSMonster.qc:566
nonvirtual int GetSequenceState(void)
Returns the type of sequence they're currently in.
Definition: NSMonster.qc:1577
nonvirtual void SetState(monsterState_t)
Sets the current state of this NSMonster.
Definition: NSMonster.qc:1560
virtual float GetWalkSpeed(void)
Overridable: Returns the walking speed in Quake units per second.
Definition: NSMonster.qc:787
virtual void FallNoise(void)
Overridable: Called when they start falling.
Definition: NSMonster.qc:509
virtual float predraw(void)
virtual bool IsFriend(int)
Returns whether they are allied with the type in question.
Definition: NSMonster.qc:538
nonvirtual bool IsValidEnemy(entity)
Returns TRUE if 'enemy' should be considered a valid target for killing.
Definition: NSMonster.qc:606
virtual void SeenEnemy(NSActor)
Called when an enemy is seen by the monster.
Definition: NSMonster.qc:674
virtual void HasBeenHit(void)
Overridable: Called every time the monster is hurt, while still alive.
Definition: NSMonster.qc:1749
virtual void Input(entity, string, string)
Called when we are being prompted by another object/function with an input message.
Definition: NSMonster.qc:2066
virtual void SeeThink(void)
Internal use only.
Definition: NSMonster.qc:684
virtual void ReceiveEntity(float, float)
Client: Handles network updates from the server for the associated entity.
virtual void Physics(void)
Definition: NSMonster.qc:1597
virtual void Death(entity, entity, int, vector, vector, int)
Called when the health is equal or below 0.
Definition: NSMonster.qc:1865
virtual void SeenFriend(NSActor)
Called when a friend is seen by the monster.
Definition: NSMonster.qc:679
virtual void Sound(string)
Definition: NSMonster.qc:491
nonvirtual void PerformAttack(string)
Definition: NSMonster.qc:1007
virtual void FreeState(void)
Internal use only.
Definition: NSMonster.qc:1210
virtual void AttackDraw(void)
Overridable: Called when they're drawing a weapon.
Definition: NSMonster.qc:1184
virtual void AnimPlay(float)
Call to play a single animation onto it, which cannot be interrupted by movement.
Definition: NSMonster.qc:472
virtual void Pain(entity, entity, int, vector, vector, int)
Called whenever the entity receives damage.
Definition: NSMonster.qc:1755
virtual float GetYawSpeed(void)
Overridable: Returns the turning speed in euler-angle units per second.
Definition: NSMonster.qc:805
virtual void FreeStateDead(void)
Internal use only.
Definition: NSMonster.qc:1282
virtual int AnimWalk(void)
DEPRECATED, Overridable: Called when we need to play a fresh walking framegroup.
Definition: NSMonster.qc:459
virtual float SendEntity(entity, float)
Called by the engine whenever we need to send a client an update about this entity.
Definition: NSMonster.qc:2337
virtual void StateChanged(monsterState_t, monsterState_t)
Called whenever the state of this NSMonster changes.
Definition: NSMonster.qc:1534
virtual void AttackHolster(void)
Overridable: Called when they're holstering a weapon.
Definition: NSMonster.qc:1202
virtual void SpawnKey(string, string)
This method handles entity key/value pairs on map load.
Definition: NSMonster.qc:2122
virtual void RunAI(void)
Internal use only.
Definition: NSMonster.qc:1589
virtual void Respawn(void)
Server: Called when the entity first spawns or when game-logic requests the entity to return to its o...
Definition: NSMonster.qc:1987
virtual float GetRunSpeed(void)
Overridable: Returns the running speed in Quake units per second.
Definition: NSMonster.qc:799
nonvirtual bool InAnimation(void)
Returns if we're currently in a forced animation sequence.
Definition: NSMonster.qc:485
virtual void AnimationUpdate(void)
Internal use only.
Definition: NSMonster.qc:1459
virtual void IdleNoise(void)
Overridable: Called after a while when they've got nothing to do.
Definition: NSMonster.qc:514
virtual int AttackMelee(void)
Overridable: Called when attempting to melee attack.
Definition: NSMonster.qc:944
virtual void customphysics(void)
overrides
nonvirtual int GetTriggerCondition(void)
Returns the condition under which they'll trigger their targets.
Definition: NSMonster.qc:106
void NSMonster(void)
Definition: NSMonster.qc:21
virtual void AlertNearby(void)
FIXME: Same as WarnAllies/StartleAllies? WTF?
Definition: NSMonster.qc:572
virtual void HasBeenAlerted(void)
Definition: NSMonster.qc:1853
virtual int AnimIdle(void)
DEPRECATED, Overridable: Called when we need to play a fresh idle framegroup.
Definition: NSMonster.qc:453
virtual void SeenPlayer(NSActor)
Called when a player is seen by the monster.
Definition: NSMonster.qc:669
virtual int AttackRanged(void)
Overridable: Called when attempting to attack from a distance.
Definition: NSMonster.qc:1017
virtual void AttackThink(void)
Overridable: Called when aiming their weapon.
Definition: NSMonster.qc:886
virtual int AnimRun(void)
DEPRECATED, Overridable: Called when we need to play a fresh running framegroup.
Definition: NSMonster.qc:465
virtual void Spawned(void)
Called when the entity is fulled initialized.
Definition: NSMonster.qc:1966
typedef enumflags
Defines the valid alignment flags for text fields.
Definition: font.h:37
string Sentences_GetSamples(string)
Returns a string of sample for a given sentence.
Definition: sentences.qc:149