codemp/game/b_public.h File Reference

#include "ai.h"

Go to the source code of this file.

Data Structures

struct  gNPC_t
struct  gNPCstats_e

Defines

#define NPCAI_CHECK_WEAPON   0x00000001
#define NPCAI_BURST_WEAPON   0x00000002
#define NPCAI_MOVING   0x00000004
#define NPCAI_TOUCHED_GOAL   0x00000008
#define NPCAI_PUSHED   0x00000010
#define NPCAI_NO_COLL_AVOID   0x00000020
#define NPCAI_BLOCKED   0x00000040
#define NPCAI_OFF_PATH   0x00000100
#define NPCAI_IN_SQUADPOINT   0x00000200
#define NPCAI_STRAIGHT_TO_DESTPOS   0x00000400
#define NPCAI_NO_SLOWDOWN   0x00001000
#define NPCAI_LOST   0x00002000
#define NPCAI_SHIELDS   0x00004000
#define NPCAI_GREET_ALLIES   0x00008000
#define NPCAI_FORM_TELE_NAV   0x00010000
#define NPCAI_ENROUTE_TO_HOMEWP   0x00020000
#define NPCAI_MATCHPLAYERWEAPON   0x00040000
#define NPCAI_DIE_ON_IMPACT   0x00100000
#define NPCAI_CUSTOM_GRAVITY   0x00200000
#define SCF_CROUCHED   0x00000001
#define SCF_WALKING   0x00000002
#define SCF_MORELIGHT   0x00000004
#define SCF_LEAN_RIGHT   0x00000008
#define SCF_LEAN_LEFT   0x00000010
#define SCF_RUNNING   0x00000020
#define SCF_ALT_FIRE   0x00000040
#define SCF_NO_RESPONSE   0x00000080
#define SCF_FFDEATH   0x00000100
#define SCF_NO_COMBAT_TALK   0x00000200
#define SCF_CHASE_ENEMIES   0x00000400
#define SCF_LOOK_FOR_ENEMIES   0x00000800
#define SCF_FACE_MOVE_DIR   0x00001000
#define SCF_IGNORE_ALERTS   0x00002000
#define SCF_DONT_FIRE   0x00004000
#define SCF_DONT_FLEE   0x00008000
#define SCF_FORCED_MARCH   0x00010000
#define SCF_NO_GROUPS   0x00020000
#define SCF_FIRE_WEAPON   0x00040000
#define SCF_NO_MIND_TRICK   0x00080000
#define SCF_USE_CP_NEAREST   0x00100000
#define SCF_NO_FORCE   0x00200000
#define SCF_NO_FALLTODEATH   0x00400000
#define SCF_NO_ACROBATICS   0x00800000
#define SCF_USE_SUBTITLES   0x01000000
#define SCF_NO_ALERT_TALK   0x02000000
#define AID_IDLE   0x00000000
#define AID_ACQUIRED   0x00000001
#define AID_LOST   0x00000002
#define AID_CONFUSED   0x00000004
#define AID_LOSTPATH   0x00000008
#define MAX_ENEMY_POS_LAG   2400
#define ENEMY_POS_LAG_INTERVAL   100
#define ENEMY_POS_LAG_STEPS   (MAX_ENEMY_POS_LAG/ENEMY_POS_LAG_INTERVAL)

Typedefs

typedef gNPCstats_e gNPCstats_t

Enumerations

enum  visibility_t {
  VIS_UNKNOWN, VIS_NOT, VIS_PVS, VIS_360,
  VIS_FOV, VIS_SHOOT
}
enum  spot_t {
  SPOT_ORIGIN, SPOT_CHEST, SPOT_HEAD, SPOT_HEAD_LEAN,
  SPOT_WEAPON, SPOT_LEGS, SPOT_GROUND
}
enum  lookMode_t { LM_ENT = 0, LM_INTEREST }
enum  jumpState_t {
  JS_WAITING = 0, JS_FACING, JS_CROUCHING, JS_JUMPING,
  JS_LANDING
}

Functions

void G_SquadPathsInit (void)
void NPC_InitGame (void)
void G_LoadBoltOns (void)
void Svcmd_NPC_f (void)
void NAV_DebugShowWaypoints (void)
void NAV_DebugShowBoxes (void)
void NAV_DebugShowSquadPaths (void)


Define Documentation

#define AID_ACQUIRED   0x00000001
 

Definition at line 59 of file b_public.h.

#define AID_CONFUSED   0x00000004
 

Definition at line 61 of file b_public.h.

#define AID_IDLE   0x00000000
 

