28#include "simpleactor.h"
29#include "actorenemy.h"
32#include "gamescript.h"
33#include "scriptmaster.h"
34#include "grenadehint.h"
40extern Event EV_Actor_SetGun;
41extern Event EV_Actor_SetGun2;
42extern Event EV_Actor_GetGun;
43extern Event EV_Actor_GetSight;
44extern Event EV_Actor_SetSight;
45extern Event EV_Actor_SetSight2;
46extern Event EV_Actor_GetHearing;
47extern Event EV_Actor_SetHearing;
48extern Event EV_Actor_SetHearing2;
49extern Event EV_Actor_GetFov;
50extern Event EV_Actor_SetFov;
51extern Event EV_Actor_SetFov2;
52extern Event EV_Actor_SetTypeIdle;
53extern Event EV_Actor_SetTypeIdle2;
54extern Event EV_Actor_GetTypeIdle;
55extern Event EV_Actor_SetTypeAttack;
56extern Event EV_Actor_SetTypeAttack2;
57extern Event EV_Actor_GetTypeAttack;
58extern Event EV_Actor_SetTypeDisguise;
59extern Event EV_Actor_SetTypeDisguise2;
60extern Event EV_Actor_GetTypeDisguise;
61extern Event EV_Actor_SetDisguiseLevel;
62extern Event EV_Actor_SetDisguiseLevel2;
63extern Event EV_Actor_GetDisguiseLevel;
64extern Event EV_Actor_SetTypeGrenade;
65extern Event EV_Actor_SetTypeGrenade2;
66extern Event EV_Actor_GetTypeGrenade;
67extern Event EV_Actor_SetPatrolPath;
68extern Event EV_Actor_SetPatrolPath2;
69extern Event EV_Actor_GetPatrolPath;
70extern Event EV_Actor_SetPatrolWaitTrigger;
71extern Event EV_Actor_SetPatrolWaitTrigger2;
72extern Event EV_Actor_GetPatrolWaitTrigger;
73extern Event EV_Actor_SetAlarmNode;
74extern Event EV_Actor_SetAlarmNode2;
75extern Event EV_Actor_GetAlarmNode;
76extern Event EV_Actor_SetAccuracy;
77extern Event EV_Actor_SetAccuracy2;
78extern Event EV_Actor_GetAccuracy;
79extern Event EV_Actor_SetMinDistance;
80extern Event EV_Actor_SetMinDistance2;
81extern Event EV_Actor_GetMinDistance;
82extern Event EV_Actor_SetMaxDistance;
83extern Event EV_Actor_SetMaxDistance2;
84extern Event EV_Actor_GetMaxDistance;
85extern Event EV_Actor_GetLeash;
86extern Event EV_Actor_SetLeash;
87extern Event EV_Actor_SetLeash2;
88extern Event EV_Actor_GetInterval;
89extern Event EV_Actor_SetInterval;
90extern Event EV_Actor_SetInterval2;
91extern Event EV_Actor_SetDisguiseRange;
92extern Event EV_Actor_SetDisguiseRange2;
93extern Event EV_Actor_GetDisguiseRange;
94extern Event EV_Actor_SetDisguisePeriod;
95extern Event EV_Actor_SetDisguisePeriod2;
96extern Event EV_Actor_GetDisguisePeriod;
97extern Event EV_Actor_SetGrenadeAwareness;
98extern Event EV_Actor_SetGrenadeAwareness2;
99extern Event EV_Actor_GetGrenadeAwareness;
100extern Event EV_Actor_SetTurret;
101extern Event EV_Actor_SetTurret2;
102extern Event EV_Actor_GetTurret;
103extern Event EV_Actor_SetSoundAwareness;
104extern Event EV_Actor_SetSoundAwareness2;
105extern Event EV_Actor_GetSoundAwareness;
106extern Event EV_Actor_SetGrenadeAwareness;
107extern Event EV_Actor_SetGrenadeAwareness2;
108extern Event EV_Actor_SetAmmoGrenade;
109extern Event EV_Actor_SetAmmoGrenade2;
110extern Event EV_Actor_GetAmmoGrenade;
111extern Event EV_Actor_GetMaxNoticeTimeScale;
112extern Event EV_Actor_SetMaxNoticeTimeScale;
113extern Event EV_Actor_SetMaxNoticeTimeScale2;
114extern Event EV_Actor_GetFixedLeash;
115extern Event EV_Actor_SetFixedLeash;
116extern Event EV_Actor_SetFixedLeash2;
117extern Event EV_Actor_GetEnemyShareRange;
118extern Event EV_Actor_SetEnemyShareRange;
119extern Event EV_Actor_SetEnemyShareRange2;
120extern Event EV_Actor_SetWeapon;
121extern Event EV_Actor_GetWeapon;
122extern Event EV_Actor_GetVoiceType;
123extern Event EV_Actor_SetVoiceType;
124extern Event EV_Actor_SetVoiceType2;
125extern Event EV_Actor_GetFavoriteEnemy;
126extern Event EV_Actor_SetFavoriteEnemy;
127extern Event EV_Actor_SetFavoriteEnemy2;
128extern Event EV_Actor_SetBalconyHeight;
129extern Event EV_Actor_SetBalconyHeight2;
130extern Event EV_Actor_GetBalconyHeight;
131extern Event EV_Actor_GetNoSurprise;
132extern Event EV_Actor_SetNoSurprise;
133extern Event EV_Actor_SetNoSurprise2;
134extern Event EV_Actor_DeathEmbalm;
139#define ACTOR_HEAD_TAG 0
140#define ACTOR_TORSO_TAG 1
144#define LIP_SYNC_HZ 20.0
146#define MAX_DIALOG_PARAMETERS_LENGTH 100
148#define MAX_DIALOG_PARM_LENGTH 64
149#define MAX_DIALOG_PARMS 10
151#define DIALOG_PARM_TYPE_NONE 0
152#define DIALOG_PARM_TYPE_PLAYERHAS 1
153#define DIALOG_PARM_TYPE_PLAYERHASNOT 2
154#define DIALOG_PARM_TYPE_HAS 3
155#define DIALOG_PARM_TYPE_HASNOT 4
156#define DIALOG_PARM_TYPE_DEPENDS 5
157#define DIALOG_PARM_TYPE_DEPENDSNOT 6
161 char parm[MAX_DIALOG_PARM_LENGTH];
165 char alias_name[MAX_ALIAS_NAME_LENGTH];
168 float random_percent;
185#define STIMULI_ALL -1
186#define STIMULI_NONE 0
187#define STIMULI_SIGHT (1 << 0)
188#define STIMULI_SOUND (1 << 1)
189#define STIMULI_PAIN (1 << 2)
190#define STIMULI_SCRIPT (1 << 3)
192#define MAX_INACTIVE_TIME 30.0
196#define STATE_FLAG_IN_PAIN (1 << 0)
197#define STATE_FLAG_MELEE_HIT (1 << 1)
198#define STATE_FLAG_TOUCHED (1 << 2)
199#define STATE_FLAG_ACTIVATED (1 << 3)
200#define STATE_FLAG_USED (1 << 4)
201#define STATE_FLAG_TWITCH (1 << 5)
202#define STATE_FLAG_BLOCKED_HIT (1 << 6)
203#define STATE_FLAG_SMALL_PAIN (1 << 7)
204#define STATE_FLAG_OTHER_DIED (1 << 8)
205#define STATE_FLAG_STUCK (1 << 9)
206#define STATE_FLAG_NO_PATH (1 << 10)
210#define ACTOR_MODE_NONE 0
211#define ACTOR_MODE_IDLE 1
212#define ACTOR_MODE_AI 2
213#define ACTOR_MODE_SCRIPT 3
214#define ACTOR_MODE_TALK 4
223 unsigned int state_flags;
228#define ACTOR_FLAG_NOISE_HEARD 0
229#define ACTOR_FLAG_INVESTIGATING 1
230#define ACTOR_FLAG_DEATHGIB 2
231#define ACTOR_FLAG_DEATHFADE 3
232#define ACTOR_FLAG_NOCHATTER 4
233#define ACTOR_FLAG_INACTIVE 5
234#define ACTOR_FLAG_ANIM_DONE 6
235#define ACTOR_FLAG_STATE_DONE_TIME_VALID 7
236#define ACTOR_FLAG_AI_ON 8
237#define ACTOR_FLAG_LAST_CANSEEENEMY 9
238#define ACTOR_FLAG_LAST_CANSEEENEMY_NOFOV 10
239#define ACTOR_FLAG_DIALOG_PLAYING 11
240#define ACTOR_FLAG_ALLOW_TALK 12
241#define ACTOR_FLAG_DAMAGE_ONCE_ON 13
242#define ACTOR_FLAG_DAMAGE_ONCE_DAMAGED 14
243#define ACTOR_FLAG_BOUNCE_OFF 15
244#define ACTOR_FLAG_NOTIFY_OTHERS_AT_DEATH 16
245#define ACTOR_FLAG_HAS_THING1 17
246#define ACTOR_FLAG_HAS_THING2 18
247#define ACTOR_FLAG_HAS_THING3 19
248#define ACTOR_FLAG_HAS_THING4 20
249#define ACTOR_FLAG_LAST_ATTACK_HIT 21
250#define ACTOR_FLAG_STARTED 22
251#define ACTOR_FLAG_ALLOW_HANGBACK 23
252#define ACTOR_FLAG_USE_GRAVITY 24
253#define ACTOR_FLAG_SPAWN_FAILED 25
254#define ACTOR_FLAG_FADING_OUT 26
255#define ACTOR_FLAG_DEATHSHRINK 27
256#define ACTOR_FLAG_DEATHSINK 28
257#define ACTOR_FLAG_STAYSOLID 29
258#define ACTOR_FLAG_STUNNED 30
259#define ACTOR_FLAG_ALLOW_FALL 31
260#define ACTOR_FLAG_FINISHED 32
261#define ACTOR_FLAG_IN_LIMBO 33
262#define ACTOR_FLAG_CAN_WALK_ON_OTHERS 34
263#define ACTOR_FLAG_PUSHABLE 35
264#define ACTOR_FLAG_LAST_TRY_TALK 36
265#define ACTOR_FLAG_ATTACKABLE_BY_ACTORS 37
266#define ACTOR_FLAG_TARGETABLE 38
267#define ACTOR_FLAG_ATTACK_ACTORS 39
268#define ACTOR_FLAG_IMMORTAL 40
269#define ACTOR_FLAG_TURNING_HEAD 41
270#define ACTOR_FLAG_DIE_COMPLETELY 42
271#define ACTOR_FLAG_BLEED_AFTER_DEATH 43
272#define ACTOR_FLAG_IGNORE_STUCK_WARNING 44
273#define ACTOR_FLAG_IGNORE_OFF_GROUND_WARNING 45
274#define ACTOR_FLAG_ALLOWED_TO_KILL 46
275#define ACTOR_FLAG_TOUCH_TRIGGERS 47
276#define ACTOR_FLAG_IGNORE_WATER 48
277#define ACTOR_FLAG_NEVER_IGNORE_SOUNDS 49
278#define ACTOR_FLAG_SIMPLE_PATHFINDING 50
279#define ACTOR_FLAG_HAVE_MOVED 51
280#define ACTOR_FLAG_NO_PAIN_SOUNDS 52
281#define ACTOR_FLAG_UPDATE_BOSS_HEALTH 53
282#define ACTOR_FLAG_IGNORE_PAIN_FROM_ACTORS 54
283#define ACTOR_FLAG_DAMAGE_ALLOWED 55
284#define ACTOR_FLAG_ALWAYS_GIVE_WATER 56
288#define LOOK_FLAG_EYE (1 << 0)
292#define ACTOR_FLAG_MAX 56
294#define MAX_ORIGIN_HISTORY 4
295#define MAX_COVER_NODES 16
296#define MAX_BODYQUEUE 5
308 AI_GRENSTATE_THROW_ACQUIRE,
310 AI_GRENSTATE_KICK_ACQUIRE,
312 AI_GRENSTATE_MARTYR_ACQUIRE,
315 AI_GRENSTATE_FLEE_SUCCESS,
316 AI_GRENSTATE_FLEE_FAIL,
352 THINK_DISGUISE_SALUTE,
353 THINK_DISGUISE_SENTRY,
354 THINK_DISGUISE_OFFICER,
355 THINK_DISGUISE_ROVER,
368 THINK_BALCONY_CURIOUS,
369 THINK_BALCONY_ATTACK,
370 THINK_BALCONY_DISGUISE,
371 THINK_BALCONY_GRENADE,
373 THINK_BALCONY_KILLED,
390enum eActorNationality {
391 ACTOR_NATIONALITY_DEFAULT,
392 ACTOR_NATIONALITY_AMERICAN,
393 ACTOR_NATIONALITY_GERMAN,
394 ACTOR_NATIONALITY_ITALIAN,
395 ACTOR_NATIONALITY_BRITISH,
396 ACTOR_NATIONALITY_RUSSIAN,
403 ACTOR_STATE_DISGUISE = 0,
404 ACTOR_STATE_TURRET = 100,
405 ACTOR_STATE_BALCONY_ATTACK = 200,
406 ACTOR_STATE_COVER = 300,
407 ACTOR_STATE_PAIN = 500,
408 ACTOR_STATE_ALARM = 600,
409 ACTOR_STATE_KILLED = 700,
410 ACTOR_STATE_BALCONY_KILLED = 800,
411 ACTOR_STATE_WEAPONLESS = 900,
412 ACTOR_STATE_ANIMATION = 1000,
413 ACTOR_STATE_CURIOUS = 1100,
414 ACTOR_STATE_MACHINE_GUNNER = 1200,
416 ACTOR_STATE_RUN_AND_SHOOT = 1300,
422enum eActorState_Disguise {
423 ACTOR_STATE_DISGUISE_START = ACTOR_STATE_DISGUISE,
424 ACTOR_STATE_DISGUISE_WAIT = ACTOR_STATE_DISGUISE_START,
425 ACTOR_STATE_DISGUISE_PAPERS,
426 ACTOR_STATE_DISGUISE_ACCEPT,
427 ACTOR_STATE_DISGUISE_ENEMY,
428 ACTOR_STATE_DISGUISE_HALT,
429 ACTOR_STATE_DISGUISE_DENY,
435enum eActorState_Turret {
436 ACTOR_STATE_TURRET_START = ACTOR_STATE_TURRET,
437 ACTOR_STATE_TURRET_COMBAT = ACTOR_STATE_TURRET_START,
438 ACTOR_STATE_TURRET_REACQUIRE,
439 ACTOR_STATE_TURRET_TAKE_SNIPER_NODE,
440 ACTOR_STATE_TURRET_SNIPER_NODE,
441 ACTOR_STATE_TURRET_RUN_HOME,
442 ACTOR_STATE_TURRET_RUN_AWAY,
443 ACTOR_STATE_TURRET_CHARGE,
444 ACTOR_STATE_TURRET_GRENADE,
445 ACTOR_STATE_TURRET_INTRO_AIM,
446 ACTOR_STATE_TURRET_FAKE_ENEMY,
447 ACTOR_STATE_TURRET_COVER_INSTEAD,
448 ACTOR_STATE_TURRET_BECOME_COVER,
449 ACTOR_STATE_TURRET_WAIT,
450 ACTOR_STATE_TURRET_SHOOT,
451 ACTOR_STATE_TURRET_RETARGET_SUPPRESS,
452 ACTOR_STATE_TURRET_RETARGET_SNIPER_NODE,
453 ACTOR_STATE_TURRET_RETARGET_STEP_SIDE_SMALL,
454 ACTOR_STATE_TURRET_RETARGET_PATH_EXACT,
455 ACTOR_STATE_TURRET_RETARGET_PATH_NEAR,
456 ACTOR_STATE_TURRET_RETARGET_STEP_SIDE_MEDIUM,
457 ACTOR_STATE_TURRET_RETARGET_STEP_SIDE_LARGE,
458 ACTOR_STATE_TURRET_RETARGET_STEP_FACE_MEDIUM,
459 ACTOR_STATE_TURRET_RETARGET_STEP_FACE_LARGE,
460 ACTOR_STATE_TURRET_NUM_STATES
466enum eActorState_BalconyAttack {
467 ACTOR_STATE_BALCONY_ATTACK_START = ACTOR_STATE_BALCONY_ATTACK,
468 ACTOR_STATE_BALCONY_ATTACK_FIND_ENEMY = ACTOR_STATE_BALCONY_ATTACK_START,
469 ACTOR_STATE_BALCONY_ATTACK_TARGET,
470 ACTOR_STATE_BALCONY_ATTACK_SHOOT
476enum eActorState_Cover {
477 ACTOR_STATE_COVER_START = ACTOR_STATE_COVER,
478 ACTOR_STATE_COVER_NEW_ENEMY = ACTOR_STATE_COVER_START,
479 ACTOR_STATE_COVER_FIND_COVER,
480 ACTOR_STATE_COVER_TAKE_COVER,
481 ACTOR_STATE_COVER_FINISH_RELOADING,
482 ACTOR_STATE_COVER_SPECIAL_ATTACK,
483 ACTOR_STATE_COVER_FIND_ENEMY,
484 ACTOR_STATE_COVER_SEARCH_NODE,
485 ACTOR_STATE_COVER_TARGET,
486 ACTOR_STATE_COVER_HIDE,
487 ACTOR_STATE_COVER_SHOOT,
488 ACTOR_STATE_COVER_GRENADE,
489 ACTOR_STATE_COVER_HUNT_ENEMY,
490 ACTOR_STATE_COVER_LOOP,
491 ACTOR_STATE_COVER_FAKE_ENEMY,
497enum eActorState_Pain {
498 ACTOR_STATE_PAIN_START = ACTOR_STATE_PAIN,
499 ACTOR_STATE_PAIN_INITIAL = ACTOR_STATE_PAIN_START,
500 ACTOR_STATE_PAIN_MAIN
506enum eActorState_Alarm {
507 ACTOR_STATE_ALARM_START = ACTOR_STATE_ALARM,
508 ACTOR_STATE_ALARM_IDLE = ACTOR_STATE_ALARM_START,
509 ACTOR_STATE_ALARM_MOVE
515enum eActorState_Killed {
516 ACTOR_STATE_KILLED_START = ACTOR_STATE_KILLED,
517 ACTOR_STATE_KILLED_BEGIN = ACTOR_STATE_KILLED_START,
518 ACTOR_STATE_KILLED_END
524enum eActorState_BalconyKilled {
525 ACTOR_STATE_BALCONY_KILLED_START = ACTOR_STATE_BALCONY_KILLED,
526 ACTOR_STATE_BALCONY_KILLED_BEGIN = ACTOR_STATE_BALCONY_KILLED_START,
527 ACTOR_STATE_BALCONY_KILLED_INTRO,
528 ACTOR_STATE_BALCONY_KILLED_LOOP,
529 ACTOR_STATE_BALCONY_KILLED_LOOP_END,
530 ACTOR_STATE_BALCONY_KILLED_OUTTRO,
531 ACTOR_STATE_BALCONY_KILLED_END,
532 ACTOR_STATE_BALCONY_KILLED_NORMAL,
538enum eActorState_WeaponLess {
539 ACTOR_STATE_WEAPONLESS_START = ACTOR_STATE_WEAPONLESS,
540 ACTOR_STATE_WEAPONLESS_NORMAL = ACTOR_STATE_WEAPONLESS_START,
541 ACTOR_STATE_WEAPONLESS_GRENADE,
542 ACTOR_STATE_WEAPONLESS_LOOP
548enum eActorState_Animation {
549 ACTOR_STATE_ANIMATION_START = ACTOR_STATE_ANIMATION,
550 ACTOR_STATE_ANIMATION_INITIAL = ACTOR_STATE_ANIMATION_START,
551 ACTOR_STATE_ANIMATION_MAIN,
557enum eActorState_Curious {
558 ACTOR_STATE_CURIOUS_START = ACTOR_STATE_CURIOUS,
559 ACTOR_STATE_CURIOUS_BEGIN = ACTOR_STATE_CURIOUS_START,
560 ACTOR_STATE_CURIOUS_RUNNING
566enum eActorState_MachineGunner {
567 ACTOR_STATE_MACHINE_GUNNER_START = ACTOR_STATE_MACHINE_GUNNER,
568 ACTOR_STATE_MACHINE_GUNNER_READY = ACTOR_STATE_MACHINE_GUNNER_START,
569 ACTOR_STATE_MACHINE_GUNNER_RELOADING
575enum eActorState_RunAndShoot {
576 ACTOR_STATE_RUN_AND_SHOOT_START = ACTOR_STATE_RUN_AND_SHOOT,
577 ACTOR_STATE_RUN_AND_SHOOT_RUN = ACTOR_STATE_RUN_AND_SHOOT_START,
578 ACTOR_STATE_RUN_AND_SHOOT_RUNNING
584class Actor :
public SimpleActor
586 struct GlobalFuncs_t {
587 void (Actor::*ThinkState)(void);
588 void (Actor::*BeginState)(void);
589 void (Actor::*ResumeState)(void);
590 void (Actor::*EndState)(void);
591 void (Actor::*SuspendState)(void);
592 void (Actor::*RestartState)(void);
593 void (Actor::*FinishedAnimation)(void);
594 void (Actor::*PostShoot)(void);
595 void (Actor::*Pain)(
Event *ev);
596 void (Actor::*Killed)(
Event *ev,
bool bPlayDeathAnim);
597 bool (Actor::*PassesTransitionConditions)(void);
598 void (Actor::*ShowInfo)(void);
599 void (Actor::*PathnodeClaimRevoked)(void);
600 void (Actor::*ReceiveAIEvent)(
601 vec3_t event_origin,
int iType,
Entity *originator,
float fDistSquared,
float fMaxDistSquared
603 bool (*IsState)(
int state);
614 static GlobalFuncs_t GlobalFuncs[NUM_THINKS];
616 static const_str m_csThinkNames[NUM_THINKS];
618 static const_str m_csThinkStateNames[NUM_THINKSTATES];
620 eThinkNum m_ThinkMap[NUM_THINKSTATES];
622 eThinkState m_ThinkStates[NUM_THINKLEVELS];
624 eThinkNum m_Think[NUM_THINKLEVELS];
629 eThinkLevel m_ThinkLevel;
631 eThinkState m_ThinkState;
637 bool m_bLockThinkState;
639 bool m_bDirtyThinkState;
641 const char *m_pszDebugState;
645 bool m_bIgnoreBadPlace;
647 int m_iBadPlaceIndex;
659 const_str m_csHeadModel;
661 const_str m_csHeadSkin;
663 const_str m_csWeapon;
665 const_str m_csLoadOut;
667 SentientPtr m_FavoriteEnemy;
669 int m_iEnemyCheckTime;
671 int m_iEnemyChangeTime;
673 int m_iEnemyVisibleCheckTime;
675 int m_iEnemyVisibleChangeTime;
677 int m_iLastEnemyVisibleTime;
679 float m_fVisibilityAlpha;
681 float m_fVisibilityThreshold;
683 int m_iEnemyFovCheckTime;
685 int m_iEnemyFovChangeTime;
689 int m_iLastEnemyPosChangeTime;
691 float m_fMaxShareDistSquared;
693 bool m_bCanShootEnemy;
695 bool m_bHasVisibilityThreshold;
697 int m_iCanShootCheckTime;
699 bool m_bDesiredEnableEnemy;
709 bool m_bEnemyIsDisguised;
711 bool m_bEnemyVisible;
715 bool m_bForceAttackPlayer;
717 bool m_bAutoAvoidPlayer;
719 bool m_bNoIdleAfterAnim;
721 bool m_bAnimScriptSet;
723 const_str m_csAnimScript;
727 float m_fRunAnimRate;
729 float m_fDfwRequestedYaw;
731 float m_fDfwDerivedYaw;
737 int m_iGunPositionCheckTime;
740 int m_iWallDodgeTimeout;
741 vec2_t m_PrevObstacleNormal;
744 float m_fMoveDoneRadiusSquared;
752 bool m_bBecomeRunner;
754 bool m_bPatrolWaitTrigger;
755 bool m_bScriptGoalValid;
757 int m_iNextWatchStepTime;
761 const_str m_csPatrolCurrentAnim;
762 int m_iSquadStandTime;
765 int m_iIntervalDirTime;
768 short m_sCurrentPathNodeIndex;
775 int m_iCuriousAnimHint;
777 int m_iNextDisguiseTime;
779 int m_iDisguisePeriod;
781 float m_fMaxDisguiseDistSquared;
783 int m_iEnemyShowPapersTime;
787 int m_iDisguiseLevel;
795 int m_iSuppressChance;
799 bool m_bTurretNoInitialCover;
801 PathNode *m_pPotentialCoverNode[MAX_COVER_NODES];
803 int m_iPotentialCoverCount;
807 const_str m_csSpecialAttack;
813 bool mbBreakSpecialAttack;
817 bool m_bGrenadeBounced;
823 int m_iFirstGrenadeTime;
825 eGrenadeState m_eGrenadeState;
827 eGrenadeTossMode m_eGrenadeMode;
835 float m_fBalconyHeight;
837 bool m_bNoPlayerCollision;
839 float m_fNoticeTimeScale;
841 float m_fMaxNoticeTimeScale;
849 float m_fSoundAwareness;
851 float m_fGrenadeAwareness;
853 int m_iIgnoreSoundsMask;
859 int m_iEyeUpdateTime;
865 float m_fLookAroundFov;
875 float m_fTurnDoneError;
877 float m_fAngleYawSpeed;
881 int m_eDontFaceWallMode;
882 int m_iLastFaceDecideTime;
884 vec2_t m_vOriginHistory[MAX_ORIGIN_HISTORY];
886 int m_iCurrentHistory;
887 bool m_bHeadAnglesAchieved;
888 bool m_bLUpperArmAnglesAchieved;
889 bool m_bTorsoAnglesAchieved;
892 float m_fHeadMaxTurnSpeed;
894 vec3_t m_vHeadDesiredAngles;
896 float m_fLUpperArmTurnSpeed;
898 vec3_t m_vLUpperArmDesiredAngles;
900 float m_fTorsoMaxTurnSpeed;
902 float m_fTorsoCurrentTurnSpeed;
904 vec3_t m_vTorsoDesiredAngles;
914 float m_fMinDistance;
916 float m_fMinDistanceSquared;
918 float m_fMaxDistance;
920 float m_fMaxDistanceSquared;
924 float m_fLeashSquared;
933 CLASS_PROTOTYPE(Actor);
936 void MoveTo(
Event *ev);
937 void WalkTo(
Event *ev);
938 void RunTo(
Event *ev);
939 void CrouchTo(
Event *ev);
940 void CrawlTo(
Event *ev);
941 void AimAt(
Event *ev);
942 void DefaultRestart(
void);
943 void SuspendState(
void);
944 void ResumeState(
void);
945 void BeginState(
void);
946 void EndState(
int level);
947 void RestartState(
void);
953 virtual void setContentsSolid(
void)
override;
954 void InitThinkStates(
void);
955 void UpdateEyeOrigin(
void);
956 bool RequireThink(
void);
957 void UpdateEnemy(
int iMaxDirtyTime);
958 void UpdateEnemyInternal(
void);
959 void DetectSmokeGrenades(
void);
960 void SetEnemy(Sentient *pEnemy,
bool bForceConfirmed);
961 void SetEnemyPos(
Vector vPos);
962 static void ResetBodyQueue(
void);
963 void AddToBodyQue(
void);
964 Vector GetAntiBunchPoint(
void);
965 static void InitVoid(GlobalFuncs_t *func);
966 virtual const char *DumpCallTrace(
const char *pszFmt, ...)
const override;
967 static void Init(
void);
968 void FixAIParameters(
void);
969 bool AttackEntryAnimation(
void);
970 void CheckForThinkStateTransition(
void);
971 bool CheckForTransition(eThinkState
state, eThinkLevel level);
972 bool PassesTransitionConditions_Grenade(
void);
973 bool PassesTransitionConditions_BadPlace(
void);
974 bool PassesTransitionConditions_Attack(
void);
975 bool PassesTransitionConditions_Disguise(
void);
976 bool PassesTransitionConditions_Curious(
void);
977 bool PassesTransitionConditions_Idle(
void);
978 void UpdateEnableEnemy(
void);
979 void ThinkStateTransitions(
void);
980 void TransitionState(
int iNewState,
int iPadTime = 0);
981 void ChangeAnim(
void);
982 void UpdateSayAnim(
void);
983 void UpdateUpperAnim(
void);
984 void UpdateAnim(
void);
985 virtual void StoppedWaitFor(const_str name,
bool bDeleting)
override;
986 static void InitTurret(GlobalFuncs_t *func);
987 void Begin_Turret(
void);
988 void End_Turret(
void);
989 void Suspend_Turret(
void);
990 void Think_Turret(
void);
991 void FinishedAnimation_Turret(
void);
992 void ReceiveAIEvent_Turret(
993 vec3_t event_origin,
int iType,
Entity *originator,
float fDistSquared,
float fMaxDistSquared
995 void InterruptPoint_Turret(
void);
996 void PathnodeClaimRevoked_Turret(
void);
997 bool Turret_IsRetargeting(
void)
const;
998 bool Turret_DecideToSelectState(
void);
999 void Turret_SelectState(
void);
1000 bool Turret_CheckRetarget(
void);
1001 bool Turret_TryToBecomeCoverGuy(
void);
1002 void Turret_BeginRetarget(
void);
1003 void Turret_NextRetarget(
void);
1004 void Turret_SideStep(
int iStepSize, vec3_t vDir);
1005 void State_Turret_Combat(
void);
1006 void State_Turret_Reacquire(
void);
1007 void State_Turret_TakeSniperNode(
void);
1008 void State_Turret_SniperNode(
void);
1009 bool State_Turret_RunHome(
bool bAttackOnFail);
1010 void State_Turret_RunAway(
void);
1011 void State_Turret_Charge(
void);
1012 void State_Turret_Grenade(
void);
1013 void State_Turret_FakeEnemy(
void);
1014 void State_Turret_Wait(
void);
1015 void State_Turret_Shoot(
void);
1016 void State_Turret_Retarget_Suppress(
void);
1017 void State_Turret_Retarget_Sniper_Node(
void);
1018 void State_Turret_Retarget_Step_Side_Small(
void);
1019 void State_Turret_Retarget_Path_Exact(
void);
1020 void State_Turret_Retarget_Path_Near(
void);
1021 void State_Turret_Retarget_Step_Side_Medium(
void);
1022 void State_Turret_Retarget_Step_Side_Large(
void);
1023 void State_Turret_Retarget_Step_Face_Medium(
void);
1024 void State_Turret_Retarget_Step_Face_Large(
void);
1025 static void InitCover(GlobalFuncs_t *func);
1026 bool Cover_IsValid(
PathNode *node);
1027 bool Cover_SetPath(
PathNode *node);
1028 void Cover_FindCover(
bool bCheckAll);
1029 void Begin_Cover(
void);
1030 void End_Cover(
void);
1031 void Suspend_Cover(
void);
1032 void Think_Cover(
void);
1033 void FinishedAnimation_Cover(
void);
1034 void PathnodeClaimRevoked_Cover(
void);
1035 void State_Cover_NewEnemy(
void);
1036 void State_Cover_FindCover(
void);
1037 void State_Cover_TakeCover(
void);
1038 void State_Cover_FinishReloading(
void);
1039 void State_Cover_SpecialAttack(
void);
1040 void State_Cover_Target(
void);
1041 void State_Cover_Hide(
void);
1042 void State_Cover_Shoot(
void);
1043 void State_Cover_Grenade(
void);
1044 void State_Cover_FindEnemy(
void);
1045 void State_Cover_SearchNode(
void);
1046 void State_Cover_HuntEnemy(
void);
1047 void State_Cover_FakeEnemy(
void);
1048 static void InitPatrol(GlobalFuncs_t *func);
1049 void Begin_Patrol(
void);
1050 void End_Patrol(
void);
1051 void Resume_Patrol(
void);
1052 void Think_Patrol(
void);
1053 void ShowInfo_Patrol(
void);
1054 void IdleThink(
void);
1055 static void InitRunner(GlobalFuncs_t *func);
1056 void Begin_Runner(
void);
1057 void End_Runner(
void);
1058 void Resume_Runner(
void);
1059 void Think_Runner(
void);
1060 void ShowInfo_Runner(
void);
1061 static void InitAlarm(GlobalFuncs_t *func);
1062 void Begin_Alarm(
void);
1063 void End_Alarm(
void);
1064 void State_Alarm_StartThread(
void);
1065 void State_Alarm_Move(
void);
1066 void State_Alarm_Idle(
void);
1067 void Think_Alarm(
void);
1068 void FinishedAnimation_Alarm(
void);
1069 static void InitNoClip(GlobalFuncs_t *func);
1070 bool IsNoClipState(
int state);
1071 void Think_NoClip(
void);
1077 bool CanTossGrenadeThroughHint(
1083 eGrenadeTossMode *peMode
1085 static Vector GrenadeThrowPoint(
const Vector& vFrom,
const Vector& vDelta, const_str csAnim);
1086 Vector CalcKickVelocity(
Vector &vDelta,
float fDist)
const;
1088 bool GrenadeWillHurtTeamAt(
const Vector &vTo);
1089 bool CanGetGrenadeFromAToB(
1090 const Vector &vFrom,
const Vector &vTo,
bool bDesperate,
Vector *pvVel, eGrenadeTossMode *peMode
1092 bool DecideToThrowGrenade(
const Vector &vTo,
Vector *pvVel, eGrenadeTossMode *peMode,
bool bDesperate);
1093 void Grenade_EventFire(
Event *ev);
1094 void GenericGrenadeTossThink(
void);
1095 static void InitGrenade(GlobalFuncs_t *func);
1096 bool Grenade_Acquire(eGrenadeState eNextState, const_str csReturnAnim);
1097 void Grenade_Flee(
void);
1098 void Grenade_ThrowAcquire(
void);
1099 void Grenade_Throw(
void);
1100 void Grenade_KickAcquire(
void);
1101 void Grenade_Kick(
void);
1102 void Grenade_MartyrAcquire(
void);
1103 void Grenade_Martyr(
void);
1104 void Grenade_Wait(
void);
1105 void Grenade_NextThinkState(
void);
1106 void Grenade_EventAttach(
Event *ev);
1107 void Grenade_EventDetach(
Event *ev);
1108 void Begin_Grenade(
void);
1109 void End_Grenade(
void);
1110 void Resume_Grenade(
void);
1111 void Think_Grenade(
void);
1112 void FinishedAnimation_Grenade(
void);
1113 static void InitCurious(GlobalFuncs_t *func);
1114 void SetCuriousAnimHint(
int iAnimHint);
1115 void Begin_Curious(
void);
1116 void End_Curious(
void);
1117 void Resume_Curious(
void);
1118 void Suspend_Curious(
void);
1119 void Think_Curious(
void);
1120 void FinishedAnimation_Curious(
void);
1121 void LookAtCuriosity(
void);
1122 void TimeOutCurious(
void);
1123 void State_Disguise_Wait(
void);
1124 void State_Disguise_Papers(
void);
1125 void State_Disguise_Fake_Papers(
void);
1126 void State_Disguise_Enemy(
void);
1127 void State_Disguise_Halt(
void);
1128 void State_Disguise_Accept(
void);
1129 void State_Disguise_Deny(
void);
1130 static void InitDisguiseSalute(GlobalFuncs_t *func);
1131 void Begin_DisguiseSalute(
void);
1132 void End_DisguiseSalute(
void);
1133 void Resume_DisguiseSalute(
void);
1134 void Suspend_DisguiseSalute(
void);
1135 void Think_DisguiseSalute(
void);
1136 void FinishedAnimation_DisguiseSalute(
void);
1137 static void InitDisguiseSentry(GlobalFuncs_t *func);
1138 void Begin_DisguiseSentry(
void);
1139 void End_DisguiseSentry(
void);
1140 void Resume_DisguiseSentry(
void);
1141 void Suspend_DisguiseSentry(
void);
1142 void Think_DisguiseSentry(
void);
1143 static void InitDisguiseOfficer(GlobalFuncs_t *func);
1144 void Begin_DisguiseOfficer(
void);
1145 void End_DisguiseOfficer(
void);
1146 void Resume_DisguiseOfficer(
void);
1147 void Suspend_DisguiseOfficer(
void);
1148 void Think_DisguiseOfficer(
void);
1149 static void InitDisguiseRover(GlobalFuncs_t *func);
1150 void Begin_DisguiseRover(
void);
1151 void End_DisguiseRover(
void);
1152 void Resume_DisguiseRover(
void);
1153 void Suspend_DisguiseRover(
void);
1154 void Think_DisguiseRover(
void);
1155 static void InitDisguiseNone(GlobalFuncs_t *func);
1156 static void InitIdle(GlobalFuncs_t *func);
1157 void Begin_Idle(
void);
1158 void Think_Idle(
void);
1159 static void InitMachineGunner(GlobalFuncs_t *func);
1160 void Begin_MachineGunner(
void);
1161 void End_MachineGunner(
void);
1162 void BecomeTurretGuy(
void);
1163 void ThinkHoldGun_TurretGun(
void);
1164 void Think_MachineGunner_TurretGun(
void);
1165 void Think_MachineGunner(
void);
1166 void FinishedAnimation_MachineGunner(
void);
1167 bool MachineGunner_CanSee(
Entity *ent,
float fov,
float vision_distance);
1168 static void InitDogIdle(GlobalFuncs_t *func);
1169 static void InitDogAttack(GlobalFuncs_t *func);
1170 static void InitDogCurious(GlobalFuncs_t *func);
1171 void Begin_Dog(
void);
1173 void Think_Dog_Idle(
void);
1174 void Think_Dog_Attack(
void);
1175 void Think_Dog_Curious(
void);
1176 static void InitAnim(GlobalFuncs_t *func);
1177 void Begin_Anim(
void);
1178 void Think_Anim(
void);
1179 void FinishedAnimation_Anim(
void);
1180 void ShowInfo_Anim(
void);
1181 static void InitAnimCurious(GlobalFuncs_t *func);
1182 void Begin_AnimCurious(
void);
1183 void Think_AnimCurious(
void);
1184 void FinishedAnimation_AnimCurious(
void);
1185 static void InitAim(GlobalFuncs_t *func);
1186 void Begin_Aim(
void);
1187 void Think_Aim(
void);
1188 void ShowInfo_Aim(
void);
1189 static void InitBalconyIdle(GlobalFuncs_t *func);
1190 static void InitBalconyCurious(GlobalFuncs_t *func);
1191 static void InitBalconyAttack(GlobalFuncs_t *func);
1192 static void InitBalconyDisguise(GlobalFuncs_t *func);
1193 static void InitBalconyGrenade(GlobalFuncs_t *func);
1194 static void InitBalconyPain(GlobalFuncs_t *func);
1195 static void InitBalconyKilled(GlobalFuncs_t *func);
1196 void Pain_Balcony(
Event *ev);
1197 void Killed_Balcony(
Event *ev,
bool bPlayDeathAnim);
1198 void Think_BalconyAttack(
void);
1199 void Begin_BalconyAttack(
void);
1200 void FinishedAnimation_BalconyAttack(
void);
1201 void State_Balcony_PostShoot(
void);
1202 void State_Balcony_FindEnemy(
void);
1203 void State_Balcony_Target(
void);
1204 void State_Balcony_Shoot(
void);
1205 void Begin_BalconyKilled(
void);
1206 void End_BalconyKilled(
void);
1207 void Think_BalconyKilled(
void);
1208 void FinishedAnimation_BalconyKilled(
void);
1209 bool CalcFallPath(
void);
1210 static void InitPain(GlobalFuncs_t *func);
1211 void Begin_Pain(
void);
1212 void Think_Pain(
void);
1213 void FinishedAnimation_Pain(
void);
1214 static void InitDead(GlobalFuncs_t *func);
1215 static void InitKilled(GlobalFuncs_t *func);
1216 void Begin_Killed(
void);
1217 void Think_Killed(
void);
1218 void FinishedAnimation_Killed(
void);
1219 static void InitWeaponless(GlobalFuncs_t *func);
1220 void Begin_Weaponless(
void);
1221 void Suspend_Weaponless(
void);
1222 void Think_Weaponless(
void);
1223 void FinishedAnimation_Weaponless(
void);
1224 void State_Weaponless_Normal(
void);
1225 void State_Weaponless_Grenade(
void);
1226 static void InitBadPlace(GlobalFuncs_t *func);
1229 void Begin_BadPlace(
void);
1230 void End_BadPlace(
void);
1231 void Think_BadPlace(
void);
1235 static void InitRunAndShoot(GlobalFuncs_t *func);
1236 void Begin_RunAndShoot(
void);
1237 void End_RunAndShoot(
void);
1238 void Resume_RunAndShoot(
void);
1239 void Think_RunAndShoot(
void);
1240 void ShowInfo_RunAndShoot(
void);
1241 void State_RunAndShoot_Running(
void);
1242 bool RunAndShoot_MoveToPatrolCurrentNode(
void);
1244 virtual void Think(
void)
override;
1245 void PostThink(
bool bDontFaceWall);
1246 virtual void SetMoveInfo(mmove_t *mm)
override;
1247 virtual void GetMoveInfo(mmove_t *mm)
override;
1248 void DoFailSafeMove(vec3_t dest);
1249 void TouchStuff(mmove_t *mm);
1250 void ExtractConstraints(mmove_t *mm);
1251 void EventGiveWeaponInternal(
Event *ev);
1252 void EventGiveWeapon(
Event *ev);
1253 void EventGetWeapon(
Event *ev);
1254 void FireWeapon(
Event *ev);
1255 bool FriendlyInLineOfFire(
Entity *other);
1256 Vector VirtualEyePosition();
1257 virtual bool CanTarget(
void)
override;
1258 virtual bool IsImmortal(
void)
override;
1259 static bool IsVoidState(
int state);
1260 static bool IsIdleState(
int state);
1261 static bool IsCuriousState(
int state);
1262 static bool IsDisguiseState(
int state);
1263 static bool IsAttackState(
int state);
1264 static bool IsGrenadeState(
int state);
1265 static bool IsBadPlaceState(
int state);
1266 static bool IsPainState(
int state);
1267 static bool IsKilledState(
int state);
1268 static bool IsMachineGunnerState(
int state);
1269 static bool IsDogState(
int state);
1270 void IgnoreSoundSet(
int iType);
1271 void IgnoreSoundSetAll(
void);
1272 void IgnoreSoundClear(
int iType);
1273 void IgnoreSoundClearAll(
void);
1274 bool IgnoreSound(
int iType);
1275 void EventShareEnemy(
Event *ev);
1276 void EventShareGrenade(
Event *ev);
1277 void ReceiveAIEvent(vec3_t event_origin,
int iType,
Entity *originator,
float fDistSquared,
float fMaxDistSquared);
1278 void DefaultReceiveAIEvent(
1279 vec3_t event_origin,
int iType,
Entity *originator,
float fDistSquared,
float fMaxDistSquared
1281 int PriorityForEventType(
int iType);
1282 void CuriousSound(
int iType, vec3_t sound_origin,
float fDistSquared,
float fMaxDistSquared);
1283 void WeaponSound(
int iType, vec3_t sound_origin,
float fDistSquared,
float fMaxDistSquared,
Entity *originator);
1284 void FootstepSound(vec3_t sound_origin,
float fDistSquared,
float fMaxDistSquared,
Entity *originator);
1285 void VoiceSound(
int iType, vec3_t sound_origin,
float fDistSquared,
float fMaxDistSquared,
Entity *originator);
1286 void GrenadeNotification(
Entity *originator);
1287 void SetGrenade(
Entity *pGrenade);
1288 void UpdateBadPlaces(
void);
1289 void NotifySquadmateKilled(Sentient *pSquadMate, Sentient *pAttacker);
1290 void RaiseAlertnessForEventType(
int iType);
1291 void RaiseAlertness(
float fAmount);
1292 virtual bool CanSee(
Entity *e1,
float fov,
float vision_distance,
bool bNoEnts)
override;
1293 using Sentient::CanSee;
1294 virtual Vector GunPosition(
void)
override;
1295 bool WithinVisionDistance(
Entity *ent)
const;
1296 bool InFOV(
Vector pos,
float check_fov,
float check_fovdot);
1297 bool EnemyInFOV(
int iMaxDirtyTime);
1300 bool CanSeeNoFOV(
Entity *ent);
1301 bool CanSeeFOV(
Entity *ent);
1302 bool CanSeeEnemyFOV(
int iMaxFovDirtyTime,
int iMaxSightDirtyTime);
1303 bool CanShoot(
Entity *ent);
1304 virtual bool CanSeeFrom(vec3_t pos,
Entity *ent);
1305 bool CanSeeEnemy(
int iMaxDirtyTime);
1306 bool CanShootEnemy(
int iMaxDirtyTime);
1307 void ShowInfo(
void);
1308 virtual void ShowInfo(
float fDot,
float fDist)
override;
1309 void DefaultPain(
Event *ev);
1310 void HandlePain(
Event *ev);
1311 void EventPain(
Event *ev);
1312 void DefaultKilled(
Event *ev,
bool bPlayDeathAnim);
1313 void HandleKilled(
Event *ev,
bool bPlayDeathAnim);
1314 void DispatchEventKilled(
Event *ev,
bool bPlayDeathAnim);
1315 void EventKilled(
Event *ev);
1316 void EventBeDead(
Event *ev);
1317 void DeathEmbalm(
Event *ev);
1318 void DeathSinkStart(
Event *ev);
1319 bool NoticeShot(Sentient *pShooter, Sentient *pTarget,
float fDist);
1320 bool NoticeFootstep(Sentient *pPedestrian);
1321 bool NoticeVoice(Sentient *pVocallist);
1322 void ClearLookEntity(
void);
1323 void LookAt(
const Vector &vec);
1325 void ForwardLook(
void);
1326 void LookAtLookEntity(
void);
1327 void IdleLook(
void);
1328 void IdleLook(vec3_t dir);
1329 void SetDesiredLookDir(vec3_t dir);
1330 void SetDesiredLookAnglesRelative(vec3_t ang);
1331 void EventLookAt(
Event *ev);
1332 void EventEyesLookAt(
Event *ev);
1334 void IdlePoint(
void);
1335 void ClearPointEntity(
void);
1336 void PointAt(
const Vector &vec);
1338 void EventPointAt(
Event *ev);
1339 void ClearTurnEntity(
void);
1340 void TurnTo(
const Vector &vec);
1342 void IdleTurn(
void);
1343 void EventTurnTo(
Event *ev);
1344 void EventSetTurnDoneError(
Event *ev);
1345 void EventGetTurnDoneError(
Event *ev);
1346 void LookAround(
float fFovAdd);
1347 bool SoundSayAnim(const_str name,
byte bLevelSayAnim);
1348 void EventSetAnim(
Event *ev);
1349 void EventIdleSayAnim(
Event *ev);
1350 void EventSayAnim(
Event *ev);
1351 void EventSetSayAnim(
Event *ev);
1352 void EventSetMotionAnim(
Event *ev);
1353 void EventSetAimMotionAnim(
Event *ev);
1354 void EventSetActionAnim(
Event *ev);
1355 void EventUpperAnim(
Event *ev);
1356 void EventSetUpperAnim(
Event *ev);
1357 void EventEndActionAnim(
Event *ev);
1358 void EventDamagePuff(
Event *ev);
1359 void SafeSetOrigin(vec3_t newOrigin);
1361 void AnimFinished(
int slot,
bool stop);
1362 virtual void AnimFinished(
int slot)
override;
1363 void PlayAnimation(
Event *ev);
1364 void PlayScriptedAnimation(
Event *ev);
1365 void PlayNoclipAnimation(
Event *ev);
1366 void PlayAttachedAnimation(
Event *ev);
1367 void MoveDest(
float fMoveSpeed);
1368 void MovePath(
float fMoveSpeed);
1369 void MovePathGoal(
float fMoveSpeed);
1370 void Dumb(
Event *ev);
1371 void PhysicsOn(
Event *ev);
1372 void PhysicsOff(
Event *ev);
1373 void EventStart(
Event *ev);
1374 void EventGetMood(
Event *ev);
1375 void EventSetMood(
Event *ev);
1376 void EventGetAngleYawSpeed(
Event *ev);
1377 void EventSetAngleYawSpeed(
Event *ev);
1378 void EventSetAimTarget(
Event *ev);
1379 void UpdateAngles(
void);
1380 void SetLeashHome(
Vector vHome);
1381 void AimAtTargetPos(
void);
1382 void AimAtAimNode(
void);
1383 void AimAtEnemyBehavior(
void);
1384 void FaceMotion(
void);
1385 void FaceDirectionDuringMotion(vec3_t vLook);
1386 float PathDistanceAlongVector(vec3_t vDir);
1387 void FaceEnemyOrMotion(
int iTimeIntoMove);
1388 static int NextUpdateTime(
int iLastUpdateTime,
int iUpdatePeriod);
1389 void ResetBoneControllers(
void);
1390 void UpdateBoneControllers(
void);
1391 void ReadyToFire(
Event *ev);
1392 void EventGetSight(
Event *ev);
1393 void EventSetSight(
Event *ev);
1394 void EventGetHearing(
Event *ev);
1395 void EventSetHearing(
Event *ev);
1396 void ClearPatrolCurrentNode(
void);
1397 void NextPatrolCurrentNode(
void);
1398 void SetPatrolCurrentNode(
Vector &vec);
1399 void SetPatrolCurrentNode(
Listener *l);
1400 void EventSetPatrolPath(
Event *ev);
1401 void EventGetPatrolPath(
Event *ev);
1402 void EventSetPatrolWaitTrigger(
Event *ev);
1403 void EventGetPatrolWaitTrigger(
Event *ev);
1404 void ShowInfo_PatrolCurrentNode(
void);
1405 bool MoveOnPathWithSquad(
void);
1406 bool MoveToWaypointWithPlayer(
void);
1407 bool PatrolNextNodeExists(
void);
1408 void UpdatePatrolCurrentNode(
void);
1409 bool MoveToPatrolCurrentNode(
void);
1410 void ClearAimNode(
void);
1411 void SetAimNode(
const Vector &vec);
1413 void ShowInfo_AimNode(
void);
1414 void EventSetAccuracy(
Event *ev);
1415 void EventGetAccuracy(
Event *ev);
1416 int GetThinkType(const_str csName);
1417 void SetThink(eThinkState
state, eThinkNum think);
1418 void SetThinkIdle(eThinkNum think_idle);
1419 void SetThinkState(eThinkState
state, eThinkLevel level);
1420 void EndCurrentThinkState(
void);
1421 void ClearThinkStates(
void);
1422 int CurrentThink(
void)
const;
1423 bool IsAttacking(
void)
const;
1424 void EventGetFov(
Event *ev);
1425 void EventSetFov(
Event *ev);
1426 void EventSetDestIdle(
Event *ev);
1427 void EventSetDestIdle2(
Event *ev);
1428 void EventSetTypeIdle(
Event *ev);
1429 void EventGetTypeIdle(
Event *ev);
1430 void EventSetTypeAttack(
Event *ev);
1431 void EventGetTypeAttack(
Event *ev);
1432 void EventSetTypeDisguise(
Event *ev);
1433 void EventGetTypeDisguise(
Event *ev);
1434 void EventSetDisguiseLevel(
Event *ev);
1435 void EventGetDisguiseLevel(
Event *ev);
1436 void EventSetTypeGrenade(
Event *ev);
1437 void EventGetTypeGrenade(
Event *ev);
1438 void EventSetMinDistance(
Event *ev);
1439 void EventGetMinDistance(
Event *ev);
1440 void EventSetMaxDistance(
Event *ev);
1441 void EventGetMaxDistance(
Event *ev);
1442 void EventGetLeash(
Event *ev);
1443 void EventSetLeash(
Event *ev);
1444 void EventGetInterval(
Event *ev);
1445 void EventSetInterval(
Event *ev);
1446 void EventDistToEnemy(
Event *ev);
1447 void EventGetRunAnim(
Event *ev);
1448 void EventGetWalkAnim(
Event *ev);
1449 void EventGetAnimName(
Event *ev);
1450 void EventSetAnimName(
Event *ev);
1451 void EventSetDisguiseRange(
Event *ev);
1452 void EventGetDisguiseRange(
Event *ev);
1453 void EventSetDisguisePeriod(
Event *ev);
1454 void EventGetDisguisePeriod(
Event *ev);
1455 void EventSetDisguiseAcceptThread(
Event *ev);
1456 void EventGetDisguiseAcceptThread(
Event *ev);
1457 void EventAttackPlayer(
Event *ev);
1458 void ForceAttackPlayer(
void);
1459 void EventSetAlarmNode(
Event *ev);
1460 void EventGetAlarmNode(
Event *ev);
1461 void EventSetPreAlarmThread(
Event *ev);
1462 void EventSetAlarmThread(
Event *ev);
1463 void EventGetAlarmThread(
Event *ev);
1464 void EventSetSoundAwareness(
Event *ev);
1465 void EventGetSoundAwareness(
Event *ev);
1466 void EventSetGrenadeAwareness(
Event *ev);
1467 void EventGetGrenadeAwareness(
Event *ev);
1468 str ThinkName(
void)
const;
1469 str ThinkStateName(
void)
const;
1470 void EventSetTurret(
Event *ev);
1471 void EventGetTurret(
Event *ev);
1472 void EventEnableEnemy(
Event *ev);
1473 void EventEnablePain(
Event *ev);
1474 void EventActivate(
Event *ev);
1475 void EventGetAmmoGrenade(
Event *ev);
1476 void EventSetAmmoGrenade(
Event *ev);
1477 void EventInterruptPoint(
Event *ev);
1480 void EventGetVisibilityThreshold(
Event *ev);
1481 void EventSetVisibilityThreshold(
Event *ev);
1482 void EventSetDefaultVisibilityThreshold(
Event *ev);
1483 void EventGetSuppressChance(
Event *ev);
1484 void EventSetSuppressChance(
Event *ev);
1486 void EventAnimScript(
Event *ev);
1487 void EventAnimScript_Scripted(
Event *ev);
1488 void EventAnimScript_Noclip(
Event *ev);
1489 void EventAnimScript_Attached(
Event *ev);
1490 void EventReload_mg42(
Event *ev);
1491 void SetPathWithLeash(
Vector vDestPos,
const char *description,
int iMaxDirtyTime);
1492 void SetPathWithLeash(
SimpleEntity *pDestNode,
const char *description,
int iMaxDirtyTime);
1493 void FindPathAwayWithLeash(vec3_t vAwayFrom, vec3_t vDirPreferred,
float fMinSafeDist);
1494 void FindPathNearWithLeash(vec3_t vNearbyTo,
float fCloseDistSquared);
1495 bool CanMovePathWithLeash(
void)
const;
1496 bool MovePathWithLeash(
void);
1497 bool ShortenPathToAttack(
float fMinDist);
1498 void StrafeToAttack(
float fDist, vec3_t vDir);
1499 virtual Vector GunTarget(
bool bNoCollision,
const vec3_t position,
const vec3_t forward)
override;
1500 virtual qboolean setModel(
void)
override;
1501 void EventSetHeadModel(
Event *ev);
1502 void EventGetHeadModel(
Event *ev);
1503 void EventSetHeadSkin(
Event *ev);
1504 void EventGetHeadSkin(
Event *ev);
1505 void EventSetNoIdle(
Event *ev);
1506 void EventGetNoIdle(
Event *ev);
1507 void EventGetEnemy(
Event *ev);
1508 void EventSetMaxNoticeTimeScale(
Event *ev);
1509 void EventGetMaxNoticeTimeScale(
Event *ev);
1510 void EventSetFixedLeash(
Event *ev);
1511 void EventGetFixedLeash(
Event *ev);
1513 void HolsterOffHand(
void);
1514 void Unholster(
void);
1515 void UnholsterOffHand(
void);
1516 void EventHolster(
Event *ev);
1517 void EventUnholster(
Event *ev);
1518 void EventSoundDone(
Event *ev);
1519 void EventSound(
Event *ev);
1520 void EventIsEnemyVisible(
Event *ev);
1521 void EventGetEnemyVisibleChangeTime(
Event *ev);
1522 void EventGetLastEnemyVisibleTime(
Event *ev);
1523 void EventSetFallHeight(
Event *ev);
1524 void EventGetFallHeight(
Event *ev);
1525 void EventCanMoveTo(
Event *ev);
1526 void EventMoveDir(
Event *ev);
1527 void EventIntervalDir(
Event *ev);
1528 void EventResetLeash(
Event *ev);
1529 void EventTether(
Event *ev);
1530 void EventGetThinkState(
Event *ev);
1531 void EventGetEnemyShareRange(
Event *ev);
1532 void EventSetEnemyShareRange(
Event *ev);
1533 void EventGetKickDir(
Event *ev);
1534 void EventGetNoLongPain(
Event *ev);
1535 void EventSetNoLongPain(
Event *ev);
1536 void EventGetFavoriteEnemy(
Event *ev);
1537 void EventSetFavoriteEnemy(
Event *ev);
1538 void EventFindEnemy(
Event *ev);
1539 void EventGetMumble(
Event *ev);
1540 void EventSetMumble(
Event *ev);
1541 void EventGetBreathSteam(
Event *ev);
1542 void EventSetBreathSteam(
Event *ev);
1543 void EventSetNextBreathTime(
Event *ev);
1544 void EventCalcGrenadeToss2(
Event *ev);
1545 void EventCalcGrenadeToss(
Event *ev);
1546 void EventGetNoSurprise(
Event *ev);
1547 void EventSetNoSurprise(
Event *ev);
1548 void EventGetSilent(
Event *ev);
1549 void EventSetSilent(
Event *ev);
1550 void EventGetAvoidPlayer(
Event *ev);
1551 void EventSetAvoidPlayer(
Event *ev);
1552 void EventGetLookAroundAngle(
Event *ev);
1553 void EventSetLookAroundAngle(
Event *ev);
1554 void EventHasCompleteLookahead(
Event *ev);
1555 void EventPathDist(
Event *ev);
1556 void EventCanShootEnemyFrom(
Event *ev);
1557 void EventCanShoot(
Event *ev);
1558 void EventSetInReload(
Event *ev);
1559 void EventGetInReload(
Event *ev);
1560 void EventSetReloadCover(
Event *ev);
1561 void EventBreakSpecial(
Event *ev);
1562 void GetVoiceType(
Event *ev);
1563 void SetVoiceType(
Event *ev);
1564 void ResolveVoiceType(
void);
1565 void EventSetBalconyHeight(
Event *ev);
1566 void EventGetBalconyHeight(
Event *ev);
1569 void EventSetIgnoreBadPlace(
Event *ev);
1570 void EventGetIgnoreBadPlace(
Event *ev);
1571 void EventEnableEnemySwitch(
Event *ev);
1572 void EventDisableEnemySwitch(
Event *ev);
1573 void EventSetRunAnimRate(
Event *ev);
1574 void EventGetRunAnimRate(
Event *ev);
1575 void Landed(
Event *ev);
1576 bool IsOnFloor(
void);
1580 void GetNationality(
Event *ev);
1581 void SetNationality(
Event *ev);
1582 void EventWriteStats(
Event *ev);
1583 void EventCuriousOff(
Event *ev);
1584 void EventCuriousOn(
Event *ev);
1586 PathNode *FindSniperNodeAndSetPath(
bool *pbTryAgain);
1587 void Remove(
Event *ev);
1588 void DontFaceWall(
void);
1589 bool AvoidingFacingWall(
void)
const;
1590 void EndStates(
void);
1591 void ClearStates(
void);
1592 void CheckUnregister(
void);
1593 void BecomeCorpse(
void);
1594 virtual void PathnodeClaimRevoked(
PathNode *node)
override;
1595 void SetPathToNotBlockSentient(Sentient *pOther);
1596 void EventSetMoveDoneRadius(
Event *ev);
1597 void EventGetMoveDoneRadius(
Event *ev);
1598 virtual void ClearEnemies(
void)
override;
1599 bool EnemyIsDisguised(
void);
1600 virtual void setOriginEvent(
Vector org)
override;
1601 virtual void DumpAnimInfo(
void)
override;
1602 static void ArchiveStatic(
Archiver &arc);
1603 virtual void Archive(
Archiver& arc)
override;
1604 virtual bool AutoArchiveModel(
void)
override;
1605 virtual bool IsDisabled()
const override;
1608#define SAVE_FLAG_NEW_ANIM (1 << 0)
1609#define SAVE_FLAG_FORWARD_SPEED (1 << 1)
1610#define SAVE_FLAG_BEHAVIOR (1 << 2)
1611#define SAVE_FLAG_PATH (1 << 3)
1612#define SAVE_FLAG_NOISE (1 << 4)
1613#define SAVE_FLAG_SCRIPT_THREAD (1 << 5)
1614#define SAVE_FLAG_ACTOR_THREAD (1 << 6)
1615#define SAVE_FLAG_KILL_THREAD (1 << 7)
1616#define SAVE_FLAG_STATE (1 << 8)
1617#define SAVE_FLAG_IDLE_THREAD (1 << 7)
1618#define SAVE_FLAG_PARTS (1 << 10)
1619#define SAVE_FLAG_TRIGGER (1 << 11)
1620#define SAVE_FLAG_STATE_FLAGS (1 << 12)
1621#define SAVE_FLAG_COMMAND (1 << 13)
1622#define SAVE_FLAG_STAGE (1 << 14)
1623#define SAVE_FLAG_NUM_OF_SPAWNS (1 << 15)
1624#define SAVE_FLAG_SPAWN_PARENT (1 << 16)
1625#define SAVE_FLAG_DIALOG (1 << 17)
1626#define SAVE_FLAG_SAVED_STUFF (1 << 18)
1627#define SAVE_FLAG_LAST_ANIM_EVENT (1 << 19)
1628#define SAVE_FLAG_PICKUP_ENT (1 << 20)
1629#define SAVE_FLAG_PAIN (1 << 21)
1630#define SAVE_FLAG_SPAWN_ITEMS (1 << 22)
1638inline void Actor::TransitionState(
int iNewState,
int iPadTime)
1640 m_State = iNewState;
1641 m_iStateTime = level.inttime + iPadTime;
1651inline int Actor::NextUpdateTime(
int iLastUpdateTime,
int iUpdatePeriod)
1653 int i = iLastUpdateTime;
1657 }
while (i < level.inttime);
1669inline bool Actor::InFOV(
Vector pos)
1671 return InFOV(pos, m_fFov, m_fFovDot);
1681inline bool Actor::InFOV(
Entity *ent)
1683 if (ent == m_Enemy) {
1684 return EnemyInFOV(0);
1686 return InFOV(ent->centroid);
1690inline bool Actor::CanSeeNoFOV(
Entity *ent)
1694 if (ent == m_Enemy) {
1695 return CanSeeEnemy(0);
1700 if (gi.AreasConnected(edict->r.areanum, ent->edict->r.areanum)) {
1701 bCanSee = CanSee(ent, 0, 0,
false);
1707inline bool Actor::CanSeeFOV(
Entity *ent)
1711 if (ent == m_Enemy) {
1712 return CanSeeEnemyFOV(0, 0);
1717 if (InFOV(ent) && AreasConnected(ent)) {
1718 bCanSee = CanSee(ent, 0, 0,
false);
1724inline bool Actor::CanSeeEnemyFOV(
int iMaxFovDirtyTime,
int iMaxSightDirtyTime)
1726 return EnemyInFOV(iMaxFovDirtyTime) && CanSeeEnemy(iMaxSightDirtyTime);
1736inline void Actor::AimAtTargetPos(
void)
1740 v = mTargetPos - EyePosition();
1744 SetDesiredLookDir(v2);
1746 m_DesiredGunDir[0] = 360.0f - v.toPitch();
1747 m_DesiredGunDir[1] = v.toYaw();
1748 m_DesiredGunDir[2] = 0;
1750 SetDesiredYaw(m_DesiredGunDir[1]);
1760inline void Actor::AimAtAimNode(
void)
1762 mTargetPos = m_aimNode->centroid;
1774inline void Actor::IgnoreSoundSet(
int iType)
1776 m_iIgnoreSoundsMask |= 1 << iType;
1786inline void Actor::IgnoreSoundSetAll(
void)
1788 m_iIgnoreSoundsMask = 0xffff;
1798inline void Actor::IgnoreSoundClear(
int iType)
1800 m_iIgnoreSoundsMask &= ~(1 << iType);
1810inline void Actor::IgnoreSoundClearAll(
void)
1812 m_iIgnoreSoundsMask = 0;
1822inline bool Actor::IgnoreSound(
int iType)
1824 return (m_iIgnoreSoundsMask >> iType) & 1;
1834inline int Actor::CurrentThink(
void)
const
1836 return m_Think[m_ThinkLevel];
1846inline bool Actor::IsAttacking(
void)
const
1848 return m_ThinkStates[THINKLEVEL_IDLE] == THINKSTATE_ATTACK;
1851inline void Actor::ArchiveStatic(
Archiver& arc)
1853 for (
int i = 0; i < MAX_BODYQUEUE; i++) {
1854 arc.ArchiveSafePointer(&mBodyQueue[i]);
1857 arc.ArchiveInteger(&mCurBody);
1860inline void Actor::Archive(
Archiver& arc)
1864 SimpleActor::Archive(arc);
1866 for (i = 0; i < NUM_THINKSTATES; i++) {
1867 ArchiveEnum(m_ThinkMap[i], eThinkNum);
1870 for (i = 0; i < NUM_THINKLEVELS; i++) {
1871 ArchiveEnum(m_ThinkStates[i], eThinkState);
1872 ArchiveEnum(m_Think[i], eThinkNum);
1875 ArchiveEnum(m_ThinkLevel, eThinkLevel);
1876 ArchiveEnum(m_ThinkState, eThinkState);
1877 arc.ArchiveInteger(&m_State);
1878 arc.ArchiveInteger(&m_iStateTime);
1879 arc.ArchiveBool(&m_bLockThinkState);
1880 arc.ArchiveBool(&m_bDirtyThinkState);
1882 arc.ArchiveBool(&m_bAnimating);
1884 arc.ArchiveBool(&m_bIgnoreBadPlace);
1885 arc.ArchiveInteger(&m_iBadPlaceIndex);
1887 arc.ArchiveInteger(&mVoiceType);
1888 arc.ArchiveBool(&m_bSilent);
1890 arc.ArchiveBool(&m_bNoSurprise);
1891 arc.ArchiveBool(&m_bMumble);
1892 arc.ArchiveBool(&m_bBreathSteam);
1893 arc.ArchiveBool(&m_bIsCurious);
1895 Director.ArchiveString(arc, m_csHeadModel);
1896 Director.ArchiveString(arc, m_csHeadSkin);
1897 Director.ArchiveString(arc, m_csWeapon);
1898 Director.ArchiveString(arc, m_csLoadOut);
1900 arc.ArchiveSafePointer(&m_FavoriteEnemy);
1901 arc.ArchiveInteger(&m_iEnemyCheckTime);
1902 arc.ArchiveInteger(&m_iEnemyChangeTime);
1903 arc.ArchiveInteger(&m_iEnemyVisibleCheckTime);
1904 arc.ArchiveInteger(&m_iEnemyVisibleChangeTime);
1905 arc.ArchiveInteger(&m_iLastEnemyVisibleTime);
1906 arc.ArchiveFloat(&m_fVisibilityAlpha);
1907 arc.ArchiveFloat(&m_fVisibilityThreshold);
1908 arc.ArchiveInteger(&m_iEnemyFovCheckTime);
1909 arc.ArchiveInteger(&m_iEnemyFovChangeTime);
1910 arc.ArchiveVector(&m_vLastEnemyPos);
1911 arc.ArchiveInteger(&m_iLastEnemyPosChangeTime);
1912 arc.ArchiveFloat(&m_fMaxShareDistSquared);
1913 arc.ArchiveInteger(&m_iCanShootCheckTime);
1914 arc.ArchiveBool(&m_bCanShootEnemy);
1915 arc.ArchiveBool(&m_bHasVisibilityThreshold);
1916 arc.ArchiveBool(&m_bDesiredEnableEnemy);
1917 arc.ArchiveBool(&m_bEnableEnemy);
1918 arc.ArchiveBool(&m_bEnablePain);
1919 arc.ArchiveBool(&m_bNoLongPain);
1920 arc.ArchiveBool(&m_bNewEnemy);
1921 arc.ArchiveBool(&m_bEnemyIsDisguised);
1922 arc.ArchiveBool(&m_bEnemyVisible);
1923 arc.ArchiveBool(&m_bEnemyInFOV);
1924 arc.ArchiveBool(&m_bForceAttackPlayer);
1925 arc.ArchiveBool(&m_bAutoAvoidPlayer);
1927 arc.ArchiveBool(&m_bNoIdleAfterAnim);
1928 Director.ArchiveString(arc, m_csAnimScript);
1929 arc.ArchiveBool(&m_bAnimScriptSet);
1930 arc.ArchiveInteger(&m_AnimMode);
1931 arc.ArchiveFloat(&m_fRunAnimRate);
1932 arc.ArchiveFloat(&m_fDfwRequestedYaw);
1933 arc.ArchiveFloat(&m_fDfwDerivedYaw);
1934 arc.ArchiveVector(&m_vDfwPos);
1935 arc.ArchiveFloat(&m_fDfwTime);
1936 arc.ArchiveInteger(&m_iGunPositionCheckTime);
1937 arc.ArchiveVector(&m_vGunPosition);
1939 arc.ArchiveInteger(&m_iWallDodgeTimeout);
1940 arc.ArchiveFloat(&m_PrevObstacleNormal[0]);
1941 arc.ArchiveFloat(&m_PrevObstacleNormal[1]);
1942 arc.ArchiveChar(&m_WallDir);
1943 arc.ArchiveFloat(&m_fMoveDoneRadiusSquared);
1945 arc.ArchiveBool(&m_bFaceEnemy);
1946 arc.ArchiveBool(&m_bDoPhysics);
1947 arc.ArchiveBool(&m_bPatrolWaitTrigger);
1948 arc.ArchiveBool(&m_bBecomeRunner);
1949 arc.ArchiveBool(&m_bScriptGoalValid);
1950 arc.ArchiveVector(&m_vScriptGoal);
1951 arc.ArchiveInteger(&m_iNextWatchStepTime);
1953 arc.ArchiveSafePointer(&m_patrolCurrentNode);
1954 Director.ArchiveString(arc, m_csPatrolCurrentAnim);
1955 arc.ArchiveInteger(&m_iSquadStandTime);
1956 arc.ArchiveFloat(&m_fInterval);
1957 arc.ArchiveInteger(&m_iIntervalDirTime);
1958 arc.ArchiveVector(&m_vIntervalDir);
1959 arc.ArchiveShort(&m_sCurrentPathNodeIndex);
1960 arc.ArchiveInteger(&m_PainState);
1962 arc.ArchiveInteger(&m_iCuriousTime);
1963 arc.ArchiveInteger(&m_iCuriousLevel);
1964 arc.ArchiveInteger(&m_iCuriousAnimHint);
1965 arc.ArchiveInteger(&m_iNextDisguiseTime);
1966 arc.ArchiveInteger(&m_iDisguisePeriod);
1967 arc.ArchiveFloat(&m_fMaxDisguiseDistSquared);
1968 arc.ArchiveInteger(&m_iEnemyShowPapersTime);
1970 m_DisguiseAcceptThread.Archive(arc);
1971 arc.ArchiveInteger(&m_iDisguiseLevel);
1972 arc.ArchiveSafePointer(&m_AlarmNode);
1973 m_AlarmThread.Archive(arc);
1974 m_PreAlarmThread.Archive(arc);
1976 arc.ArchiveInteger(&m_iSuppressChance);
1977 arc.ArchiveInteger(&m_iRunHomeTime);
1978 arc.ArchiveBool(&m_bTurretNoInitialCover);
1979 arc.ArchiveInteger(&m_iPotentialCoverCount);
1981 for (i = 0; i < MAX_COVER_NODES; i++) {
1982 arc.ArchiveObjectPointer((Class **)&m_pPotentialCoverNode[i]);
1985 arc.ArchiveObjectPointer((Class **)&m_pCoverNode);
1987 Director.ArchiveString(arc, m_csSpecialAttack);
1988 arc.ArchiveBool(&m_bInReload);
1989 arc.ArchiveBool(&m_bNeedReload);
1990 arc.ArchiveBool(&mbBreakSpecialAttack);
1992 arc.ArchiveBool(&m_bGrenadeBounced);
1993 arc.ArchiveSafePointer(&m_pGrenade);
1994 arc.ArchiveVector(&m_vGrenadePos);
1995 arc.ArchiveInteger(&m_iFirstGrenadeTime);
1996 ArchiveEnum(m_eGrenadeState, eGrenadeState);
1997 ArchiveEnum(m_eGrenadeMode, eGrenadeTossMode);
1998 arc.ArchiveVector(&m_vGrenadeVel);
1999 arc.ArchiveVector(&m_vKickDir);
2001 arc.ArchiveFloat(&m_fNoticeTimeScale);
2002 arc.ArchiveFloat(&m_fMaxNoticeTimeScale);
2003 m_PotentialEnemies.Archive(arc);
2005 arc.ArchiveFloat(&m_fSight);
2006 arc.ArchiveFloat(&m_fHearing);
2007 arc.ArchiveFloat(&m_fSoundAwareness);
2008 arc.ArchiveFloat(&m_fGrenadeAwareness);
2009 arc.ArchiveInteger(&m_iIgnoreSoundsMask);
2011 arc.ArchiveFloat(&m_fFov);
2012 arc.ArchiveFloat(&m_fFovDot);
2013 arc.ArchiveInteger(&m_iEyeUpdateTime);
2014 arc.ArchiveVector(&m_vEyeDir);
2015 arc.ArchiveInteger(&m_iNextLookTime);
2016 arc.ArchiveFloat(&m_fLookAroundFov);
2017 arc.ArchiveSafePointer(&m_pLookEntity);
2018 arc.ArchiveInteger(&m_iLookFlags);
2019 arc.ArchiveSafePointer(&m_pPointEntity);
2020 arc.ArchiveSafePointer(&m_pTurnEntity);
2021 arc.ArchiveFloat(&m_fTurnDoneError);
2022 arc.ArchiveFloat(&m_fAngleYawSpeed);
2023 arc.ArchiveSafePointer(&m_aimNode);
2024 arc.ArchiveInteger(&m_eDontFaceWallMode);
2025 arc.ArchiveInteger(&m_iLastFaceDecideTime);
2027 arc.ArchiveBool(&m_bHeadAnglesAchieved);
2028 arc.ArchiveBool(&m_bLUpperArmAnglesAchieved);
2029 arc.ArchiveBool(&m_bTorsoAnglesAchieved);
2030 arc.ArchiveFloat(&m_fHeadMaxTurnSpeed);
2031 arc.ArchiveVec3(m_vHeadDesiredAngles);
2032 arc.ArchiveFloat(&m_fLUpperArmTurnSpeed);
2033 arc.ArchiveVec3(m_vLUpperArmDesiredAngles);
2034 arc.ArchiveFloat(&m_fTorsoMaxTurnSpeed);
2035 arc.ArchiveFloat(&m_fTorsoCurrentTurnSpeed);
2036 arc.ArchiveVec3(m_vTorsoDesiredAngles);
2038 arc.ArchiveVector(&m_vHome);
2039 arc.ArchiveSafePointer(&m_pTetherEnt);
2041 arc.ArchiveFloat(&m_fMinDistance);
2042 arc.ArchiveFloat(&m_fMinDistanceSquared);
2043 arc.ArchiveFloat(&m_fMaxDistance);
2044 arc.ArchiveFloat(&m_fMaxDistanceSquared);
2046 arc.ArchiveFloat(&m_fLeash);
2047 arc.ArchiveFloat(&m_fLeashSquared);
2048 arc.ArchiveBool(&m_bFixedLeash);
2054 length = m_pFallPath->length;
2059 arc.ArchiveByte(&length);
2061 if (arc.Loading() && length) {
2063 (FallPath *)gi.Malloc((
sizeof(FallPath::pos)) * length + (
sizeof(FallPath) -
sizeof(FallPath::pos)));
2064 m_pFallPath->length = length;
2068 arc.ArchiveByte(&m_pFallPath->currentPos);
2069 arc.ArchiveByte(&m_pFallPath->loop);
2071 for (i = 0; i < length; i++) {
2072 arc.ArchiveVec3(m_pFallPath->pos[i]);
2076 arc.ArchiveFloat(&m_fBalconyHeight);
2077 arc.ArchiveBool(&m_bNoPlayerCollision);
2079 for (i = 0; i < MAX_ORIGIN_HISTORY; i++) {
2080 arc.ArchiveVec2(m_vOriginHistory[i]);
2083 arc.ArchiveInteger(&m_iCurrentHistory);
2085 arc.ArchiveBool(&m_bEnemySwitch);
2086 arc.ArchiveInteger(&m_iNationality);
2099inline void Actor::SetDesiredLookDir(vec3_t dir)
2101 m_bHasDesiredLookAngles =
true;
2102 vectoangles(dir, m_DesiredLookAngles);
2104 m_DesiredLookAngles[1] = m_DesiredLookAngles[1] - angles[1];
2105 m_DesiredLookAngles[1] = AngleNormalize180(m_DesiredLookAngles[1]);
2106 m_DesiredLookAngles[0] = AngleNormalize180(m_DesiredLookAngles[0]);
2116inline void Actor::SetDesiredLookAnglesRelative(vec3_t ang)
2118 m_bHasDesiredLookAngles =
true;
2119 m_DesiredLookAngles[0] = AngleNormalize180(ang[0]);
2120 m_DesiredLookAngles[1] = AngleNormalize180(ang[1]);
2121 m_DesiredLookAngles[2] = AngleNormalize180(ang[2]);
2129inline void Actor::ForwardLook(
void)
2131 m_bHasDesiredLookAngles =
false;
2134inline bool Actor::EnemyIsDisguised(
void)
2136 if (!m_bEnemyIsDisguised && !m_Enemy->m_bIsDisguised) {
2140 if (m_bForceAttackPlayer) {
2144 if (m_ThinkState == THINKSTATE_ATTACK) {
2151inline bool Actor::AvoidingFacingWall(
void)
const
2153 return m_eDontFaceWallMode > 5 && m_eDontFaceWallMode <= 8;
2159class FindCoverMovement :
public StandardMovement
2164 inline qboolean validpath
2174 path = &node->Child[ i ];
2176 if ( !StandardMovement::validpath( node, i ) )
2181 n = AI_GetNode( path->node );
2182 if ( !n || self->CloseToEnemy( n->origin, 128 ) )
2190 inline qboolean done
2203 if ( node->reject || !( node->nodeflags & ( AI_DUCK | AI_COVER ) ) )
2210 node->reject = self->CanSeeEnemyFrom( node->origin );
2211 return !node->reject;
2219class FindFleeMovement :
public StandardMovement
2224 inline qboolean validpath
2234 path = &node->Child[ i ];
2236 if ( !StandardMovement::validpath( node, i ) )
2241 n = AI_GetNode( path->node );
2242 if ( !n || self->CloseToEnemy( n->origin, 128 ) )
2250 inline qboolean done
2263 if ( node->reject || !( node->nodeflags & AI_FLEE ) )
2270 node->reject = self->CanSeeEnemyFrom( node->origin );
2271 return !node->reject;
2278class FindEnemyMovement :
public StandardMovement
2283 inline qboolean done
2302 if ( self->currentEnemy )
2304 node->reject = !self->CanShootFrom( node->origin, self->currentEnemy,
false );
2308 node->reject =
false;
2311 return !node->reject;
2318typedef PathFinder<FindCoverMovement> FindCoverPath;
2319typedef PathFinder<FindFleeMovement> FindFleePath;
2320typedef PathFinder<FindEnemyMovement> FindEnemyPath;
Definition actorenemy.h:99
Definition listener.h:246
Definition grenadehint.h:31
Definition listener.h:450
Definition navigate.h:153
Definition gamescript.h:165
Definition simpleentity.h:42