Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

bg_public.h

Go to the documentation of this file.
00001 /*
00002 ===========================================================================
00003 Copyright (C) 1999-2005 Id Software, Inc.
00004 
00005 This file is part of Quake III Arena source code.
00006 
00007 Quake III Arena source code is free software; you can redistribute it
00008 and/or modify it under the terms of the GNU General Public License as
00009 published by the Free Software Foundation; either version 2 of the License,
00010 or (at your option) any later version.
00011 
00012 Quake III Arena source code is distributed in the hope that it will be
00013 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Foobar; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 ===========================================================================
00021 */
00022 //
00023 // bg_public.h -- definitions shared by both the server game and client game modules
00024 
00025 // because games can change separately from the main system version, we need a
00026 // second version that must match between game and cgame
00027 
00028 #define GAME_VERSION        "baseq3-1"
00029 
00030 #define DEFAULT_GRAVITY     800
00031 #define GIB_HEALTH          -40
00032 #define ARMOR_PROTECTION    0.66
00033 
00034 #define MAX_ITEMS           256
00035 
00036 #define RANK_TIED_FLAG      0x4000
00037 
00038 #define DEFAULT_SHOTGUN_SPREAD  700
00039 #define DEFAULT_SHOTGUN_COUNT   11
00040 
00041 #define ITEM_RADIUS         15      // item sizes are needed for client side pickup detection
00042 
00043 #define LIGHTNING_RANGE     768
00044 
00045 #define SCORE_NOT_PRESENT   -9999   // for the CS_SCORES[12] when only one player is present
00046 
00047 #define VOTE_TIME           30000   // 30 seconds before vote times out
00048 
00049 #define MINS_Z              -24
00050 #define DEFAULT_VIEWHEIGHT  26
00051 #define CROUCH_VIEWHEIGHT   12
00052 #define DEAD_VIEWHEIGHT     -16
00053 
00054 //
00055 // config strings are a general means of communicating variable length strings
00056 // from the server to all connected clients.
00057 //
00058 
00059 // CS_SERVERINFO and CS_SYSTEMINFO are defined in q_shared.h
00060 #define CS_MUSIC                2
00061 #define CS_MESSAGE              3       // from the map worldspawn's message field
00062 #define CS_MOTD                 4       // g_motd string for server message of the day
00063 #define CS_WARMUP               5       // server time when the match will be restarted
00064 #define CS_SCORES1              6
00065 #define CS_SCORES2              7
00066 #define CS_VOTE_TIME            8
00067 #define CS_VOTE_STRING          9
00068 #define CS_VOTE_YES             10
00069 #define CS_VOTE_NO              11
00070 
00071 #define CS_TEAMVOTE_TIME        12
00072 #define CS_TEAMVOTE_STRING      14
00073 #define CS_TEAMVOTE_YES         16
00074 #define CS_TEAMVOTE_NO          18
00075 
00076 #define CS_GAME_VERSION         20
00077 #define CS_LEVEL_START_TIME     21      // so the timer only shows the current level
00078 #define CS_INTERMISSION         22      // when 1, fraglimit/timelimit has been hit and intermission will start in a second or two
00079 #define CS_FLAGSTATUS           23      // string indicating flag status in CTF
00080 #define CS_SHADERSTATE          24
00081 #define CS_BOTINFO              25
00082 
00083 #define CS_ITEMS                27      // string of 0's and 1's that tell which items are present
00084 
00085 #define CS_MODELS               32
00086 #define CS_SOUNDS               (CS_MODELS+MAX_MODELS)
00087 #define CS_PLAYERS              (CS_SOUNDS+MAX_SOUNDS)
00088 #define CS_LOCATIONS            (CS_PLAYERS+MAX_CLIENTS)
00089 #define CS_PARTICLES            (CS_LOCATIONS+MAX_LOCATIONS) 
00090 
00091 #define CS_MAX                  (CS_PARTICLES+MAX_LOCATIONS)
00092 
00093 #if (CS_MAX) > MAX_CONFIGSTRINGS
00094 #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS
00095 #endif
00096 
00097 typedef enum {
00098     GT_FFA,             // free for all
00099     GT_TOURNAMENT,      // one on one tournament
00100     GT_SINGLE_PLAYER,   // single player ffa
00101 
00102     //-- team games go after this --
00103 
00104     GT_TEAM,            // team deathmatch
00105     GT_CTF,             // capture the flag
00106     GT_1FCTF,
00107     GT_OBELISK,
00108     GT_HARVESTER,
00109     GT_MAX_GAME_TYPE
00110 } gametype_t;
00111 
00112 typedef enum { GENDER_MALE, GENDER_FEMALE, GENDER_NEUTER } gender_t;
00113 
00114 /*
00115 ===================================================================================
00116 
00117 PMOVE MODULE
00118 
00119 The pmove code takes a player_state_t and a usercmd_t and generates a new player_state_t
00120 and some other output data.  Used for local prediction on the client game and true
00121 movement on the server game.
00122 ===================================================================================
00123 */
00124 
00125 typedef enum {
00126     PM_NORMAL,      // can accelerate and turn
00127     PM_NOCLIP,      // noclip movement
00128     PM_SPECTATOR,   // still run into walls
00129     PM_DEAD,        // no acceleration or turning, but free falling
00130     PM_FREEZE,      // stuck in place with no control
00131     PM_INTERMISSION,    // no movement or status bar
00132     PM_SPINTERMISSION   // no movement or status bar
00133 } pmtype_t;
00134 
00135 typedef enum {
00136     WEAPON_READY, 
00137     WEAPON_RAISING,
00138     WEAPON_DROPPING,
00139     WEAPON_FIRING
00140 } weaponstate_t;
00141 
00142 // pmove->pm_flags
00143 #define PMF_DUCKED          1
00144 #define PMF_JUMP_HELD       2
00145 #define PMF_BACKWARDS_JUMP  8       // go into backwards land
00146 #define PMF_BACKWARDS_RUN   16      // coast down to backwards run
00147 #define PMF_TIME_LAND       32      // pm_time is time before rejump
00148 #define PMF_TIME_KNOCKBACK  64      // pm_time is an air-accelerate only time
00149 #define PMF_TIME_WATERJUMP  256     // pm_time is waterjump
00150 #define PMF_RESPAWNED       512     // clear after attack and jump buttons come up
00151 #define PMF_USE_ITEM_HELD   1024
00152 #define PMF_GRAPPLE_PULL    2048    // pull towards grapple location
00153 #define PMF_FOLLOW          4096    // spectate following another player
00154 #define PMF_SCOREBOARD      8192    // spectate as a scoreboard
00155 #define PMF_INVULEXPAND     16384   // invulnerability sphere set to full size
00156 
00157 #define PMF_ALL_TIMES   (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK)
00158 
00159 #define MAXTOUCH    32
00160 typedef struct {
00161     // state (in / out)
00162     playerState_t   *ps;
00163 
00164     // command (in)
00165     usercmd_t   cmd;
00166     int         tracemask;          // collide against these types of surfaces
00167     int         debugLevel;         // if set, diagnostic output will be printed
00168     qboolean    noFootsteps;        // if the game is setup for no footsteps by the server
00169     qboolean    gauntletHit;        // true if a gauntlet attack would actually hit something
00170 
00171     int         framecount;
00172 
00173     // results (out)
00174     int         numtouch;
00175     int         touchents[MAXTOUCH];
00176 
00177     vec3_t      mins, maxs;         // bounding box size
00178 
00179     int         watertype;
00180     int         waterlevel;
00181 
00182     float       xyspeed;
00183 
00184     // for fixed msec Pmove
00185     int         pmove_fixed;
00186     int         pmove_msec;
00187 
00188     // callbacks to test the world
00189     // these will be different functions during game and cgame
00190     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 );
00191     int         (*pointcontents)( const vec3_t point, int passEntityNum );
00192 } pmove_t;
00193 
00194 // if a full pmove isn't done on the client, you can just update the angles
00195 void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd );
00196 void Pmove (pmove_t *pmove);
00197 
00198 //===================================================================================
00199 
00200 
00201 // player_state->stats[] indexes
00202 // NOTE: may not have more than 16
00203 typedef enum {
00204     STAT_HEALTH,
00205     STAT_HOLDABLE_ITEM,
00206 #ifdef MISSIONPACK
00207     STAT_PERSISTANT_POWERUP,
00208 #endif
00209     STAT_WEAPONS,                   // 16 bit fields
00210     STAT_ARMOR,             
00211     STAT_DEAD_YAW,                  // look this direction when dead (FIXME: get rid of?)
00212     STAT_CLIENTS_READY,             // bit mask of clients wishing to exit the intermission (FIXME: configstring?)
00213     STAT_MAX_HEALTH                 // health / armor limit, changable by handicap
00214 } statIndex_t;
00215 
00216 
00217 // player_state->persistant[] indexes
00218 // these fields are the only part of player_state that isn't
00219 // cleared on respawn
00220 // NOTE: may not have more than 16
00221 typedef enum {
00222     PERS_SCORE,                     // !!! MUST NOT CHANGE, SERVER AND GAME BOTH REFERENCE !!!
00223     PERS_HITS,                      // total points damage inflicted so damage beeps can sound on change
00224     PERS_RANK,                      // player rank or team rank
00225     PERS_TEAM,                      // player team
00226     PERS_SPAWN_COUNT,               // incremented every respawn
00227     PERS_PLAYEREVENTS,              // 16 bits that can be flipped for events
00228     PERS_ATTACKER,                  // clientnum of last damage inflicter
00229     PERS_ATTACKEE_ARMOR,            // health/armor of last person we attacked
00230     PERS_KILLED,                    // count of the number of times you died
00231     // player awards tracking
00232     PERS_IMPRESSIVE_COUNT,          // two railgun hits in a row
00233     PERS_EXCELLENT_COUNT,           // two successive kills in a short amount of time
00234     PERS_DEFEND_COUNT,              // defend awards
00235     PERS_ASSIST_COUNT,              // assist awards
00236     PERS_GAUNTLET_FRAG_COUNT,       // kills with the guantlet
00237     PERS_CAPTURES                   // captures
00238 } persEnum_t;
00239 
00240 
00241 // entityState_t->eFlags
00242 #define EF_DEAD             0x00000001      // don't draw a foe marker over players with EF_DEAD
00243 #ifdef MISSIONPACK
00244 #define EF_TICKING          0x00000002      // used to make players play the prox mine ticking sound
00245 #endif
00246 #define EF_TELEPORT_BIT     0x00000004      // toggled every time the origin abruptly changes
00247 #define EF_AWARD_EXCELLENT  0x00000008      // draw an excellent sprite
00248 #define EF_PLAYER_EVENT     0x00000010
00249 #define EF_BOUNCE           0x00000010      // for missiles
00250 #define EF_BOUNCE_HALF      0x00000020      // for missiles
00251 #define EF_AWARD_GAUNTLET   0x00000040      // draw a gauntlet sprite
00252 #define EF_NODRAW           0x00000080      // may have an event, but no model (unspawned items)
00253 #define EF_FIRING           0x00000100      // for lightning gun
00254 #define EF_KAMIKAZE         0x00000200
00255 #define EF_MOVER_STOP       0x00000400      // will push otherwise
00256 #define EF_AWARD_CAP        0x00000800      // draw the capture sprite
00257 #define EF_TALK             0x00001000      // draw a talk balloon
00258 #define EF_CONNECTION       0x00002000      // draw a connection trouble sprite
00259 #define EF_VOTED            0x00004000      // already cast a vote
00260 #define EF_AWARD_IMPRESSIVE 0x00008000      // draw an impressive sprite
00261 #define EF_AWARD_DEFEND     0x00010000      // draw a defend sprite
00262 #define EF_AWARD_ASSIST     0x00020000      // draw a assist sprite
00263 #define EF_AWARD_DENIED     0x00040000      // denied
00264 #define EF_TEAMVOTED        0x00080000      // already cast a team vote
00265 
00266 // NOTE: may not have more than 16
00267 typedef enum {
00268     PW_NONE,
00269 
00270     PW_QUAD,
00271     PW_BATTLESUIT,
00272     PW_HASTE,
00273     PW_INVIS,
00274     PW_REGEN,
00275     PW_FLIGHT,
00276 
00277     PW_REDFLAG,
00278     PW_BLUEFLAG,
00279     PW_NEUTRALFLAG,
00280 
00281     PW_SCOUT,
00282     PW_GUARD,
00283     PW_DOUBLER,
00284     PW_AMMOREGEN,
00285     PW_INVULNERABILITY,
00286 
00287     PW_NUM_POWERUPS
00288 
00289 } powerup_t;
00290 
00291 typedef enum {
00292     HI_NONE,
00293 
00294     HI_TELEPORTER,
00295     HI_MEDKIT,
00296     HI_KAMIKAZE,
00297     HI_PORTAL,
00298     HI_INVULNERABILITY,
00299 
00300     HI_NUM_HOLDABLE
00301 } holdable_t;
00302 
00303 
00304 typedef enum {
00305     WP_NONE,
00306 
00307     WP_GAUNTLET,
00308     WP_MACHINEGUN,
00309     WP_SHOTGUN,
00310     WP_GRENADE_LAUNCHER,
00311     WP_ROCKET_LAUNCHER,
00312     WP_LIGHTNING,
00313     WP_RAILGUN,
00314     WP_PLASMAGUN,
00315     WP_BFG,
00316     WP_GRAPPLING_HOOK,
00317 #ifdef MISSIONPACK
00318     WP_NAILGUN,
00319     WP_PROX_LAUNCHER,
00320     WP_CHAINGUN,
00321 #endif
00322 
00323     WP_NUM_WEAPONS
00324 } weapon_t;
00325 
00326 
00327 // reward sounds (stored in ps->persistant[PERS_PLAYEREVENTS])
00328 #define PLAYEREVENT_DENIEDREWARD        0x0001
00329 #define PLAYEREVENT_GAUNTLETREWARD      0x0002
00330 #define PLAYEREVENT_HOLYSHIT            0x0004
00331 
00332 // entityState_t->event values
00333 // entity events are for effects that take place reletive
00334 // to an existing entities origin.  Very network efficient.
00335 
00336 // two bits at the top of the entityState->event field
00337 // will be incremented with each change in the event so
00338 // that an identical event started twice in a row can
00339 // be distinguished.  And off the value with ~EV_EVENT_BITS
00340 // to retrieve the actual event number
00341 #define EV_EVENT_BIT1       0x00000100
00342 #define EV_EVENT_BIT2       0x00000200
00343 #define EV_EVENT_BITS       (EV_EVENT_BIT1|EV_EVENT_BIT2)
00344 
00345 #define EVENT_VALID_MSEC    300
00346 
00347 typedef enum {
00348     EV_NONE,
00349 
00350     EV_FOOTSTEP,
00351     EV_FOOTSTEP_METAL,
00352     EV_FOOTSPLASH,
00353     EV_FOOTWADE,
00354     EV_SWIM,
00355 
00356     EV_STEP_4,
00357     EV_STEP_8,
00358     EV_STEP_12,
00359     EV_STEP_16,
00360 
00361     EV_FALL_SHORT,
00362     EV_FALL_MEDIUM,
00363     EV_FALL_FAR,
00364 
00365     EV_JUMP_PAD,            // boing sound at origin, jump sound on player
00366 
00367     EV_JUMP,
00368     EV_WATER_TOUCH, // foot touches
00369     EV_WATER_LEAVE, // foot leaves
00370     EV_WATER_UNDER, // head touches
00371     EV_WATER_CLEAR, // head leaves
00372 
00373     EV_ITEM_PICKUP,         // normal item pickups are predictable
00374     EV_GLOBAL_ITEM_PICKUP,  // powerup / team sounds are broadcast to everyone
00375 
00376     EV_NOAMMO,
00377     EV_CHANGE_WEAPON,
00378     EV_FIRE_WEAPON,
00379 
00380     EV_USE_ITEM0,
00381     EV_USE_ITEM1,
00382     EV_USE_ITEM2,
00383     EV_USE_ITEM3,
00384     EV_USE_ITEM4,
00385     EV_USE_ITEM5,
00386     EV_USE_ITEM6,
00387     EV_USE_ITEM7,
00388     EV_USE_ITEM8,
00389     EV_USE_ITEM9,
00390     EV_USE_ITEM10,
00391     EV_USE_ITEM11,
00392     EV_USE_ITEM12,
00393     EV_USE_ITEM13,
00394     EV_USE_ITEM14,
00395     EV_USE_ITEM15,
00396 
00397     EV_ITEM_RESPAWN,
00398     EV_ITEM_POP,
00399     EV_PLAYER_TELEPORT_IN,
00400     EV_PLAYER_TELEPORT_OUT,
00401 
00402     EV_GRENADE_BOUNCE,      // eventParm will be the soundindex
00403 
00404     EV_GENERAL_SOUND,
00405     EV_GLOBAL_SOUND,        // no attenuation
00406     EV_GLOBAL_TEAM_SOUND,
00407 
00408     EV_BULLET_HIT_FLESH,
00409     EV_BULLET_HIT_WALL,
00410 
00411     EV_MISSILE_HIT,
00412     EV_MISSILE_MISS,
00413     EV_MISSILE_MISS_METAL,
00414     EV_RAILTRAIL,
00415     EV_SHOTGUN,
00416     EV_BULLET,              // otherEntity is the shooter
00417 
00418     EV_PAIN,
00419     EV_DEATH1,
00420     EV_DEATH2,
00421     EV_DEATH3,
00422     EV_OBITUARY,
00423 
00424     EV_POWERUP_QUAD,
00425     EV_POWERUP_BATTLESUIT,
00426     EV_POWERUP_REGEN,
00427 
00428     EV_GIB_PLAYER,          // gib a previously living player
00429     EV_SCOREPLUM,           // score plum
00430 
00431 //#ifdef MISSIONPACK
00432     EV_PROXIMITY_MINE_STICK,
00433     EV_PROXIMITY_MINE_TRIGGER,
00434     EV_KAMIKAZE,            // kamikaze explodes
00435     EV_OBELISKEXPLODE,      // obelisk explodes
00436     EV_OBELISKPAIN,         // obelisk is in pain
00437     EV_INVUL_IMPACT,        // invulnerability sphere impact
00438     EV_JUICED,              // invulnerability juiced effect
00439     EV_LIGHTNINGBOLT,       // lightning bolt bounced of invulnerability sphere
00440 //#endif
00441 
00442     EV_DEBUG_LINE,
00443     EV_STOPLOOPINGSOUND,
00444     EV_TAUNT,
00445     EV_TAUNT_YES,
00446     EV_TAUNT_NO,
00447     EV_TAUNT_FOLLOWME,
00448     EV_TAUNT_GETFLAG,
00449     EV_TAUNT_GUARDBASE,
00450     EV_TAUNT_PATROL
00451 
00452 } entity_event_t;
00453 
00454 
00455 typedef enum {
00456     GTS_RED_CAPTURE,
00457     GTS_BLUE_CAPTURE,
00458     GTS_RED_RETURN,
00459     GTS_BLUE_RETURN,
00460     GTS_RED_TAKEN,
00461     GTS_BLUE_TAKEN,
00462     GTS_REDOBELISK_ATTACKED,
00463     GTS_BLUEOBELISK_ATTACKED,
00464     GTS_REDTEAM_SCORED,
00465     GTS_BLUETEAM_SCORED,
00466     GTS_REDTEAM_TOOK_LEAD,
00467     GTS_BLUETEAM_TOOK_LEAD,
00468     GTS_TEAMS_ARE_TIED,
00469     GTS_KAMIKAZE
00470 } global_team_sound_t;
00471 
00472 // animations
00473 typedef enum {
00474     BOTH_DEATH1,
00475     BOTH_DEAD1,
00476     BOTH_DEATH2,
00477     BOTH_DEAD2,
00478     BOTH_DEATH3,
00479     BOTH_DEAD3,
00480 
00481     TORSO_GESTURE,
00482 
00483     TORSO_ATTACK,
00484     TORSO_ATTACK2,
00485 
00486     TORSO_DROP,
00487     TORSO_RAISE,
00488 
00489     TORSO_STAND,
00490     TORSO_STAND2,
00491 
00492     LEGS_WALKCR,
00493     LEGS_WALK,
00494     LEGS_RUN,
00495     LEGS_BACK,
00496     LEGS_SWIM,
00497 
00498     LEGS_JUMP,
00499     LEGS_LAND,
00500 
00501     LEGS_JUMPB,
00502     LEGS_LANDB,
00503 
00504     LEGS_IDLE,
00505     LEGS_IDLECR,
00506 
00507     LEGS_TURN,
00508 
00509     TORSO_GETFLAG,
00510     TORSO_GUARDBASE,
00511     TORSO_PATROL,
00512     TORSO_FOLLOWME,
00513     TORSO_AFFIRMATIVE,
00514     TORSO_NEGATIVE,
00515 
00516     MAX_ANIMATIONS,
00517 
00518     LEGS_BACKCR,
00519     LEGS_BACKWALK,
00520     FLAG_RUN,
00521     FLAG_STAND,
00522     FLAG_STAND2RUN,
00523 
00524     MAX_TOTALANIMATIONS
00525 } animNumber_t;
00526 
00527 
00528 typedef struct animation_s {
00529     int     firstFrame;
00530     int     numFrames;
00531     int     loopFrames;         // 0 to numFrames
00532     int     frameLerp;          // msec between frames
00533     int     initialLerp;        // msec to get to first frame
00534     int     reversed;           // true if animation is reversed
00535     int     flipflop;           // true if animation should flipflop back to base
00536 } animation_t;
00537 
00538 
00539 // flip the togglebit every time an animation
00540 // changes so a restart of the same anim can be detected
00541 #define ANIM_TOGGLEBIT      128
00542 
00543 
00544 typedef enum {
00545     TEAM_FREE,
00546     TEAM_RED,
00547     TEAM_BLUE,
00548     TEAM_SPECTATOR,
00549 
00550     TEAM_NUM_TEAMS
00551 } team_t;
00552 
00553 // Time between location updates
00554 #define TEAM_LOCATION_UPDATE_TIME       1000
00555 
00556 // How many players on the overlay
00557 #define TEAM_MAXOVERLAY     32
00558 
00559 //team task
00560 typedef enum {
00561     TEAMTASK_NONE,
00562     TEAMTASK_OFFENSE, 
00563     TEAMTASK_DEFENSE,
00564     TEAMTASK_PATROL,
00565     TEAMTASK_FOLLOW,
00566     TEAMTASK_RETRIEVE,
00567     TEAMTASK_ESCORT,
00568     TEAMTASK_CAMP
00569 } teamtask_t;
00570 
00571 // means of death
00572 typedef enum {
00573     MOD_UNKNOWN,
00574     MOD_SHOTGUN,
00575     MOD_GAUNTLET,
00576     MOD_MACHINEGUN,
00577     MOD_GRENADE,
00578     MOD_GRENADE_SPLASH,
00579     MOD_ROCKET,
00580     MOD_ROCKET_SPLASH,
00581     MOD_PLASMA,
00582     MOD_PLASMA_SPLASH,
00583     MOD_RAILGUN,
00584     MOD_LIGHTNING,
00585     MOD_BFG,
00586     MOD_BFG_SPLASH,
00587     MOD_WATER,
00588     MOD_SLIME,
00589     MOD_LAVA,
00590     MOD_CRUSH,
00591     MOD_TELEFRAG,
00592     MOD_FALLING,
00593     MOD_SUICIDE,
00594     MOD_TARGET_LASER,
00595     MOD_TRIGGER_HURT,
00596 #ifdef MISSIONPACK
00597     MOD_NAIL,
00598     MOD_CHAINGUN,
00599     MOD_PROXIMITY_MINE,
00600     MOD_KAMIKAZE,
00601     MOD_JUICED,
00602 #endif
00603     MOD_GRAPPLE
00604 } meansOfDeath_t;
00605 
00606 
00607 //---------------------------------------------------------
00608 
00609 // gitem_t->type
00610 typedef enum {
00611     IT_BAD,
00612     IT_WEAPON,              // EFX: rotate + upscale + minlight
00613     IT_AMMO,                // EFX: rotate
00614     IT_ARMOR,               // EFX: rotate + minlight
00615     IT_HEALTH,              // EFX: static external sphere + rotating internal
00616     IT_POWERUP,             // instant on, timer based
00617                             // EFX: rotate + external ring that rotates
00618     IT_HOLDABLE,            // single use, holdable item
00619                             // EFX: rotate + bob
00620     IT_PERSISTANT_POWERUP,
00621     IT_TEAM
00622 } itemType_t;
00623 
00624 #define MAX_ITEM_MODELS 4
00625 
00626 typedef struct gitem_s {
00627     char        *classname; // spawning name
00628     char        *pickup_sound;
00629     char        *world_model[MAX_ITEM_MODELS];
00630 
00631     char        *icon;
00632     char        *pickup_name;   // for printing on pickup
00633 
00634     int         quantity;       // for ammo how much, or duration of powerup
00635     itemType_t  giType;         // IT_* flags
00636 
00637     int         giTag;
00638 
00639     char        *precaches;     // string of all models and images this item will use
00640     char        *sounds;        // string of all sounds this item will use
00641 } gitem_t;
00642 
00643 // included in both the game dll and the client
00644 extern  gitem_t bg_itemlist[];
00645 extern  int     bg_numItems;
00646 
00647 gitem_t *BG_FindItem( const char *pickupName );
00648 gitem_t *BG_FindItemForWeapon( weapon_t weapon );
00649 gitem_t *BG_FindItemForPowerup( powerup_t pw );
00650 gitem_t *BG_FindItemForHoldable( holdable_t pw );
00651 #define ITEM_INDEX(x) ((x)-bg_itemlist)
00652 
00653 qboolean    BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const playerState_t *ps );
00654 
00655 
00656 // g_dmflags->integer flags
00657 #define DF_NO_FALLING           8
00658 #define DF_FIXED_FOV            16
00659 #define DF_NO_FOOTSTEPS         32
00660 
00661 // content masks
00662 #define MASK_ALL                (-1)
00663 #define MASK_SOLID              (CONTENTS_SOLID)
00664 #define MASK_PLAYERSOLID        (CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_BODY)
00665 #define MASK_DEADSOLID          (CONTENTS_SOLID|CONTENTS_PLAYERCLIP)
00666 #define MASK_WATER              (CONTENTS_WATER|CONTENTS_LAVA|CONTENTS_SLIME)
00667 #define MASK_OPAQUE             (CONTENTS_SOLID|CONTENTS_SLIME|CONTENTS_LAVA)
00668 #define MASK_SHOT               (CONTENTS_SOLID|CONTENTS_BODY|CONTENTS_CORPSE)
00669 
00670 
00671 //
00672 // entityState_t->eType
00673 //
00674 typedef enum {
00675     ET_GENERAL,
00676     ET_PLAYER,
00677     ET_ITEM,
00678     ET_MISSILE,
00679     ET_MOVER,
00680     ET_BEAM,
00681     ET_PORTAL,
00682     ET_SPEAKER,
00683     ET_PUSH_TRIGGER,
00684     ET_TELEPORT_TRIGGER,
00685     ET_INVISIBLE,
00686     ET_GRAPPLE,             // grapple hooked on wall
00687     ET_TEAM,
00688 
00689     ET_EVENTS               // any of the EV_* events can be added freestanding
00690                             // by setting eType to ET_EVENTS + eventNum
00691                             // this avoids having to set eFlags and eventNum
00692 } entityType_t;
00693 
00694 
00695 
00696 void    BG_EvaluateTrajectory( const trajectory_t *tr, int atTime, vec3_t result );
00697 void    BG_EvaluateTrajectoryDelta( const trajectory_t *tr, int atTime, vec3_t result );
00698 
00699 void    BG_AddPredictableEventToPlayerstate( int newEvent, int eventParm, playerState_t *ps );
00700 
00701 void    BG_TouchJumpPad( playerState_t *ps, entityState_t *jumppad );
00702 
00703 void    BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean snap );
00704 void    BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s, int time, qboolean snap );
00705 
00706 qboolean    BG_PlayerTouchesItem( playerState_t *ps, entityState_t *item, int atTime );
00707 
00708 
00709 #define ARENAS_PER_TIER     4
00710 #define MAX_ARENAS          1024
00711 #define MAX_ARENAS_TEXT     8192
00712 
00713 #define MAX_BOTS            1024
00714 #define MAX_BOTS_TEXT       8192
00715 
00716 
00717 // Kamikaze
00718 
00719 // 1st shockwave times
00720 #define KAMI_SHOCKWAVE_STARTTIME        0
00721 #define KAMI_SHOCKWAVEFADE_STARTTIME    1500
00722 #define KAMI_SHOCKWAVE_ENDTIME          2000
00723 // explosion/implosion times
00724 #define KAMI_EXPLODE_STARTTIME          250
00725 #define KAMI_IMPLODE_STARTTIME          2000
00726 #define KAMI_IMPLODE_ENDTIME            2250
00727 // 2nd shockwave times
00728 #define KAMI_SHOCKWAVE2_STARTTIME       2000
00729 #define KAMI_SHOCKWAVE2FADE_STARTTIME   2500
00730 #define KAMI_SHOCKWAVE2_ENDTIME         3000
00731 // radius of the models without scaling
00732 #define KAMI_SHOCKWAVEMODEL_RADIUS      88
00733 #define KAMI_BOOMSPHEREMODEL_RADIUS     72
00734 // maximum radius of the models during the effect
00735 #define KAMI_SHOCKWAVE_MAXRADIUS        1320
00736 #define KAMI_BOOMSPHERE_MAXRADIUS       720
00737 #define KAMI_SHOCKWAVE2_MAXRADIUS       704
00738 

Generated on Thu Aug 25 12:37:30 2005 for Quake III Arena by  doxygen 1.3.9.1