Definition at line 58 of file b_public.h.

#define AID_LOST   0x00000002
 

Definition at line 60 of file b_public.h.

#define AID_LOSTPATH   0x00000008
 

Definition at line 62 of file b_public.h.

#define ENEMY_POS_LAG_INTERVAL   100
 

Definition at line 114 of file b_public.h.

Referenced by Sniper_UpdateEnemyPos().

#define ENEMY_POS_LAG_STEPS   (MAX_ENEMY_POS_LAG/ENEMY_POS_LAG_INTERVAL)
 

Definition at line 115 of file b_public.h.

Referenced by Sniper_FaceEnemy().

#define MAX_ENEMY_POS_LAG   2400
 

Definition at line 113 of file b_public.h.

Referenced by Sniper_UpdateEnemyPos().

#define NPCAI_BLOCKED   0x00000040
 

Definition at line 12 of file b_public.h.

Referenced by NAV_ClearBlockedInfo(), NAV_SetBlockedInfo(), NAVNEW_MoveToGoal(), NPC_BSJedi_FollowLeader(), NPC_GetMoveDirectionAltRoute(), and ST_Commander().

#define NPCAI_BURST_WEAPON   0x00000002
 

Definition at line 7 of file b_public.h.

Referenced by ChangeWeapon(), and ShootThink().

#define NPCAI_CHECK_WEAPON   0x00000001
 

Definition at line 6 of file b_public.h.

#define NPCAI_CUSTOM_GRAVITY   0x00200000
 

Definition at line 24 of file b_public.h.

Referenced by Boba_FlyStart(), Boba_FlyStop(), ClientThink_real(), Initialize(), NPC_Seeker_Pain(), NPC_SetFX_SpawnStates(), and NPC_SetMiscDefaultData().

#define NPCAI_DIE_ON_IMPACT   0x00100000
 

Definition at line 23 of file b_public.h.

Referenced by NPC_SetPainEvent().

#define NPCAI_ENROUTE_TO_HOMEWP   0x00020000
 

Definition at line 21 of file b_public.h.

Referenced by NPC_BSSearch(), and NPC_BSSearchStart().

#define NPCAI_FORM_TELE_NAV   0x00010000
 

Definition at line 20 of file b_public.h.

#define NPCAI_GREET_ALLIES   0x00008000
 

Definition at line 19 of file b_public.h.

#define NPCAI_IN_SQUADPOINT   0x00000200
 

Definition at line 14 of file b_public.h.

#define NPCAI_LOST   0x00002000
 

Definition at line 17 of file b_public.h.

Referenced by NPC_HandleAIFlags().

#define NPCAI_MATCHPLAYERWEAPON   0x00040000
 

Definition at line 22 of file b_public.h.

Referenced by NPC_Begin(), and NPC_Spawn_Do().

#define NPCAI_MOVING   0x00000004
 

Definition at line 8 of file b_public.h.

Referenced by NPC_BSJump(), and NPC_ReachedGoal().

#define NPCAI_NO_COLL_AVOID   0x00000020
 

Definition at line 11 of file b_public.h.

Referenced by NAV_AvoidCollision().

#define NPCAI_NO_SLOWDOWN   0x00001000
 

Definition at line 16 of file b_public.h.

Referenced by ClientThink_real().

#define NPCAI_OFF_PATH   0x00000100
 

Definition at line 13 of file b_public.h.

#define NPCAI_PUSHED   0x00000010
 

Definition at line 10 of file b_public.h.

#define NPCAI_SHIELDS   0x00004000
 

Definition at line 18 of file b_public.h.

#define NPCAI_STRAIGHT_TO_DESTPOS   0x00000400
 

Definition at line 15 of file b_public.h.

#define NPCAI_TOUCHED_GOAL   0x00000008
 

Definition at line 9 of file b_public.h.

Referenced by NPC_Touch(), and ReachedGoal().

#define SCF_ALT_FIRE   0x00000040
 

Definition at line 33 of file b_public.h.

Referenced by Boba_FireDecide(), ChangeWeapon(), G_AttackDelay(), NPC_ApplyScriptFlags(), NPC_BSGM_Attack(), NPC_BSJedi_Default(), NPC_BSSniper_Attack(), NPC_BSST_Attack(), NPC_GM_Pain(), NPC_MaxDistSquaredForWeapon(), NPC_ParseParms(), NPC_RunBehavior(), and NPC_SetMiscDefaultData().

#define SCF_CHASE_ENEMIES   0x00000400
 

Definition at line 37 of file b_public.h.

