17var
bool autocvar_ai_enable =
true;
18var
bool autocvar_ai_debugLogic =
false;
20_ncMonster_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 ncMonsterLog(...) if (autocvar_ai_debugLogic == true) _ncMonster_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,
281 virtual void Save(
float);
282 virtual void Restore(
string,
string);
285 virtual void Touch(entity);
289 virtual void Input(entity,
string,
string);
290 virtual void Pain(entity, entity,
int, vector, vector,
int);
291 virtual void Death(entity, entity,
int, vector, vector,
int);
293 virtual void Gib(
int, vector);
294 virtual void Sound(
string);
295 virtual void SpawnKey(
string,
string);
302 virtual void RunAI(
void);
327 virtual float SeeFOV(
void);
412 virtual void StateChanged(monsterState_t,monsterState_t);
414 nonvirtual
void SetState(monsterState_t);
416 nonvirtual monsterState_t
GetState(
void);
424 virtual void Trigger(entity, triggermode_t);
447 nonvirtual
void _RenderDebugViewCone();
450 NETWORKED_FLOAT(m_flHeadYaw)
451 NETWORKED_FLOAT_N(subblendfrac)
452 NETWORKED_FLOAT_N(bonecontrol1)
457 vector oldnet_velocity;
458 float m_sentencePitch;
466 string m_outputOnDamaged;
467 string m_outputOnDeath;
468 string m_outputOnHalfHealth;
469 string m_outputOnHearPlayer;
470 string m_outputOnFoundEnemy;
471 string m_outputOnLostEnemy;
472 string m_outputOnLostEnemyLOS;
473 string m_outputOnFoundPlayer;
474 string m_outputOnLostPlayer;
475 string m_outputOnLostPlayerLOS;
476 string m_outputOnDamagedByPlayer;
477 string m_outputOnGreetPlayer;
481 string m_strRouteEnded;
482 int m_iSequenceRemove;
483 int m_iSequenceState;
484 float m_flSequenceEnd;
485 float m_flSequenceSpeed;
486 vector m_vecSequenceAngle;
487 int m_iSequenceFlags;
488 movementState_t m_iMoveState;
489 string m_strSequenceKillTarget;
491 int m_iTriggerCondition;
492 string m_strTriggerTarget;
495 float m_modelEventTime;
499 float m_flAttackThink;
500 monsterState_t m_iMState;
501 monsterState_t m_iOldMState;
510 float m_flTrackingTime;
512 NETWORKED_VECTOR_N(view_ofs)
515 float _m_flReloadTracker;
522 float _m_flMeleeAttempts;
523 float _m_flMeleeDelay;
524 float _m_flBurstCount;
525 bool _m_bShouldThrow;
535 string m_sndFootstep;
537 string m_sndChatterCombat;
539 string m_sndMeleeAttack;
540 string m_sndMeleeAttackHit;
541 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;
573 string m_sndRangedAttack2;
574 bool m_bWeaponStartsDrawn;
575 string m_strBodyOnDraw;
578 float m_flLeapDamage;
579 bool m_bLeapAttacked;
580 float m_flForceSequence;
588 bool m_freezeDuringPain;
589 bool m_flinchDuringMovement;
591 nonvirtual
void _LerpTurnToPos(vector);
592 nonvirtual
void _LerpTurnToYaw(
float);
593 virtual void _Alerted(
void);
594 nonvirtual
void _ChaseAfterSpawn(
void);
600string Sentences_ProcessSample(
string);
604void ncMonster_AlertEnemyAlliance(vector pos,
float radius,
int alliance);
605entity ncMonster_FindClosestPlayer(entity);
609.float baseframe1time;
610.float baseframe2time;
619.float basesubblendfrac;
620.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:274
virtual void AttackHolster(void)
Overridable: Called when they're holstering a weapon.
Definition: Monster.qc:1358
virtual void SeenPlayer(ncActor)
Called when a player is seen by the monster.
Definition: Monster.qc:806
virtual void Restore(string, string)
Similar to ncIO::SpawnKey() but for save-game fields.
Definition: Monster.qc:244
virtual void AlertNoise(void)
Overridable: Called when this monster gets 'alerted' to something new.
Definition: Monster.qc:577
virtual float GetRunSpeed(void)
Overridable: Returns the running speed in Quake units per second.
Definition: Monster.qc:982
nonvirtual void SetState(monsterState_t)
Sets the current state of this ncMonster.
Definition: Monster.qc:1689
virtual float GetWalkSpeed(void)
Overridable: Returns the walking speed in Quake units per second.
Definition: Monster.qc:970
virtual void Gib(int, vector)
Definition: Monster.qc:538
virtual void SeenFriend(ncActor)
Called when a friend is seen by the monster.
Definition: Monster.qc:816
virtual void DebugDraw(void)
virtual void IdleNoise(void)
Overridable: Called after a while when they've got nothing to do.
Definition: Monster.qc:563
virtual void Sound(string)
Definition: Monster.qc:532
virtual void HasBeenGibbed(void)
Definition: Monster.qc:2044
nonvirtual bool InForcedAnimation(void)
Returns if we're currently in a forced animation sequence.
Definition: Monster.qc:526
virtual float predraw(void)
virtual float GetYawSpeed(void)
Overridable: Returns the turning speed in euler-angle units per second.
Definition: Monster.qc:994
nonvirtual void AnimationRewind(void)
Starts the animation sequence from the beginning.
Definition: Monster.qc:520
virtual void StateChanged(monsterState_t, monsterState_t)
Called whenever the state of this ncMonster changes.
Definition: Monster.qc:1663
virtual void Pain(entity, entity, int, vector, vector, int)
Called whenever the entity receives damage.
Definition: Monster.qc:1921
virtual void AttackThink(void)
Overridable: Called when aiming their weapon.
Definition: Monster.qc:1054
virtual float SendEntity(entity, float)
Called by the engine whenever we need to send a client an update about this entity.
Definition: Monster.qc:2835
virtual bool IsAlive(void)
Returns if they're considered alive.
Definition: Monster.qc:1654
virtual void AttackDraw(void)
Overridable: Called when they're drawing a weapon.
Definition: Monster.qc:1340
virtual bool MeleeCondition(void)
Returns whether or not we should attempt a melee attack.
Definition: Monster.qc:612
virtual void ScriptedSequenceEnded(void)
Internal use only.
Definition: Monster.qc:1366
nonvirtual int GetSequenceState(void)
Returns the type of sequence they're currently in.
Definition: Monster.qc:1707
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:2203
virtual void Physics(void)
Definition: Monster.qc:1734
virtual int AnimIdle(void)
DEPRECATED, Overridable: Called when we need to play a fresh idle framegroup.
Definition: Monster.qc:494
virtual void Trigger(entity, triggermode_t)
Called whenever we're legacy triggered by another object or function.
Definition: Monster.qc:2556
virtual float GetChaseSpeed(void)
Overridable: Returns the chase speed in Quake units per second.
Definition: Monster.qc:976
nonvirtual bool IsValidEnemy(entity)
Returns TRUE if 'enemy' should be considered a valid target for killing.
Definition: Monster.qc:717
virtual void ScriptedSequenceEnded_Dead(void)
Internal use only.
Definition: Monster.qc:1448
virtual void AnimationUpdate(void)
Internal use only.
Definition: Monster.qc:1575
virtual bool IsOnRoute(void)
Returns TRUE if the monster is currently on route to a position.
Definition: Monster.qc:761
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition: Monster.qc:157
virtual void SpawnKey(string, string)
This method handles entity key/value pairs on map load.
Definition: Monster.qc:2571
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:1173
virtual void HandleAnimEvent(float, int, string)
Callback for any model event that gets triggered while playing a framegroup.
Definition: Monster.qc:1842
virtual float MeleeMaxDistance(void)
Overridable: Returns the distance in qu of what'll be a successfull melee attack.
Definition: Monster.qc:605
nonvirtual void PerformAttack(string)
Definition: Monster.qc:1163
virtual void RunAI(void)
Internal use only.
Definition: Monster.qc:1719
virtual void AnimPlay(float)
Call to play a single animation onto it, which cannot be interrupted by movement.
Definition: Monster.qc:513
nonvirtual void AlertNearbyClassWithMindset(string scheduleType)
Definition: Monster.qc:689
virtual int AttackMelee(void)
Overridable: Called when attempting to melee attack.
Definition: Monster.qc:1100
nonvirtual int GetTriggerCondition(void)
Returns the condition under which they'll trigger their targets.
Definition: Monster.qc:139
nonvirtual bool ShouldTurn(void)
Definition: Monster.qc:988
virtual void ScriptedSequenceEnded_Moved(void)
Internal use only.
Definition: Monster.qc:1426
virtual void WalkRoute(void)
Internal use only.
Definition: Monster.qc:1496
virtual void Touch(entity)
Called whenever we're touching another entity.
Definition: Monster.qc:1856
virtual void HasBeenHit(void)
Overridable: Called every time the monster is hurt, while still alive.
Definition: Monster.qc:1904
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:500
virtual void HasBeenAlerted(void)
Definition: Monster.qc:2050
nonvirtual void AlertNearbyToSchedule(string scheduleType)
Definition: Monster.qc:657
virtual void SeeThink(void)
Internal use only.
Definition: Monster.qc:821
nonvirtual monsterState_t GetState(void)
Returns the current state of this ncMonster.
Definition: Monster.qc:1701
virtual void Spawned(void)
Called when the entity is fully initialized.
Definition: Monster.qc:2169
virtual void FallNoise(void)
Overridable: Called when they start falling.
Definition: Monster.qc:558
virtual void DebugDraw(void)
Definition: Monster.qc:114
virtual void OnMapFinishedLoading(void)
Overridable: Called when the level finished loading.
Definition: Monster.qc:2295
virtual float SeeFOV(void)
Overridable: Returns the field of view in degrees.
Definition: Monster.qc:618
virtual int AnimRun(void)
DEPRECATED, Overridable: Called when we need to play a fresh running framegroup.
Definition: Monster.qc:506
virtual void RouteClear(void)
Override.
Definition: Monster.qc:1910
virtual void HasBeenKilled(void)
Overridable: Called once, when the monster has died.
Definition: Monster.qc:2038
nonvirtual bool InScriptedSequence(void)
Returns if they're currently in a scripted sequence.
Definition: Monster.qc:1713
virtual bool IsFriend(int)
Returns whether they are allied with the type in question.
Definition: Monster.qc:587
virtual void Input(entity, string, string)
Called when we are being prompted by another object/function with an input message.
Definition: Monster.qc:2309
virtual void TriggerTargets(void)
Call to trigger their targets manually.
Definition: Monster.qc:145
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:2783
nonvirtual vector GetHeadAngles(void)
Definition: Monster.qc:132
virtual void Death(entity, entity, int, vector, vector, int)
Called when the health is equal or below 0.
Definition: Monster.qc:2062
virtual void customphysics(void)
overrides
virtual void RouteEnded(void)
Internal use only.
Definition: Monster.qc:1467
virtual void SeenEnemy(ncActor)
Called when an enemy is seen by the monster.
Definition: Monster.qc:811
virtual void AlertNearby(void)
FIXME: Same as WarnAllies/StartleAllies? WTF?
Definition: Monster.qc:624
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:154