codemp/game/bg_public.h

Go to the documentation of this file.
00001 // Copyright (C) 1999-2000 Id Software, Inc.
00002 //
00003 // bg_public.h -- definitions shared by both the server game and client game modules
00004 
00005 // because games can change separately from the main system version, we need a
00006 // second version that must match between game and cgame
00007 
00008 #ifndef __BG_PUBLIC_H__
00009 #define __BG_PUBLIC_H__
00010 
00011 #include "bg_weapons.h"
00012 #include "anims.h"
00013 #include "bg_vehicles.h"
00014 
00015 //these two defs are shared now because we do clientside ent parsing
00016 #define MAX_SPAWN_VARS                  64
00017 #define MAX_SPAWN_VARS_CHARS    4096
00018 
00019 
00020 #define GAME_VERSION            "basejka-1"
00021 
00022 #define STEPSIZE                18
00023 
00024 #define DEFAULT_GRAVITY         800
00025 #define GIB_HEALTH                      -40
00026 #define ARMOR_PROTECTION                0.50 // Shields only stop 50% of armor-piercing dmg
00027 #define ARMOR_REDUCTION_FACTOR  0.50 // Certain damage doesn't take off armor as efficiently
00028 
00029 #define JUMP_VELOCITY           225//270
00030 
00031 #define MAX_ITEMS                       256
00032 
00033 #define RANK_TIED_FLAG          0x4000
00034 
00035 #define ITEM_RADIUS                     15              // item sizes are needed for client side pickup detection
00036 
00037 #define SCORE_NOT_PRESENT       -9999   // for the CS_SCORES[12] when only one player is present
00038 
00039 #define VOTE_TIME                       30000   // 30 seconds before vote times out
00040 
00041 #define DEFAULT_MINS_2          -24
00042 #define DEFAULT_MAXS_2          40
00043 #define CROUCH_MAXS_2           16
00044 #define STANDARD_VIEWHEIGHT_OFFSET -4
00045 
00046 #define MINS_Z                          -24
00047 #define DEFAULT_VIEWHEIGHT      (DEFAULT_MAXS_2+STANDARD_VIEWHEIGHT_OFFSET)//26
00048 #define CROUCH_VIEWHEIGHT       (CROUCH_MAXS_2+STANDARD_VIEWHEIGHT_OFFSET)//12
00049 #define DEAD_VIEWHEIGHT         -16
00050 
00051 #define MAX_CLIENT_SCORE_SEND 20
00052 
00053 //
00054 // config strings are a general means of communicating variable length strings
00055 // from the server to all connected clients.
00056 //
00057 
00058 // CS_SERVERINFO and CS_SYSTEMINFO are defined in q_shared.h
00059 #define CS_MUSIC                                2
00060 #define CS_MESSAGE                              3               // from the map worldspawn's message field
00061 #define CS_MOTD                                 4               // g_motd string for server message of the day
00062 #define CS_WARMUP                               5               // server time when the match will be restarted
00063 #define CS_SCORES1                              6
00064 #define CS_SCORES2                              7
00065 #define CS_VOTE_TIME                    8
00066 #define CS_VOTE_STRING                  9
00067 #define CS_VOTE_YES                             10
00068 #define CS_VOTE_NO                              11
00069 
00070 #define CS_TEAMVOTE_TIME                12
00071 #define CS_TEAMVOTE_STRING              14
00072 #define CS_TEAMVOTE_YES                 16
00073 #define CS_TEAMVOTE_NO                  18
00074 
00075 #define CS_GAME_VERSION                 20
00076 #define CS_LEVEL_START_TIME             21              // so the timer only shows the current level
00077 #define CS_INTERMISSION                 22              // when 1, fraglimit/timelimit has been hit and intermission will start in a second or two
00078 #define CS_FLAGSTATUS                   23              // string indicating flag status in CTF
00079 #define CS_SHADERSTATE                  24
00080 #define CS_BOTINFO                              25
00081 
00082 #define CS_ITEMS                                27              // string of 0's and 1's that tell which items are present
00083 
00084 #define CS_CLIENT_JEDIMASTER    28              // current jedi master
00085 #define CS_CLIENT_DUELWINNER    29              // current duel round winner - needed for printing at top of scoreboard
00086 #define CS_CLIENT_DUELISTS              30              // client numbers for both current duelists. Needed for a number of client-side things.
00087 #define CS_CLIENT_DUELHEALTHS   31              // nmckenzie: DUEL_HEALTH.  Hopefully adding this cs is safe and good?
00088 #define CS_GLOBAL_AMBIENT_SET   32
00089 
00090 #define CS_AMBIENT_SET                  37
00091 
00092 #define CS_SIEGE_STATE                  (CS_AMBIENT_SET+MAX_AMBIENT_SETS)
00093 #define CS_SIEGE_OBJECTIVES             (CS_SIEGE_STATE+1)
00094 #define CS_SIEGE_TIMEOVERRIDE   (CS_SIEGE_OBJECTIVES+1)
00095 #define CS_SIEGE_WINTEAM                (CS_SIEGE_TIMEOVERRIDE+1)
00096 #define CS_SIEGE_ICONS                  (CS_SIEGE_WINTEAM+1)
00097 
00098 #define CS_MODELS                               (CS_SIEGE_ICONS+1)
00099 #define CS_SKYBOXORG                    (CS_MODELS+MAX_MODELS)          //rww - skybox info
00100 #define CS_SOUNDS                               (CS_SKYBOXORG+1)
00101 #define CS_ICONS                                (CS_SOUNDS+MAX_SOUNDS)
00102 #define CS_PLAYERS                              (CS_ICONS+MAX_ICONS)
00103 /*
00104 Ghoul2 Insert Start
00105 */
00106 #define CS_G2BONES                              (CS_PLAYERS+MAX_CLIENTS)
00107 //rww - used to be CS_CHARSKINS, but I have eliminated the need for that.
00108 /*
00109 Ghoul2 Insert End
00110 */
00111 #define CS_LOCATIONS                    (CS_G2BONES+MAX_G2BONES)
00112 #define CS_PARTICLES                    (CS_LOCATIONS+MAX_LOCATIONS) 
00113 #define CS_EFFECTS                              (CS_PARTICLES+MAX_LOCATIONS)
00114 #define CS_LIGHT_STYLES                 (CS_EFFECTS + MAX_FX)
00115 
00116 //rwwRMG - added:
00117 #define CS_TERRAINS                             (CS_LIGHT_STYLES + (MAX_LIGHT_STYLES*3))
00118 #define CS_BSP_MODELS                   (CS_TERRAINS + MAX_TERRAINS)
00119 
00120 #define CS_MAX                                  (CS_BSP_MODELS + MAX_SUB_BSP)
00121 
00122 #if (CS_MAX) > MAX_CONFIGSTRINGS
00123 #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS
00124 #endif
00125 
00126 typedef enum {
00127         G2_MODELPART_HEAD = 10,
00128         G2_MODELPART_WAIST,
00129         G2_MODELPART_LARM,
00130         G2_MODELPART_RARM,
00131         G2_MODELPART_RHAND,
00132         G2_MODELPART_LLEG,
00133         G2_MODELPART_RLEG
00134 } g2ModelParts_t;
00135 
00136 #define G2_MODEL_PART   50
00137 
00138 #define BG_NUM_TOGGLEABLE_SURFACES 31
00139 
00140 #define MAX_CUSTOM_SIEGE_SOUNDS 30
00141 
00142 #include "../namespace_begin.h"
00143 extern const char *bg_customSiegeSoundNames[MAX_CUSTOM_SIEGE_SOUNDS];
00144 
00145 extern const char *bgToggleableSurfaces[BG_NUM_TOGGLEABLE_SURFACES];
00146 extern const int bgToggleableSurfaceDebris[BG_NUM_TOGGLEABLE_SURFACES];
00147 #include "../namespace_end.h"
00148 
00149 typedef enum {
00150         HANDEXTEND_NONE = 0,
00151         HANDEXTEND_FORCEPUSH,
00152         HANDEXTEND_FORCEPULL,
00153         HANDEXTEND_FORCE_HOLD,
00154         HANDEXTEND_SABERPULL,
00155         HANDEXTEND_CHOKE, //use handextend priorities to choke someone being gripped
00156         HANDEXTEND_WEAPONREADY,
00157         HANDEXTEND_DODGE,
00158         HANDEXTEND_KNOCKDOWN,
00159         HANDEXTEND_DUELCHALLENGE,
00160         HANDEXTEND_TAUNT,
00161 
00162         HANDEXTEND_PRETHROW,
00163         HANDEXTEND_POSTTHROW,
00164         HANDEXTEND_PRETHROWN,
00165         HANDEXTEND_POSTTHROWN,
00166 
00167         HANDEXTEND_DRAGGING,
00168 
00169         HANDEXTEND_JEDITAUNT,
00170 } forceHandAnims_t;
00171 
00172 typedef enum
00173 {
00174         BROKENLIMB_NONE = 0,
00175         BROKENLIMB_LARM,
00176         BROKENLIMB_RARM,
00177         NUM_BROKENLIMBS
00178 } brokenLimb_t;
00179 
00180 //for supplier class items
00181 #define TOSS_DEBOUNCE_TIME                              5000
00182 
00183 typedef enum {
00184         GT_FFA,                         // free for all
00185         GT_HOLOCRON,            // holocron ffa
00186         GT_JEDIMASTER,          // jedi master
00187         GT_DUEL,                // one on one tournament
00188         GT_POWERDUEL,
00189         GT_SINGLE_PLAYER,       // single player ffa
00190 
00191         //-- team games go after this --
00192 
00193         GT_TEAM,                        // team deathmatch
00194         GT_SIEGE,                       // siege
00195         GT_CTF,                         // capture the flag
00196         GT_CTY,
00197         GT_MAX_GAME_TYPE
00198 };
00199 typedef int gametype_t;
00200 
00201 typedef enum { GENDER_MALE, GENDER_FEMALE, GENDER_NEUTER } gender_t;
00202 
00203 extern vec3_t WP_MuzzlePoint[WP_NUM_WEAPONS];
00204 
00205 #include "../namespace_begin.h"
00206 extern int forcePowerSorted[NUM_FORCE_POWERS];
00207 #include "../namespace_end.h"
00208 
00209 typedef enum
00210 {
00211         SABERLOCK_TOP,
00212         SABERLOCK_SIDE,
00213         SABERLOCK_LOCK,
00214         SABERLOCK_BREAK,
00215         SABERLOCK_SUPERBREAK,
00216         SABERLOCK_WIN,
00217         SABERLOCK_LOSE
00218 };
00219 
00220 typedef enum
00221 {
00222         DIR_RIGHT,
00223         DIR_LEFT,
00224         DIR_FRONT,
00225         DIR_BACK
00226 };
00227 
00228 /*
00229 ===================================================================================
00230 
00231 PMOVE MODULE
00232 
00233 The pmove code takes a player_state_t and a usercmd_t and generates a new player_state_t
00234 and some other output data.  Used for local prediction on the client game and true
00235 movement on the server game.
00236 ===================================================================================
00237 */
00238 
00239 
00240 #pragma pack(push, 1)
00241 typedef struct animation_s {
00242         unsigned short          firstFrame;
00243         unsigned short          numFrames;
00244         short                           frameLerp;                      // msec between frames
00245         //initialLerp is abs(frameLerp)
00246         signed char                     loopFrames;                     // 0 to numFrames
00247 } animation_t;
00248 #pragma pack(pop)
00249 
00250 #include "../namespace_begin.h"
00251 extern qboolean                 BGPAFtextLoaded;
00252 extern animation_t              bgHumanoidAnimations[MAX_TOTALANIMATIONS];
00253 #include "../namespace_end.h"
00254 
00255 #define MAX_ANIM_FILES  16
00256 #define MAX_ANIM_EVENTS 300
00257 
00258 typedef enum
00259 {
00260         FOOTSTEP_R,
00261         FOOTSTEP_L,
00262         FOOTSTEP_HEAVY_R,
00263         FOOTSTEP_HEAVY_L,
00264         NUM_FOOTSTEP_TYPES
00265 } footstepType_t;
00266 
00267 extern stringID_table_t animEventTypeTable[MAX_ANIM_EVENTS+1];
00268 extern stringID_table_t footstepTypeTable[NUM_FOOTSTEP_TYPES+1];
00269 
00270 //size of Anim eventData array...
00271 #define MAX_RANDOM_ANIM_SOUNDS          4
00272 #define AED_ARRAY_SIZE                          (MAX_RANDOM_ANIM_SOUNDS+3)
00273 //indices for AEV_SOUND data
00274 #define AED_SOUNDINDEX_START            0
00275 #define AED_SOUNDINDEX_END                      (MAX_RANDOM_ANIM_SOUNDS-1)
00276 #define AED_SOUND_NUMRANDOMSNDS         (MAX_RANDOM_ANIM_SOUNDS)
00277 #define AED_SOUND_PROBABILITY           (MAX_RANDOM_ANIM_SOUNDS+1)
00278 //indices for AEV_SOUNDCHAN data
00279 #define AED_SOUNDCHANNEL                        (MAX_RANDOM_ANIM_SOUNDS+2)
00280 //indices for AEV_FOOTSTEP data
00281 #define AED_FOOTSTEP_TYPE                       0
00282 #define AED_FOOTSTEP_PROBABILITY        1
00283 //indices for AEV_EFFECT data
00284 #define AED_EFFECTINDEX                         0
00285 #define AED_BOLTINDEX                           1
00286 #define AED_EFFECT_PROBABILITY          2
00287 #define AED_MODELINDEX                          3
00288 //indices for AEV_FIRE data
00289 #define AED_FIRE_ALT                            0
00290 #define AED_FIRE_PROBABILITY            1
00291 //indices for AEV_MOVE data
00292 #define AED_MOVE_FWD                            0
00293 #define AED_MOVE_RT                                     1
00294 #define AED_MOVE_UP                                     2
00295 //indices for AEV_SABER_SWING data
00296 #define AED_SABER_SWING_SABERNUM        0
00297 #define AED_SABER_SWING_TYPE            1
00298 #define AED_SABER_SWING_PROBABILITY     2
00299 //indices for AEV_SABER_SPIN data
00300 #define AED_SABER_SPIN_SABERNUM         0
00301 #define AED_SABER_SPIN_TYPE                     1       //0 = saberspinoff, 1 = saberspin, 2-4 = saberspin1-saberspin3
00302 #define AED_SABER_SPIN_PROBABILITY      2       
00303 
00304 typedef enum
00305 {//NOTENOTE:  Be sure to update animEventTypeTable and ParseAnimationEvtBlock(...) if you change this enum list!
00306         AEV_NONE,
00307         AEV_SOUND,              //# animID AEV_SOUND framenum soundpath randomlow randomhi chancetoplay
00308         AEV_FOOTSTEP,   //# animID AEV_FOOTSTEP framenum footstepType chancetoplay
00309         AEV_EFFECT,             //# animID AEV_EFFECT framenum effectpath boltName chancetoplay
00310         AEV_FIRE,               //# animID AEV_FIRE framenum altfire chancetofire
00311         AEV_MOVE,               //# animID AEV_MOVE framenum forwardpush rightpush uppush
00312         AEV_SOUNDCHAN,  //# animID AEV_SOUNDCHAN framenum CHANNEL soundpath randomlow randomhi chancetoplay 
00313         AEV_SABER_SWING,  //# animID AEV_SABER_SWING framenum CHANNEL randomlow randomhi chancetoplay 
00314         AEV_SABER_SPIN,  //# animID AEV_SABER_SPIN framenum CHANNEL chancetoplay 
00315         AEV_NUM_AEV
00316 } animEventType_t;
00317 
00318 typedef struct animevent_s 
00319 {
00320         animEventType_t eventType;
00321         unsigned short  keyFrame;                       //Frame to play event on
00322         signed short    eventData[AED_ARRAY_SIZE];      //Unique IDs, can be soundIndex of sound file to play OR effect index or footstep type, etc.
00323         char                    *stringData;            //we allow storage of one string, temporarily (in case we have to look up an index later, then make sure to set stringData to NULL so we only do the look-up once)
00324 } animevent_t;
00325 
00326 typedef struct
00327 {
00328         char                    filename[MAX_QPATH];
00329         animation_t             *anims;
00330 //      animsounds_t    torsoAnimSnds[MAX_ANIM_SOUNDS];
00331 //      animsounds_t    legsAnimSnds[MAX_ANIM_SOUNDS];
00332 //      qboolean                soundsCached;
00333 } bgLoadedAnim_t;
00334 
00335 typedef struct
00336 {
00337         char                    filename[MAX_QPATH];
00338         animevent_t             torsoAnimEvents[MAX_ANIM_EVENTS];
00339         animevent_t             legsAnimEvents[MAX_ANIM_EVENTS];
00340         qboolean                eventsParsed;
00341 } bgLoadedEvents_t;
00342 
00343 #include "../namespace_begin.h"
00344 
00345 extern bgLoadedAnim_t bgAllAnims[MAX_ANIM_FILES];
00346 
00347 //In SP this is shared in with the anim stuff, and humanoid anim sets can be loaded
00348 //multiple times just for the sake of sounds being different. We probably wouldn't
00349 //care normally but since we're working in VMs we have to do everything possible to
00350 //cut memory cost.
00351 //On the bright side this also means we're cutting a rather large size out of
00352 //required game-side memory.
00353 #ifndef QAGAME
00354 extern bgLoadedEvents_t bgAllEvents[MAX_ANIM_FILES];
00355 extern int bgNumAnimEvents;
00356 #endif
00357 
00358 #include "../namespace_end.h"
00359 
00360 typedef enum {
00361         PM_NORMAL,              // can accelerate and turn
00362         PM_JETPACK,             // special jetpack movement
00363         PM_FLOAT,               // float with no gravity in general direction of velocity (intended for gripping)
00364         PM_NOCLIP,              // noclip movement
00365         PM_SPECTATOR,   // still run into walls
00366         PM_DEAD,                // no acceleration or turning, but free falling
00367         PM_FREEZE,              // stuck in place with no control
00368         PM_INTERMISSION,        // no movement or status bar
00369         PM_SPINTERMISSION       // no movement or status bar
00370 } pmtype_t;
00371 
00372 typedef enum {
00373         WEAPON_READY, 
00374         WEAPON_RAISING,
00375         WEAPON_DROPPING,
00376         WEAPON_FIRING,
00377         WEAPON_CHARGING,
00378         WEAPON_CHARGING_ALT,
00379         WEAPON_IDLE, //lowered          // NOTENOTE Added with saber
00380 } weaponstate_t;
00381 
00382 
00383 typedef enum {
00384         FORCE_MASTERY_UNINITIATED,
00385         FORCE_MASTERY_INITIATE,
00386         FORCE_MASTERY_PADAWAN,
00387         FORCE_MASTERY_JEDI,
00388         FORCE_MASTERY_JEDI_GUARDIAN,
00389         FORCE_MASTERY_JEDI_ADEPT,
00390         FORCE_MASTERY_JEDI_KNIGHT,
00391         FORCE_MASTERY_JEDI_MASTER,
00392         NUM_FORCE_MASTERY_LEVELS
00393 };
00394 
00395 #include "../namespace_begin.h"
00396 extern char *forceMasteryLevels[NUM_FORCE_MASTERY_LEVELS];
00397 extern int forceMasteryPoints[NUM_FORCE_MASTERY_LEVELS];
00398 
00399 extern int bgForcePowerCost[NUM_FORCE_POWERS][NUM_FORCE_POWER_LEVELS];
00400 #include "../namespace_end.h"
00401 
00402 // pmove->pm_flags
00403 #define PMF_DUCKED                      1
00404 #define PMF_JUMP_HELD           2
00405 #define PMF_ROLLING                     4
00406 #define PMF_BACKWARDS_JUMP      8               // go into backwards land
00407 #define PMF_BACKWARDS_RUN       16              // coast down to backwards run
00408 #define PMF_TIME_LAND           32              // pm_time is time before rejump
00409 #define PMF_TIME_KNOCKBACK      64              // pm_time is an air-accelerate only time
00410 #define PMF_FIX_MINS            128             // mins have been brought up, keep tracing down to fix them
00411 #define PMF_TIME_WATERJUMP      256             // pm_time is waterjump
00412 #define PMF_RESPAWNED           512             // clear after attack and jump buttons come up
00413 #define PMF_USE_ITEM_HELD       1024
00414 #define PMF_UPDATE_ANIM         2048    // The server updated the animation, the pmove should set the ghoul2 anim to match.
00415 #define PMF_FOLLOW                      4096    // spectate following another player
00416 #define PMF_SCOREBOARD          8192    // spectate as a scoreboard
00417 #define PMF_STUCK_TO_WALL       16384   // grabbing a wall
00418 
00419 #define PMF_ALL_TIMES   (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK)
00420 
00421 #define MAXTOUCH        32
00422 
00423 typedef struct bgEntity_s
00424 {
00425         entityState_t   s;
00426         playerState_t   *playerState;
00427         Vehicle_t               *m_pVehicle; //vehicle data
00428         void                    *ghoul2; //g2 instance
00429         int                             localAnimIndex; //index locally (game/cgame) to anim data for this skel
00430         vec3_t                  modelScale; //needed for g2 collision
00431 
00432         //Data type(s) must directly correspond to the head of the gentity and centity structures
00433 } bgEntity_t;
00434 
00435 typedef struct {
00436         // state (in / out)
00437         playerState_t   *ps;
00438 
00439         //rww - shared ghoul2 stuff (not actually the same data, but hey)
00440         void            *ghoul2;
00441         int                     g2Bolts_LFoot;
00442         int                     g2Bolts_RFoot;
00443         vec3_t          modelScale;
00444 
00445         //hacky bool so we know if we're dealing with a nonhumanoid (which is probably a rockettrooper)
00446         qboolean        nonHumanoid;
00447 
00448         // command (in)
00449         usercmd_t       cmd;
00450         int                     tracemask;                      // collide against these types of surfaces
00451         int                     debugLevel;                     // if set, diagnostic output will be printed
00452         qboolean        noFootsteps;            // if the game is setup for no footsteps by the server
00453         qboolean        gauntletHit;            // true if a gauntlet attack would actually hit something
00454 
00455         int                     framecount;
00456 
00457         // results (out)
00458         int                     numtouch;
00459         int                     touchents[MAXTOUCH];
00460 
00461         int                     useEvent;
00462 
00463         vec3_t          mins, maxs;                     // bounding box size
00464 
00465         int                     watertype;
00466         int                     waterlevel;
00467 
00468         int                     gametype;
00469 
00470         int                     debugMelee;
00471         int                     stepSlideFix;
00472         int                     noSpecMove;
00473 
00474         animation_t     *animations;
00475 
00476         float           xyspeed;
00477 
00478         // for fixed msec Pmove
00479         int                     pmove_fixed;
00480         int                     pmove_msec;
00481 
00482         // callbacks to test the world
00483         // these will be different functions during game and cgame
00484         void            (*trace)( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask );
00485         int                     (*pointcontents)( const vec3_t point, int passEntityNum );
00486 
00487         int                     checkDuelLoss;
00488 
00489         //rww - bg entitystate access method
00490         bgEntity_t      *baseEnt; //base address of the entity array (g_entities or cg_entities)
00491         int                     entSize; //size of the struct (gentity_t or centity_t) so things can be dynamic
00492 } pmove_t;
00493 
00494 #include "../namespace_begin.h"
00495 
00496 extern  pmove_t         *pm;
00497 
00498 #define SETANIM_TORSO 1
00499 #define SETANIM_LEGS  2
00500 #define SETANIM_BOTH  SETANIM_TORSO|SETANIM_LEGS//3
00501 
00502 #define SETANIM_FLAG_NORMAL             0//Only set if timer is 0
00503 #define SETANIM_FLAG_OVERRIDE   1//Override previous
00504 #define SETANIM_FLAG_HOLD               2//Set the new timer
00505 #define SETANIM_FLAG_RESTART    4//Allow restarting the anim if playing the same one (weapon fires)
00506 #define SETANIM_FLAG_HOLDLESS   8//Set the new timer
00507 
00508 
00509 // if a full pmove isn't done on the client, you can just update the angles
00510 void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd );
00511 void Pmove (pmove_t *pmove);
00512 
00513 #include "../namespace_end.h"
00514 
00515 //===================================================================================
00516 
00517 
00518 // player_state->stats[] indexes
00519 // NOTE: may not have more than 16
00520 typedef enum {
00521         STAT_HEALTH,
00522         STAT_HOLDABLE_ITEM,
00523         STAT_HOLDABLE_ITEMS,
00524         STAT_PERSISTANT_POWERUP,
00525         //MAKE SURE STAT_WEAPONS REMAINS 4!!!!
00526         //There is a hardcoded reference in msg.cpp to send it in 32 bits -rww
00527         STAT_WEAPONS = 4,                                       // 16 bit fields
00528         STAT_ARMOR,                             
00529         STAT_DEAD_YAW,                                  // look this direction when dead (FIXME: get rid of?)
00530         STAT_CLIENTS_READY,                             // bit mask of clients wishing to exit the intermission (FIXME: configstring?)
00531         STAT_MAX_HEALTH                                 // health / armor limit, changable by handicap
00532 } statIndex_t;
00533 
00534 
00535 // player_state->persistant[] indexes
00536 // these fields are the only part of player_state that isn't
00537 // cleared on respawn
00538 // NOTE: may not have more than 16
00539 typedef enum {
00540         PERS_SCORE,                                             // !!! MUST NOT CHANGE, SERVER AND GAME BOTH REFERENCE !!!
00541         PERS_HITS,                                              // total points damage inflicted so damage beeps can sound on change
00542         PERS_RANK,                                              // player rank or team rank
00543         PERS_TEAM,                                              // player team
00544         PERS_SPAWN_COUNT,                               // incremented every respawn
00545         PERS_PLAYEREVENTS,                              // 16 bits that can be flipped for events
00546         PERS_ATTACKER,                                  // clientnum of last damage inflicter
00547         PERS_ATTACKEE_ARMOR,                    // health/armor of last person we attacked
00548         PERS_KILLED,                                    // count of the number of times you died
00549         // player awards tracking
00550         PERS_IMPRESSIVE_COUNT,                  // two railgun hits in a row
00551         PERS_EXCELLENT_COUNT,                   // two successive kills in a short amount of time
00552         PERS_DEFEND_COUNT,                              // defend awards
00553         PERS_ASSIST_COUNT,                              // assist awards
00554         PERS_GAUNTLET_FRAG_COUNT,               // kills with the guantlet
00555         PERS_CAPTURES                                   // captures
00556 } persEnum_t;
00557 
00558 
00559 // entityState_t->eFlags
00560 #define EF_G2ANIMATING                  (1<<0)          //perform g2 bone anims based on torsoAnim and legsAnim, works for ET_GENERAL -rww
00561 #define EF_DEAD                                 (1<<1)          // don't draw a foe marker over players with EF_DEAD
00562 //#define       EF_BOUNCE_SHRAPNEL              (1<<2)          // special shrapnel flag
00563 //do not use eflags for server-only things, it wastes bandwidth -rww
00564 #define EF_RADAROBJECT                  (1<<2)          // display on team radar
00565 
00566 #define EF_TELEPORT_BIT                 (1<<3)          // toggled every time the origin abruptly changes
00567 
00568 #define EF_SHADER_ANIM                  (1<<4)          // Animating shader (by s.frame)
00569 
00570 #define EF_PLAYER_EVENT                 (1<<5)
00571 //#define       EF_BOUNCE                               (1<<5)          // for missiles
00572 //#define       EF_BOUNCE_HALF                  (1<<6)          // for missiles
00573 //these aren't even referenced in bg or client code and do not need to be eFlags, so I
00574 //am using these flags for rag stuff -rww
00575 
00576 #define EF_RAG                                  (1<<6)          //ragdoll him even if he's alive
00577 
00578 
00579 #define EF_PERMANENT                    (1<<7)          // rww - I am claiming this. (for permanent entities)
00580 
00581 #define EF_NODRAW                               (1<<8)          // may have an event, but no model (unspawned items)
00582 #define EF_FIRING                               (1<<9)          // for lightning gun
00583 #define EF_ALT_FIRING                   (1<<10)         // for alt-fires, mostly for lightning guns though
00584 #define EF_JETPACK_ACTIVE               (1<<11)         //jetpack is activated
00585 
00586 #define EF_NOT_USED_1                   (1<<12)         // not used
00587 
00588 #define EF_TALK                                 (1<<13)         // draw a talk balloon
00589 #define EF_CONNECTION                   (1<<14)         // draw a connection trouble sprite
00590 #define EF_NOT_USED_6                   (1<<15)         // not used
00591 
00592 #define EF_NOT_USED_2                   (1<<16)         // not used
00593 #define EF_NOT_USED_3                   (1<<17)         // not used
00594 #define EF_NOT_USED_4                   (1<<18)         // not used
00595 
00596 #define EF_BODYPUSH                             (1<<19)         //rww - claiming this for fullbody push effect
00597 
00598 #define EF_DOUBLE_AMMO                  (1<<20)         // Hacky way to get around ammo max
00599 #define EF_SEEKERDRONE                  (1<<21)         // show seeker drone floating around head
00600 #define EF_MISSILE_STICK                (1<<22)         // missiles that stick to the wall.
00601 #define EF_ITEMPLACEHOLDER              (1<<23)         // item effect
00602 #define EF_SOUNDTRACKER                 (1<<24)         // sound position needs to be updated in relation to another entity
00603 #define EF_DROPPEDWEAPON                (1<<25)         // it's a dropped weapon
00604 #define EF_DISINTEGRATION               (1<<26)         // being disintegrated by the disruptor
00605 #define EF_INVULNERABLE                 (1<<27)         // just spawned in or whatever, so is protected
00606 
00607 #define EF_CLIENTSMOOTH                 (1<<28)         // standard lerporigin smooth override on client
00608 
00609 #define EF_JETPACK                              (1<<29)         //rww - wearing a jetpack
00610 #define EF_JETPACK_FLAMING              (1<<30)         //rww - jetpack fire effect
00611 
00612 #define EF_NOT_USED_5                   (1<<31)         // not used
00613 
00614 //These new EF2_??? flags were added for NPCs, they really should not be used often.
00615 //NOTE: we only allow 10 of these!
00616 #define EF2_HELD_BY_MONSTER             (1<<0)          // Being held by something, like a Rancor or a Wampa
00617 #define EF2_USE_ALT_ANIM                (1<<1)          // For certain special runs/stands for creatures like the Rancor and Wampa whose runs/stands are conditional
00618 #define EF2_ALERTED                             (1<<2)          // For certain special anims, for Rancor: means you've had an enemy, so use the more alert stand
00619 #define EF2_GENERIC_NPC_FLAG    (1<<3)          // So far, used for Rancor...
00620 #define EF2_FLYING                              (1<<4)          // Flying FIXME: only used on NPCs doesn't *really* have to be passed over, does it?
00621 #define EF2_HYPERSPACE                  (1<<5)          // Used to both start the hyperspace effect on the predicted client and to let the vehicle know it can now jump into hyperspace (after turning to face the proper angle)
00622 #define EF2_BRACKET_ENTITY              (1<<6)          // Draw as bracketed
00623 #define EF2_SHIP_DEATH                  (1<<7)          // "died in ship" mode
00624 #define EF2_NOT_USED_1                  (1<<8)          // not used
00625 
00626 
00627 typedef enum {
00628         EFFECT_NONE = 0,
00629         EFFECT_SMOKE,
00630         EFFECT_EXPLOSION,
00631         EFFECT_EXPLOSION_PAS,
00632         EFFECT_SPARK_EXPLOSION,
00633         EFFECT_EXPLOSION_TRIPMINE,
00634         EFFECT_EXPLOSION_DETPACK,
00635         EFFECT_EXPLOSION_FLECHETTE,
00636         EFFECT_STUNHIT,
00637         EFFECT_EXPLOSION_DEMP2ALT,
00638         EFFECT_EXPLOSION_TURRET,
00639         EFFECT_SPARKS,
00640         EFFECT_WATER_SPLASH,
00641         EFFECT_ACID_SPLASH,
00642         EFFECT_LAVA_SPLASH,
00643         EFFECT_LANDING_MUD,
00644         EFFECT_LANDING_SAND,
00645         EFFECT_LANDING_DIRT,
00646         EFFECT_LANDING_SNOW,
00647         EFFECT_LANDING_GRAVEL,
00648         EFFECT_MAX
00649 } effectTypes_t;
00650 
00651 // NOTE: may not have more than 16
00652 typedef enum {
00653         PW_NONE,
00654 
00655         PW_QUAD,
00656         PW_BATTLESUIT,
00657         PW_PULL,
00658         //PW_INVIS, //rww - removed
00659         //PW_REGEN, //rww - removed
00660         //PW_FLIGHT, //rww - removed
00661 
00662         PW_REDFLAG,
00663         PW_BLUEFLAG,
00664         PW_NEUTRALFLAG,
00665 
00666         PW_SHIELDHIT,
00667 
00668         //PW_SCOUT, //rww - removed
00669         //PW_GUARD, //rww - removed
00670         //PW_DOUBLER, //rww - removed
00671         //PW_AMMOREGEN, //rww - removed
00672         PW_SPEEDBURST,
00673         PW_DISINT_4,
00674         PW_SPEED,
00675         PW_CLOAKED,
00676         PW_FORCE_ENLIGHTENED_LIGHT,
00677         PW_FORCE_ENLIGHTENED_DARK,
00678         PW_FORCE_BOON,
00679         PW_YSALAMIRI,
00680 
00681         PW_NUM_POWERUPS
00682 
00683 };
00684 typedef int powerup_t;
00685 
00686 typedef enum {
00687         HI_NONE,
00688 
00689         HI_SEEKER,
00690         HI_SHIELD,
00691         HI_MEDPAC,
00692         HI_MEDPAC_BIG,
00693         HI_BINOCULARS,
00694         HI_SENTRY_GUN,
00695         HI_JETPACK,
00696 
00697         HI_HEALTHDISP,
00698         HI_AMMODISP,
00699         HI_EWEB,
00700         HI_CLOAK,
00701 
00702         HI_NUM_HOLDABLE
00703 };
00704 typedef int holdable_t;
00705 
00706 
00707 typedef enum {
00708         CTFMESSAGE_FRAGGED_FLAG_CARRIER,
00709         CTFMESSAGE_FLAG_RETURNED,
00710         CTFMESSAGE_PLAYER_RETURNED_FLAG,
00711         CTFMESSAGE_PLAYER_CAPTURED_FLAG,
00712         CTFMESSAGE_PLAYER_GOT_FLAG
00713 } ctfMsg_t;
00714 
00715 // reward sounds (stored in ps->persistant[PERS_PLAYEREVENTS])
00716 #define PLAYEREVENT_DENIEDREWARD                0x0001
00717 #define PLAYEREVENT_GAUNTLETREWARD              0x0002
00718 
00719 // entityState_t->event values
00720 // entity events are for effects that take place reletive
00721 // to an existing entities origin.  Very network efficient.
00722 
00723 // two bits at the top of the entityState->event field
00724 // will be incremented with each change in the event so
00725 // that an identical event started twice in a row can
00726 // be distinguished.  And off the value with ~EV_EVENT_BITS
00727 // to retrieve the actual event number
00728 #define EV_EVENT_BIT1           0x00000100
00729 #define EV_EVENT_BIT2           0x00000200
00730 #define EV_EVENT_BITS           (EV_EVENT_BIT1|EV_EVENT_BIT2)
00731 
00732 #define EVENT_VALID_MSEC        300
00733 
00734 typedef enum
00735 {
00736         PDSOUND_NONE,
00737         PDSOUND_PROTECTHIT,
00738         PDSOUND_PROTECT,
00739         PDSOUND_ABSORBHIT,
00740         PDSOUND_ABSORB,
00741         PDSOUND_FORCEJUMP,
00742         PDSOUND_FORCEGRIP
00743 } pdSounds_t;
00744 
00745 typedef enum {
00746         EV_NONE,
00747 
00748         EV_CLIENTJOIN,
00749 
00750         EV_FOOTSTEP,
00751         EV_FOOTSTEP_METAL,
00752         EV_FOOTSPLASH,
00753         EV_FOOTWADE,
00754         EV_SWIM,
00755 
00756         EV_STEP_4,
00757         EV_STEP_8,
00758         EV_STEP_12,
00759         EV_STEP_16,
00760 
00761         EV_FALL,
00762 
00763         EV_JUMP_PAD,                    // boing sound at origin, jump sound on player
00764 
00765         EV_GHOUL2_MARK,                 //create a projectile impact mark on something with a client-side g2 instance.
00766 
00767         EV_GLOBAL_DUEL,
00768         EV_PRIVATE_DUEL,
00769 
00770         EV_JUMP,
00771         EV_ROLL,
00772         EV_WATER_TOUCH, // foot touches
00773         EV_WATER_LEAVE, // foot leaves
00774         EV_WATER_UNDER, // head touches
00775         EV_WATER_CLEAR, // head leaves
00776 
00777         EV_ITEM_PICKUP,                 // normal item pickups are predictable
00778         EV_GLOBAL_ITEM_PICKUP,  // powerup / team sounds are broadcast to everyone
00779 
00780         EV_VEH_FIRE,
00781 
00782         EV_NOAMMO,
00783         EV_CHANGE_WEAPON,
00784         EV_FIRE_WEAPON,
00785         EV_ALT_FIRE,
00786         EV_SABER_ATTACK,
00787         EV_SABER_HIT,
00788         EV_SABER_BLOCK,
00789         EV_SABER_CLASHFLARE,
00790         EV_SABER_UNHOLSTER,
00791         EV_BECOME_JEDIMASTER,
00792         EV_DISRUPTOR_MAIN_SHOT,
00793         EV_DISRUPTOR_SNIPER_SHOT,
00794         EV_DISRUPTOR_SNIPER_MISS,
00795         EV_DISRUPTOR_HIT,
00796         EV_DISRUPTOR_ZOOMSOUND,
00797 
00798         EV_PREDEFSOUND,
00799 
00800         EV_TEAM_POWER,
00801 
00802         EV_SCREENSHAKE,
00803 
00804         EV_LOCALTIMER,
00805 
00806         EV_USE,                 // +Use key
00807 
00808         EV_USE_ITEM0,
00809         EV_USE_ITEM1,
00810         EV_USE_ITEM2,
00811         EV_USE_ITEM3,
00812         EV_USE_ITEM4,
00813         EV_USE_ITEM5,
00814         EV_USE_ITEM6,
00815         EV_USE_ITEM7,
00816         EV_USE_ITEM8,
00817         EV_USE_ITEM9,
00818         EV_USE_ITEM10,
00819         EV_USE_ITEM11,
00820         EV_USE_ITEM12,
00821         EV_USE_ITEM13,
00822         EV_USE_ITEM14,
00823         EV_USE_ITEM15,
00824 
00825         EV_ITEMUSEFAIL,
00826 
00827         EV_ITEM_RESPAWN,
00828         EV_ITEM_POP,
00829         EV_PLAYER_TELEPORT_IN,
00830         EV_PLAYER_TELEPORT_OUT,
00831 
00832         EV_GRENADE_BOUNCE,              // eventParm will be the soundindex
00833         EV_MISSILE_STICK,               // eventParm will be the soundindex
00834 
00835         EV_PLAY_EFFECT,
00836         EV_PLAY_EFFECT_ID,
00837         EV_PLAY_PORTAL_EFFECT_ID,
00838 
00839         EV_PLAYDOORSOUND,
00840         EV_PLAYDOORLOOPSOUND,
00841         EV_BMODEL_SOUND,
00842 
00843         EV_MUTE_SOUND,
00844         EV_VOICECMD_SOUND,
00845         EV_GENERAL_SOUND,
00846         EV_GLOBAL_SOUND,                // no attenuation
00847         EV_GLOBAL_TEAM_SOUND,
00848         EV_ENTITY_SOUND,
00849 
00850         EV_PLAY_ROFF,
00851 
00852         EV_GLASS_SHATTER,
00853         EV_DEBRIS,
00854         EV_MISC_MODEL_EXP,
00855 
00856         EV_CONC_ALT_IMPACT,
00857 
00858         EV_MISSILE_HIT,
00859         EV_MISSILE_MISS,
00860         EV_MISSILE_MISS_METAL,
00861         EV_BULLET,                              // otherEntity is the shooter
00862 
00863         EV_PAIN,
00864         EV_DEATH1,
00865         EV_DEATH2,
00866         EV_DEATH3,
00867         EV_OBITUARY,
00868 
00869         EV_POWERUP_QUAD,
00870         EV_POWERUP_BATTLESUIT,
00871         //EV_POWERUP_REGEN,
00872 
00873         EV_FORCE_DRAINED,
00874 
00875         EV_GIB_PLAYER,                  // gib a previously living player
00876         EV_SCOREPLUM,                   // score plum
00877 
00878         EV_CTFMESSAGE,
00879 
00880         EV_BODYFADE,
00881 
00882         EV_SIEGE_ROUNDOVER,
00883         EV_SIEGE_OBJECTIVECOMPLETE,
00884 
00885         EV_DESTROY_GHOUL2_INSTANCE,
00886 
00887         EV_DESTROY_WEAPON_MODEL,
00888 
00889         EV_GIVE_NEW_RANK,
00890         EV_SET_FREE_SABER,
00891         EV_SET_FORCE_DISABLE,
00892 
00893         EV_WEAPON_CHARGE,
00894         EV_WEAPON_CHARGE_ALT,
00895 
00896         EV_SHIELD_HIT,
00897 
00898         EV_DEBUG_LINE,
00899         EV_TESTLINE,
00900         EV_STOPLOOPINGSOUND,
00901         EV_STARTLOOPINGSOUND,
00902         EV_TAUNT,
00903 
00904         //rww - Begin NPC sound events
00905         EV_ANGER1,      //Say when acquire an enemy when didn't have one before
00906         EV_ANGER2,
00907         EV_ANGER3,
00908 
00909         EV_VICTORY1,    //Say when killed an enemy
00910         EV_VICTORY2,
00911         EV_VICTORY3,
00912 
00913         EV_CONFUSE1,    //Say when confused
00914         EV_CONFUSE2,
00915         EV_CONFUSE3,
00916 
00917         EV_PUSHED1,             //Say when pushed
00918         EV_PUSHED2,
00919         EV_PUSHED3,
00920 
00921         EV_CHOKE1,              //Say when choking
00922         EV_CHOKE2,
00923         EV_CHOKE3,
00924 
00925         EV_FFWARN,              //ffire founds
00926         EV_FFTURN,
00927         //extra sounds for ST
00928         EV_CHASE1,
00929         EV_CHASE2,
00930         EV_CHASE3,
00931         EV_COVER1,
00932         EV_COVER2,
00933         EV_COVER3,
00934         EV_COVER4,
00935         EV_COVER5,
00936         EV_DETECTED1,
00937         EV_DETECTED2,
00938         EV_DETECTED3,
00939         EV_DETECTED4,
00940         EV_DETECTED5,
00941         EV_LOST1,
00942         EV_OUTFLANK1,
00943         EV_OUTFLANK2,
00944         EV_ESCAPING1,
00945         EV_ESCAPING2,
00946         EV_ESCAPING3,
00947         EV_GIVEUP1,
00948         EV_GIVEUP2,
00949         EV_GIVEUP3,
00950         EV_GIVEUP4,
00951         EV_LOOK1,
00952         EV_LOOK2,
00953         EV_SIGHT1,
00954         EV_SIGHT2,
00955         EV_SIGHT3,
00956         EV_SOUND1,
00957         EV_SOUND2,
00958         EV_SOUND3,
00959         EV_SUSPICIOUS1,
00960         EV_SUSPICIOUS2,
00961         EV_SUSPICIOUS3,
00962         EV_SUSPICIOUS4,
00963         EV_SUSPICIOUS5,
00964         //extra sounds for Jedi
00965         EV_COMBAT1,
00966         EV_COMBAT2,
00967         EV_COMBAT3,
00968         EV_JDETECTED1,
00969         EV_JDETECTED2,
00970         EV_JDETECTED3,
00971         EV_TAUNT1,
00972         EV_TAUNT2,
00973         EV_TAUNT3,
00974         EV_JCHASE1,
00975         EV_JCHASE2,
00976         EV_JCHASE3,
00977         EV_JLOST1,
00978         EV_JLOST2,
00979         EV_JLOST3,
00980         EV_DEFLECT1,
00981         EV_DEFLECT2,
00982         EV_DEFLECT3,
00983         EV_GLOAT1,
00984         EV_GLOAT2,
00985         EV_GLOAT3,
00986         EV_PUSHFAIL,
00987 
00988         EV_SIEGESPEC,
00989         
00990 } entity_event_t;                       // There is a maximum of 256 events (8 bits transmission, 2 high bits for uniqueness)
00991 
00992 
00993 typedef enum {
00994         GTS_RED_CAPTURE,
00995         GTS_BLUE_CAPTURE,
00996         GTS_RED_RETURN,
00997         GTS_BLUE_RETURN,
00998         GTS_RED_TAKEN,
00999         GTS_BLUE_TAKEN,
01000         GTS_REDTEAM_SCORED,
01001         GTS_BLUETEAM_SCORED,
01002         GTS_REDTEAM_TOOK_LEAD,
01003         GTS_BLUETEAM_TOOK_LEAD,
01004         GTS_TEAMS_ARE_TIED
01005 } global_team_sound_t;
01006 
01007 
01008 
01009 typedef enum {
01010         TEAM_FREE,
01011         TEAM_RED,
01012         TEAM_BLUE,
01013         TEAM_SPECTATOR,
01014 
01015         TEAM_NUM_TEAMS
01016 };
01017 typedef int team_t;
01018 
01019 typedef enum {
01020         DUELTEAM_FREE,
01021         DUELTEAM_LONE,
01022         DUELTEAM_DOUBLE,
01023 
01024         DUELTEAM_SINGLE,                // for regular duel matches (not power duel)
01025 } duelTeam_t;
01026 
01027 // Time between location updates
01028 #define TEAM_LOCATION_UPDATE_TIME               1000
01029 
01030 // How many players on the overlay
01031 #define TEAM_MAXOVERLAY         32
01032 
01033 //team task
01034 typedef enum {
01035         TEAMTASK_NONE,
01036         TEAMTASK_OFFENSE, 
01037         TEAMTASK_DEFENSE,
01038         TEAMTASK_PATROL,
01039         TEAMTASK_FOLLOW,
01040         TEAMTASK_RETRIEVE,
01041         TEAMTASK_ESCORT,
01042         TEAMTASK_CAMP
01043 } teamtask_t;
01044 
01045 // means of death
01046 typedef enum {
01047         MOD_UNKNOWN,
01048         MOD_STUN_BATON,
01049         MOD_MELEE,
01050         MOD_SABER,
01051         MOD_BRYAR_PISTOL,
01052         MOD_BRYAR_PISTOL_ALT,
01053         MOD_BLASTER,
01054         MOD_TURBLAST,
01055         MOD_DISRUPTOR,
01056         MOD_DISRUPTOR_SPLASH,
01057         MOD_DISRUPTOR_SNIPER,
01058         MOD_BOWCASTER,
01059         MOD_REPEATER,
01060         MOD_REPEATER_ALT,
01061         MOD_REPEATER_ALT_SPLASH,
01062         MOD_DEMP2,
01063         MOD_DEMP2_ALT,
01064         MOD_FLECHETTE,
01065         MOD_FLECHETTE_ALT_SPLASH,
01066         MOD_ROCKET,
01067         MOD_ROCKET_SPLASH,
01068         MOD_ROCKET_HOMING,
01069         MOD_ROCKET_HOMING_SPLASH,
01070         MOD_THERMAL,
01071         MOD_THERMAL_SPLASH,
01072         MOD_TRIP_MINE_SPLASH,
01073         MOD_TIMED_MINE_SPLASH,
01074         MOD_DET_PACK_SPLASH,
01075         MOD_VEHICLE,
01076         MOD_CONC,
01077         MOD_CONC_ALT,
01078         MOD_FORCE_DARK,
01079         MOD_SENTRY,
01080         MOD_WATER,
01081         MOD_SLIME,
01082         MOD_LAVA,
01083         MOD_CRUSH,
01084         MOD_TELEFRAG,
01085         MOD_FALLING,
01086         MOD_SUICIDE,
01087         MOD_TARGET_LASER,
01088         MOD_TRIGGER_HURT,
01089         MOD_TEAM_CHANGE,
01090         //AURELIO: when/if you put this back in, remember to make a case for it in all the other places where
01091         //mod's are checked. Also, it probably isn't the most elegant solution for what you want - just add
01092         //a frag back to the player after you call the player_die (and keep a local of his pre-death score to
01093         //make sure he actually lost points, there may be cases where you don't lose points on changing teams
01094         //or suiciding, and so you would actually be giving him a point) -Rich
01095         // I put it back in for now, if it becomes a problem we'll work around it later (it shouldn't though)...
01096         MOD_MAX
01097 } meansOfDeath_t;
01098 
01099 
01100 //---------------------------------------------------------
01101 
01102 // gitem_t->type
01103 typedef enum {
01104         IT_BAD,
01105         IT_WEAPON,                              // EFX: rotate + upscale + minlight
01106         IT_AMMO,                                // EFX: rotate
01107         IT_ARMOR,                               // EFX: rotate + minlight
01108         IT_HEALTH,                              // EFX: static external sphere + rotating internal
01109         IT_POWERUP,                             // instant on, timer based
01110                                                         // EFX: rotate + external ring that rotates
01111         IT_HOLDABLE,                    // single use, holdable item
01112                                                         // EFX: rotate + bob
01113         IT_PERSISTANT_POWERUP,
01114         IT_TEAM
01115 };
01116 typedef int itemType_t;
01117 
01118 #define MAX_ITEM_MODELS 4
01119 
01120 typedef struct gitem_s {
01121         char            *classname;     // spawning name
01122         char            *pickup_sound;
01123         char            *world_model[MAX_ITEM_MODELS];
01124         char            *view_model;
01125         char            *icon;
01126 //      char            *pickup_name;   // for printing on pickup
01127 
01128         int                     quantity;               // for ammo how much, or duration of powerup
01129         itemType_t  giType;                     // IT_* flags
01130 
01131         int                     giTag;
01132 
01133         char            *precaches;             // string of all models and images this item will use
01134         char            *sounds;                // string of all sounds this item will use
01135         char            *description;
01136 } gitem_t;
01137 
01138 // included in both the game dll and the client
01139 #include "../namespace_begin.h"
01140 
01141 extern  gitem_t bg_itemlist[];
01142 extern  int             bg_numItems;
01143 
01144 float vectoyaw( const vec3_t vec );
01145 
01146 gitem_t *BG_FindItem( const char *classname );
01147 gitem_t *BG_FindItemForWeapon( weapon_t weapon );
01148 gitem_t *BG_FindItemForPowerup( powerup_t pw );
01149 gitem_t *BG_FindItemForHoldable( holdable_t pw );
01150 #define ITEM_INDEX(x) ((x)-bg_itemlist)
01151 
01152 qboolean        BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const playerState_t *ps );
01153 
01154 #include "../namespace_end.h"
01155 
01156 
01157 #define SABER_BLOCK_DUR 150             // number of milliseconds a block animation should take.
01158 
01159 
01160 
01161 // g_dmflags->integer flags
01162 #define DF_NO_FALLING                   8
01163 #define DF_FIXED_FOV                    16
01164 #define DF_NO_FOOTSTEPS                 32
01165 
01166 //rwwRMG - added in CONTENTS_TERRAIN
01167 // content masks
01168 #define MASK_ALL                                (-1)
01169 #define MASK_SOLID                              (CONTENTS_SOLID|CONTENTS_TERRAIN)
01170 #define MASK_PLAYERSOLID                (CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_BODY|CONTENTS_TERRAIN)
01171 #define MASK_NPCSOLID                   (CONTENTS_SOLID|CONTENTS_MONSTERCLIP|CONTENTS_BODY|CONTENTS_TERRAIN)
01172 #define MASK_DEADSOLID                  (CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_TERRAIN)
01173 #define MASK_WATER                              (CONTENTS_WATER|CONTENTS_LAVA|CONTENTS_SLIME)
01174 #define MASK_OPAQUE                             (CONTENTS_SOLID|CONTENTS_SLIME|CONTENTS_LAVA|CONTENTS_TERRAIN)
01175 #define MASK_SHOT                               (CONTENTS_SOLID|CONTENTS_BODY|CONTENTS_CORPSE|CONTENTS_TERRAIN)
01176 
01177 
01178 // ET_FX States (stored in modelindex2)
01179 
01180 #define FX_STATE_OFF                    0
01181 #define FX_STATE_ONE_SHOT               1
01182 #define FX_STATE_ONE_SHOT_LIMIT 10
01183 #define FX_STATE_CONTINUOUS             20
01184 
01185 //
01186 // entityState_t->eType
01187 //
01188 typedef enum {
01189         ET_GENERAL,
01190         ET_PLAYER,
01191         ET_ITEM,
01192         ET_MISSILE,
01193         ET_SPECIAL,                             // rww - force fields
01194         ET_HOLOCRON,                    // rww - holocron icon displays
01195         ET_MOVER,
01196         ET_BEAM,
01197         ET