Referenced by ATST_Attack(), ATST_Ranged(), ImperialProbe_AttackDecision(), ImperialProbe_Ranged(), Interrogator_Attack(), Interrogator_Melee(), NPC_BSATST_Default(), NPC_BSGM_Attack(), NPC_BSGrenadier_Attack(), NPC_BSST_Attack(), NPC_DefaultScriptFlags(), NPC_Pain(), Remote_Attack(), Remote_Ranged(), Seeker_Attack(), Seeker_Ranged(), Sentry_AttackDecision(), Sentry_RangedAttack(), ST_Commander(), and ST_HuntEnemy().

#define SCF_CROUCHED   0x00000001
 

Definition at line 27 of file b_public.h.

Referenced by NPC_ApplyScriptFlags(), and NPC_Pain().

#define SCF_DONT_FIRE   0x00004000
 

Definition at line 41 of file b_public.h.

Referenced by NPC_BSEmplaced(), NPC_BSGM_Attack(), NPC_BSGrenadier_Attack(), NPC_BSSniper_Attack(), NPC_BSST_Attack(), NPC_CheckCanAttack(), NPC_CheckCanAttackExt(), NPC_Pain(), and NPC_SetMiscDefaultData().

#define SCF_DONT_FLEE   0x00008000
 

Definition at line 42 of file b_public.h.

Referenced by G_CheckForDanger().

#define SCF_FACE_MOVE_DIR   0x00001000
 

Definition at line 39 of file b_public.h.

Referenced by NPC_BSDefault().

#define SCF_FFDEATH   0x00000100
 

Definition at line 35 of file b_public.h.

Referenced by player_die().

#define SCF_FIRE_WEAPON   0x00040000
 

Definition at line 45 of file b_public.h.

Referenced by Boba_FireDecide(), NPC_BSCinematic(), NPC_BSDefault(), NPC_BSEmplaced(), NPC_BSGM_Attack(), NPC_BSGM_Default(), NPC_BSGrenadier_Attack(), NPC_BSGrenadier_Default(), NPC_BSST_Attack(), NPC_BSST_Default(), and NPC_BSST_Investigate().

#define SCF_FORCED_MARCH   0x00010000
 

Definition at line 43 of file b_public.h.

Referenced by CheckItemCanBePickedUpByNPC(), NPC_BSDefault(), NPC_ExecuteBState(), NPC_Pain(), and NPC_RunBehavior().

#define SCF_IGNORE_ALERTS   0x00002000
 

Definition at line 40 of file b_public.h.

Referenced by G_AlertTeam(), NPC_BSDefault(), NPC_BSFollowLeader(), NPC_BSGrenadier_Patrol(), NPC_BSSniper_Patrol(), NPC_BSST_Investigate(), NPC_BSST_Patrol(), NPC_CheckEnemyStealth(), and NPC_SetMiscDefaultData().

#define SCF_LEAN_LEFT   0x00000010
 

Definition at line 31 of file b_public.h.

Referenced by NPC_ApplyScriptFlags().

#define SCF_LEAN_RIGHT   0x00000008
 

Definition at line 30 of file b_public.h.

Referenced by NPC_ApplyScriptFlags().

#define SCF_LOOK_FOR_ENEMIES   0x00000800
 

Definition at line 38 of file b_public.h.

Referenced by G_AlertTeam(), NPC_BSATST_Default(), NPC_BSDefault(), NPC_BSDroid_Default(), NPC_BSFollowLeader(), NPC_BSGrenadier_Patrol(), NPC_BSHowler_Default(), NPC_BSImperialProbe_Default(), NPC_BSMark1_Default(), NPC_BSMark2_Default(), NPC_BSMineMonster_Default(), NPC_BSRancor_Default(), NPC_BSRemote_Default(), NPC_BSSentry_Default(), NPC_BSSniper_Patrol(), NPC_BSST_Investigate(), NPC_BSST_Patrol(), NPC_BSST_Sleep(), NPC_BSWampa_Default(), NPC_CheckEnemyStealth(), NPC_DefaultScriptFlags(), NPC_Droid_Pain(), and Sentry_Idle().

#define SCF_MORELIGHT   0x00000004
 

Definition at line 29 of file b_public.h.

#define SCF_NO_ACROBATICS   0x00800000
 

Definition at line 50 of file b_public.h.

Referenced by Jedi_CheckFlipEvasions(), and Jedi_SaberBlockGo().

#define SCF_NO_ALERT_TALK   0x02000000
 

Definition at line 52 of file b_public.h.

Referenced by G_AddVoiceEvent().

