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