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,
283 virtual void Save(
float);
284 virtual void Restore(
string,
string);
287 virtual void Touch(entity);
291 virtual void Input(entity,
string,
string);
292 virtual void Pain(entity, entity,
int, vector, vector,
int);
293 virtual void Death(entity, entity,
int, vector, vector,
int);
295 virtual void Gib(
int, vector);
296 virtual void Sound(
string);
297 virtual void SpawnKey(
string,
string);
301 virtual void RunAI(
void);
326 virtual float SeeFOV(
void);
411 virtual void StateChanged(monsterState_t,monsterState_t);
413 nonvirtual
void SetState(monsterState_t);
415 nonvirtual monsterState_t
GetState(
void);
423 virtual void Trigger(entity, triggermode_t);
446 nonvirtual
void _RenderDebugViewCone();
449 PREDICTED_FLOAT(m_flHeadYaw)
450 PREDICTED_FLOAT_N(subblendfrac)
451 PREDICTED_FLOAT_N(bonecontrol1)
456 vector oldnet_velocity;
457 float m_sentencePitch;
464 string m_outputOnDamaged;
465 string m_outputOnDeath;
466 string m_outputOnHalfHealth;
467 string m_outputOnHearPlayer;
468 string m_outputOnFoundEnemy;
469 string m_outputOnLostEnemy;
470 string m_outputOnLostEnemyLOS;
471 string m_outputOnFoundPlayer;
472 string m_outputOnLostPlayer;
473 string m_outputOnLostPlayerLOS;
474 string m_outputOnDamagedByPlayer;
475 string m_outputOnGreetPlayer;
479 string m_strRouteEnded;
480 int m_iSequenceRemove;
481 int m_iSequenceState;
482 float m_flSequenceEnd;
483 float m_flSequenceSpeed;
484 vector m_vecSequenceAngle;
485 int m_iSequenceFlags;
486 movementState_t m_iMoveState;
487 string m_strSequenceKillTarget;
489 int m_iTriggerCondition;
490 string m_strTriggerTarget;
493 float m_modelEventTime;
497 float m_flAttackThink;
498 monsterState_t m_iMState;
499 monsterState_t m_iOldMState;
508 float m_flTrackingTime;
510 PREDICTED_VECTOR_N(view_ofs)
516 float _m_flMeleeAttempts;
517 float _m_flMeleeDelay;
518 float _m_flBurstCount;
519 bool _m_bShouldThrow;
524 float _m_flReloadTracker;
533 string m_sndFootstep;
535 string m_sndChatterCombat;
538 string m_sndMeleeAttack;
539 string m_sndMeleeAttackHit;
540 string m_sndMeleeAttackMiss;
546 string m_defSpecial1;
547 float m_flSpecial1Range;
548 string m_defSpecial2;
549 float m_flSpecial2Range;
551 float m_flRanged1Range;
553 float m_flRanged2Range;
556 int m_iNumProjectiles;
557 float m_flProjectileDelay;
558 float m_flProjectileSpread;
561 float m_flAttackCone;
562 float m_flAttackAccuracy;
566 float m_flMeleeRange;
568 string m_sndRangedAttack;
569 float m_flReloadCount;
570 float m_flReloadDelay;
572 float m_flReserveAmmo;
574 string m_sndRangedAttack2;
576 bool m_bWeaponStartsDrawn;
577 string m_strBodyOnDraw;
582 float m_flLeapDamage;
583 bool m_bLeapAttacked;
584 float m_flForceSequence;
594 nonvirtual
void _LerpTurnToPos(vector);
595 nonvirtual
void _LerpTurnToYaw(
float);
596 virtual void _Alerted(
void);
597 nonvirtual
void _ChaseAfterSpawn(
void);
603string Sentences_ProcessSample(
string);
607void ncMonster_AlertEnemyAlliance(vector pos,
float radius,
int alliance);
608entity ncMonster_FindClosestPlayer(entity);
612.float baseframe1time;
613.float baseframe2time;
622.float basesubblendfrac;
623.float basesubblend2frac;
This entity class represents an object with choreographed/free-form movement.
Definition: Actor.h:93
This entity class represents non-player characters.
Definition: Monster.h:276
virtual void AttackHolster(void)
Overridable: Called when they're holstering a weapon.
Definition: Monster.qc:1343
virtual void SeenPlayer(ncActor)
Called when a player is seen by the monster.
Definition: Monster.qc:791
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:967
nonvirtual void SetState(monsterState_t)
Sets the current state of this ncMonster.
Definition: Monster.qc:1667
virtual float GetWalkSpeed(void)
Overridable: Returns the walking speed in Quake units per second.
Definition: Monster.qc:955
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:801
virtual void DebugDraw(void)
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:2000
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:979
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:1641
virtual void Pain(entity, entity, int, vector, vector, int)
Called whenever the entity receives damage.
Definition: Monster.qc:1885
virtual void AttackThink(void)
Overridable: Called when aiming their weapon.
Definition: Monster.qc:1039
virtual float SendEntity(entity, float)
Called by the engine whenever we need to send a client an update about this entity.
Definition: Monster.qc:2705
virtual bool IsAlive(void)
Returns if they're considered alive.
Definition: Monster.qc:1632
virtual void AttackDraw(void)
Overridable: Called when they're drawing a weapon.
Definition: Monster.qc:1325
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:1351
nonvirtual int GetSequenceState(void)
Returns the type of sequence they're currently in.
Definition: Monster.qc:1685
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:2154
virtual void Physics(void)
Definition: Monster.qc:1712
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:2439
virtual float GetChaseSpeed(void)
Overridable: Returns the chase speed in Quake units per second.
Definition: Monster.qc:961
nonvirtual bool IsValidEnemy(entity)
Returns TRUE if 'enemy' should be considered a valid target for killing.
Definition: Monster.qc:702
virtual void ScriptedSequenceEnded_Dead(void)
Internal use only.
Definition: Monster.qc:1426
virtual void AnimationUpdate(void)
Internal use only.
Definition: Monster.qc:1553
virtual bool IsOnRoute(void)
Returns TRUE if the monster is currently on route to a position.
Definition: Monster.qc:746
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:2454
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:1158
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:1148
virtual void RunAI(void)
Internal use only.
Definition: Monster.qc:1697
virtual void AnimPlay(float)
Call to play a single animation onto it, which cannot be interrupted by movement.
Definition: Monster.qc:503
nonvirtual void AlertNearbyClassWithMindset(string scheduleType)
Definition: Monster.qc:674
virtual int AttackMelee(void)
Overridable: Called when attempting to melee attack.
Definition: Monster.qc:1085
nonvirtual int GetTriggerCondition(void)
Returns the condition under which they'll trigger their targets.
Definition: Monster.qc:137
nonvirtual bool ShouldTurn(void)
Definition: Monster.qc:973
virtual void ScriptedSequenceEnded_Moved(void)
Internal use only.
Definition: Monster.qc:1411
virtual void WalkRoute(void)
Internal use only.
Definition: Monster.qc:1474
virtual void Touch(entity)
Called whenever we're touching another entity.
Definition: Monster.qc:1820
virtual void HasBeenHit(void)
Overridable: Called every time the monster is hurt, while still alive.
Definition: Monster.qc:1868
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:2006
nonvirtual void AlertNearbyToSchedule(string scheduleType)
Definition: Monster.qc:642
virtual void SeeThink(void)
Internal use only.
Definition: Monster.qc:806
nonvirtual monsterState_t GetState(void)
Returns the current state of this ncMonster.
Definition: Monster.qc:1679
virtual void Spawned(void)
Called when the entity is fulled initialized.
Definition: Monster.qc:2120
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:1874
virtual void HasBeenKilled(void)
Overridable: Called once, when the monster has died.
Definition: Monster.qc:1994
nonvirtual bool InScriptedSequence(void)
Returns if they're currently in a scripted sequence.
Definition: Monster.qc:1691
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:2235
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:2660
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:2018
virtual void customphysics(void)
overrides
virtual void RouteEnded(void)
Internal use only.
Definition: Monster.qc:1445
virtual void SeenEnemy(ncActor)
Called when an enemy is seen by the monster.
Definition: Monster.qc:796
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