#define SCF_NO_COMBAT_TALK   0x00000200
 

Definition at line 36 of file b_public.h.

Referenced by G_AddVoiceEvent(), NPC_Pain(), and NPC_Respond().

#define SCF_NO_FALLTODEATH   0x00400000
 

Definition at line 49 of file b_public.h.

#define SCF_NO_FORCE   0x00200000
 

Definition at line 48 of file b_public.h.

Referenced by ForceTelepathyCheckDirectNPCTarget(), and NPC_SetMiscDefaultData().

#define SCF_NO_GROUPS   0x00020000
 

Definition at line 44 of file b_public.h.

Referenced by AI_GetGroup(), AI_ValidateGroupMember(), G_AlertTeam(), G_AngerAlert(), G_TeamEnemy(), and NPC_SetMiscDefaultData().

#define SCF_NO_MIND_TRICK   0x00080000
 

Definition at line 46 of file b_public.h.

Referenced by ForceTelepathyCheckDirectNPCTarget(), and NPC_Pain().

#define SCF_NO_RESPONSE   0x00000080
 

Definition at line 34 of file b_public.h.

Referenced by ForceTelepathyCheckDirectNPCTarget(), and NPC_Use().

#define SCF_RUNNING   0x00000020
 

Definition at line 32 of file b_public.h.

Referenced by NPC_ApplyScriptFlags(), NPC_BSDefault(), and NPC_BSST_Patrol().

#define SCF_USE_CP_NEAREST   0x00100000
 

Definition at line 47 of file b_public.h.

Referenced by ST_Commander(), and ST_GetCPFlags().

#define SCF_USE_SUBTITLES   0x01000000
 

Definition at line 51 of file b_public.h.

#define SCF_WALKING   0x00000002
 

Definition at line 28 of file b_public.h.

Referenced by NPC_ApplyScriptFlags(), NPC_BSDefault(), and NPC_Pain().


Typedef Documentation

typedef struct gNPCstats_e gNPCstats_t
 

Referenced by NPC_ParseParms().


Enumeration Type Documentation

enum jumpState_t
 

Enumeration values:
JS_WAITING 
JS_FACING 
JS_CROUCHING 
JS_JUMPING 
JS_LANDING 

Definition at line 77 of file b_public.h.

00078 {
00079         JS_WAITING = 0,
00080         JS_FACING,
00081         JS_CROUCHING,
00082         JS_JUMPING,
00083         JS_LANDING
00084 } jumpState_t;

enum lookMode_t
 

Enumeration values:
LM_ENT 
LM_INTEREST 

Definition at line 71 of file b_public.h.

00072 {
00073         LM_ENT = 0,
00074         LM_INTEREST
00075 } lookMode_t;

enum spot_t
 

Enumeration values:
SPOT_ORIGIN 
SPOT_CHEST 
SPOT_HEAD 
SPOT_HEAD_LEAN 
SPOT_WEAPON 
SPOT_LEGS 
SPOT_GROUND 

Definition at line 69 of file b_public.h.

enum visibility_t
 

Enumeration values:
VIS_UNKNOWN 
VIS_NOT 
VIS_PVS 
VIS_360 
VIS_FOV 
VIS_SHOOT 

Definition at line 68 of file b_public.h.

Referenced by NPC_BSFollowLeader(), NPC_BSHuntAndKill(), and NPC_CheckVisibility().


Function Documentation

void G_LoadBoltOns void   ) 
 

void G_SquadPathsInit void   ) 
 

void NAV_DebugShowBoxes void   ) 
 

void NAV_DebugShowSquadPaths void   ) 
 

void NAV_DebugShowWaypoints void   ) 
 

void NPC_InitGame void   ) 
 

Definition at line 2041 of file NPC.c.

References NPC_InitAI(), and NPC_LoadParms().

Referenced by G_InitGame().

02042 {
02043 //      globals.NPCs = (gNPC_t *) gi.TagMalloc(game.maxclients * sizeof(game.bots[0]), TAG_GAME);
02044 //      trap_Cvar_Register(&debugNPCName, "d_npc", "0", CVAR_CHEAT);
02045 
02046         NPC_LoadParms();
02047         NPC_InitAI();
02048 //      NPC_InitAnimTable();
02049         /*
02050         ResetTeamCounters();
02051         for ( int team = NPCTEAM_FREE; team < NPCTEAM_NUM_TEAMS; team++ )
02052         {
02053                 teamLastEnemyTime[team] = -10000;
02054         }
02055         */
02056 }

void Svcmd_NPC_f void   )