17#warning Integrate ai_relationship, ai_task, ai_schedule
19var
bool autocvar_ai_enable =
true;
20var
bool autocvar_ai_debugLogic =
false;
22_ncMonster_Log(
string className,
string functionName,
float edictNum,
string warnMessage)
24 if (autocvar_g_logTimestamps)
25 printf(
"^9%f ^5%s (%d) ^7: %s\n", time, functionName, edictNum, warnMessage);
27 printf(
"^5%s (%d) ^7: %s\n", functionName, edictNum, warnMessage);
29#define ncMonsterLog(...) if (autocvar_ai_debugLogic == true) _ncMonster_Log(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__))
38 MONFL_CHANGED_ORIGIN_X,
39 MONFL_CHANGED_ORIGIN_Y,
40 MONFL_CHANGED_ORIGIN_Z,
41 MONFL_CHANGED_ANGLES_X,
42 MONFL_CHANGED_ANGLES_Y,
43 MONFL_CHANGED_ANGLES_Z,
44 MONFL_CHANGED_MODELINDEX,
49 MONFL_CHANGED_SKINHEALTH,
50 MONFL_CHANGED_MOVETYPE,
51 MONFL_CHANGED_EFFECTS,
54 MONFL_CHANGED_VELOCITY,
55 MONFL_CHANGED_RENDERCOLOR,
56 MONFL_CHANGED_RENDERAMT,
57 MONFL_CHANGED_RENDERMODE,
117 SEQUENCESTATE_ACTIVE,
146 MTRIG_SEEPLAYER_ANGRY,
150 MTRIG_SQUADMEMBERDEAD,
151 MTRIG_SQUADLEADERDEAD,
153 MTRIG_HEARENEMYPLAYER,
156 MTRIG_SEEPLAYER_RELAXED,
252 virtual void Save(
float);
253 virtual void Restore(
string,
string);
256 virtual void Touch(entity);
260 virtual void Input(entity,
string,
string);
261 virtual void Pain(entity, entity,
int, vector, vector,
int);
262 virtual void Death(entity, entity,
int, vector, vector,
int);
264 virtual void Gib(
int, vector);
265 virtual void Sound(
string);
266 virtual void SpawnKey(
string,
string);
270 virtual void RunAI(
void);
295 virtual float SeeFOV(
void);
380 virtual void StateChanged(monsterState_t,monsterState_t);
382 nonvirtual
void SetState(monsterState_t);
384 nonvirtual monsterState_t
GetState(
void);
392 virtual void Trigger(entity, triggermode_t);
410 nonvirtual
void _RenderDebugViewCone();
413 PREDICTED_FLOAT(m_flHeadYaw)
414 PREDICTED_FLOAT_N(subblendfrac)
415 PREDICTED_FLOAT_N(bonecontrol1)
420 vector oldnet_velocity;
428 string m_outputOnDamaged;
429 string m_outputOnDeath;
430 string m_outputOnHalfHealth;
431 string m_outputOnHearPlayer;
432 string m_outputOnFoundEnemy;
433 string m_outputOnLostEnemy;
434 string m_outputOnLostEnemyLOS;
435 string m_outputOnFoundPlayer;
436 string m_outputOnLostPlayer;
437 string m_outputOnLostPlayerLOS;
438 string m_outputOnDamagedByPlayer;
439 string m_outputOnGreetPlayer;
443 string m_strRouteEnded;
444 int m_iSequenceRemove;
445 int m_iSequenceState;
446 float m_flSequenceEnd;
447 float m_flSequenceSpeed;
448 vector m_vecSequenceAngle;
449 int m_iSequenceFlags;
450 movementState_t m_iMoveState;
451 string m_strSequenceKillTarget;
453 int m_iTriggerCondition;
454 string m_strTriggerTarget;
461 float m_flAttackThink;
462 monsterState_t m_iMState;
463 monsterState_t m_iOldMState;
472 float m_flTrackingTime;
474 PREDICTED_VECTOR_N(view_ofs)
480 float _m_flMeleeAttempts;
481 float _m_flMeleeDelay;
482 float _m_flBurstCount;
483 bool _m_bShouldThrow;
488 float _m_flReloadTracker;
497 string m_sndFootstep;
499 string m_sndChatterCombat;
502 string m_sndMeleeAttack;
503 string m_sndMeleeAttackHit;
504 string m_sndMeleeAttackMiss;
510 string m_defSpecial1;
511 float m_flSpecial1Range;
512 string m_defSpecial2;
513 float m_flSpecial2Range;
515 float m_flRanged1Range;
517 float m_flRanged2Range;
520 int m_iNumProjectiles;
521 float m_flProjectileDelay;
522 float m_flProjectileSpread;
525 float m_flAttackCone;
526 float m_flAttackAccuracy;
530 float m_flMeleeRange;
532 string m_sndRangedAttack;
533 float m_flReloadCount;
534 float m_flReloadDelay;
536 float m_flReserveAmmo;
538 string m_sndRangedAttack2;
540 bool m_bWeaponStartsDrawn;
541 string m_strBodyOnDraw;
546 float m_flLeapDamage;
547 bool m_bLeapAttacked;
548 float m_flForceSequence;
558 nonvirtual
void _LerpTurnToPos(vector);
559 nonvirtual
void _LerpTurnToYaw(
float);
560 virtual void _Alerted(
void);
561 nonvirtual
void _ChaseAfterSpawn(
void);
567string Sentences_ProcessSample(
string);
571void ncMonster_AlertEnemyAlliance(vector pos,
float radius,
int alliance);
572entity ncMonster_FindClosestPlayer(entity);
576.float baseframe1time;
577.float baseframe2time;
586.float basesubblendfrac;
587.float basesubblend2frac;
This entity class represents an object with choreographed/free-form movement.
Definition: Actor.h:72
This entity class represents non-player characters.
Definition: Monster.h:245
virtual void AttackHolster(void)
Overridable: Called when they're holstering a weapon.
Definition: Monster.qc:1279
virtual void SeenPlayer(ncActor)
Called when a player is seen by the monster.
Definition: Monster.qc:738
virtual void Restore(string, string)
Similar to ncIO::SpawnKey() but for save-game fields.
Definition: Monster.qc:240
virtual void AlertNoise(void)
Overridable: Called when this monster gets 'alerted' to something new.
Definition: Monster.qc:562
virtual float GetRunSpeed(void)
Overridable: Returns the running speed in Quake units per second.
Definition: Monster.qc:903
nonvirtual void SetState(monsterState_t)
Sets the current state of this ncMonster.
Definition: Monster.qc:1603
virtual float GetWalkSpeed(void)
Overridable: Returns the walking speed in Quake units per second.
Definition: Monster.qc:891
virtual void Gib(int, vector)
Definition: Monster.qc:528
virtual void SeenFriend(ncActor)
Called when a friend is seen by the monster.
Definition: Monster.qc:748
virtual void IdleNoise(void)
Overridable: Called after a while when they've got nothing to do.
Definition: Monster.qc:548
virtual void Sound(string)
Definition: Monster.qc:522
virtual void HasBeenGibbed(void)
Definition: Monster.qc:1936
nonvirtual bool InForcedAnimation(void)
Returns if we're currently in a forced animation sequence.
Definition: Monster.qc:516
virtual float predraw(void)
virtual float GetYawSpeed(void)
Overridable: Returns the turning speed in euler-angle units per second.
Definition: Monster.qc:915
nonvirtual void AnimationRewind(void)
Starts the animation sequence from the beginning.
Definition: Monster.qc:510
virtual void StateChanged(monsterState_t, monsterState_t)
Called whenever the state of this ncMonster changes.
Definition: Monster.qc:1577
virtual void Pain(entity, entity, int, vector, vector, int)
Called whenever the entity receives damage.
Definition: Monster.qc:1821
virtual void AttackThink(void)
Overridable: Called when aiming their weapon.
Definition: Monster.qc:975
virtual float SendEntity(entity, float)
Called by the engine whenever we need to send a client an update about this entity.
Definition: Monster.qc:2626
virtual bool IsAlive(void)
Returns if they're considered alive.
Definition: Monster.qc:1568
virtual void AttackDraw(void)
Overridable: Called when they're drawing a weapon.
Definition: Monster.qc:1261
virtual bool MeleeCondition(void)
Returns whether or not we should attempt a melee attack.
Definition: Monster.qc:597
virtual void ScriptedSequenceEnded(void)
Internal use only.
Definition: Monster.qc:1287
nonvirtual int GetSequenceState(void)
Returns the type of sequence they're currently in.
Definition: Monster.qc:1621
virtual void Respawn(void)
Server: Called when the entity first spawns or when game-logic requests the entity to return to its o...
Definition: Monster.qc:2091
virtual void Physics(void)
Definition: Monster.qc:1648
virtual int AnimIdle(void)
DEPRECATED, Overridable: Called when we need to play a fresh idle framegroup.
Definition: Monster.qc:484
virtual void Trigger(entity, triggermode_t)
Called whenever we're legacy triggered by another object or function.
Definition: Monster.qc:2360
virtual float GetChaseSpeed(void)
Overridable: Returns the chase speed in Quake units per second.
Definition: Monster.qc:897
nonvirtual bool IsValidEnemy(entity)
Returns TRUE if 'enemy' should be considered a valid target for killing.
Definition: Monster.qc:675
virtual void ScriptedSequenceEnded_Dead(void)
Internal use only.
Definition: Monster.qc:1362
virtual void AnimationUpdate(void)
Internal use only.
Definition: Monster.qc:1489
virtual bool IsOnRoute(void)
Returns TRUE if the monster is currently on route to a position.
Definition: Monster.qc:719
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition: Monster.qc:155
virtual void SpawnKey(string, string)
This method handles entity key/value pairs on map load.
Definition: Monster.qc:2375
virtual void ReceiveEntity(float, float)
Client: Handles network updates from the server for the associated entity.
virtual int AttackRanged(void)
Overridable: Called when attempting to attack from a distance.
Definition: Monster.qc:1094
virtual float MeleeMaxDistance(void)
Overridable: Returns the distance in qu of what'll be a successfull melee attack.
Definition: Monster.qc:590
nonvirtual void PerformAttack(string)
Definition: Monster.qc:1084
virtual void RunAI(void)
Internal use only.
Definition: Monster.qc:1633
virtual void AnimPlay(float)
Call to play a single animation onto it, which cannot be interrupted by movement.
Definition: Monster.qc:503
virtual int AttackMelee(void)
Overridable: Called when attempting to melee attack.
Definition: Monster.qc:1021
nonvirtual int GetTriggerCondition(void)
Returns the condition under which they'll trigger their targets.
Definition: Monster.qc:137
virtual void ScriptedSequenceEnded_Moved(void)
Internal use only.
Definition: Monster.qc:1347
virtual void WalkRoute(void)
Internal use only.
Definition: Monster.qc:1410
virtual void Touch(entity)
Called whenever we're touching another entity.
Definition: Monster.qc:1756
virtual void HasBeenHit(void)
Overridable: Called every time the monster is hurt, while still alive.
Definition: Monster.qc:1804
void ncMonster(void)
Definition: Monster.qc:21
virtual int AnimWalk(void)
DEPRECATED, Overridable: Called when we need to play a fresh walking framegroup.
Definition: Monster.qc:490
virtual void HasBeenAlerted(void)
Definition: Monster.qc:1942
virtual void SeeThink(void)
Internal use only.
Definition: Monster.qc:753
nonvirtual monsterState_t GetState(void)
Returns the current state of this ncMonster.
Definition: Monster.qc:1615
virtual void Spawned(void)
Called when the entity is fulled initialized.
Definition: Monster.qc:2057
virtual void FallNoise(void)
Overridable: Called when they start falling.
Definition: Monster.qc:543
virtual void DebugDraw(void)
Definition: Monster.qc:112
virtual float SeeFOV(void)
Overridable: Returns the field of view in degrees.
Definition: Monster.qc:603
virtual int AnimRun(void)
DEPRECATED, Overridable: Called when we need to play a fresh running framegroup.
Definition: Monster.qc:496
virtual void RouteClear(void)
Override.
Definition: Monster.qc:1810
virtual void HasBeenKilled(void)
Overridable: Called once, when the monster has died.
Definition: Monster.qc:1930
nonvirtual bool InScriptedSequence(void)
Returns if they're currently in a scripted sequence.
Definition: Monster.qc:1627
virtual bool IsFriend(int)
Returns whether they are allied with the type in question.
Definition: Monster.qc:572
virtual void Input(entity, string, string)
Called when we are being prompted by another object/function with an input message.
Definition: Monster.qc:2173
virtual void TriggerTargets(void)
Call to trigger their targets manually.
Definition: Monster.qc:143
virtual void EvaluateEntity(void)
Run each tic after physics are run to determine if we need to send updates over the network.
Definition: Monster.qc:2581
nonvirtual vector GetHeadAngles(void)
Definition: Monster.qc:130
virtual void Death(entity, entity, int, vector, vector, int)
Called when the health is equal or below 0.
Definition: Monster.qc:1954
virtual void customphysics(void)
overrides
virtual void RouteEnded(void)
Internal use only.
Definition: Monster.qc:1381
virtual void SeenEnemy(ncActor)
Called when an enemy is seen by the monster.
Definition: Monster.qc:743
virtual void AlertNearby(void)
FIXME: Same as WarnAllies/StartleAllies? WTF?
Definition: Monster.qc:609
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:152