1 /* 2 =========================================================================== 3 4 Return to Castle Wolfenstein single player GPL Source Code 5 Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. 6 7 This file is part of the Return to Castle Wolfenstein single player GPL Source Code (RTCW SP Source Code). 8 9 RTCW SP Source Code is free software: you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation, either version 3 of the License, or 12 (at your option) any later version. 13 14 RTCW SP Source Code is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with RTCW SP Source Code. If not, see <http://www.gnu.org/licenses/>. 21 22 In addition, the RTCW SP Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the RTCW SP Source Code. If not, please request a copy in writing from id Software at the address below. 23 24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. 25 26 =========================================================================== 27 */ 28 29 /* 30 * name: bg_public.h 31 * 32 * desc: definitions shared by both the server game and client game modules 33 * 34 */ 35 36 // because games can change separately from the main system version, we need a 37 // second version that must match between game and cgame 38 39 #define GAME_VERSION BASEGAME "-1" 40 41 #define DEFAULT_GRAVITY 800 42 #define GIB_HEALTH -40 43 #define ARMOR_PROTECTION 0.66 44 45 #define MAX_ITEMS 256 46 47 #define RANK_TIED_FLAG 0x4000 48 49 #define DEFAULT_SHOTGUN_SPREAD 700 50 #define DEFAULT_SHOTGUN_COUNT 11 51 52 //#define ITEM_RADIUS 15 // item sizes are needed for client side pickup detection 53 #define ITEM_RADIUS 10 // Rafael changed the radius so that the items would fit in the 3 new containers 54 55 // RF, zombie getup 56 #define TIMER_RESPAWN ( 38 * ( 1000 / 15 ) + 100 ) 57 58 #define LIGHTNING_RANGE 600 59 #define TESLA_RANGE 800 60 #define TESLA_SUPERSOLDIER_RANGE 2000 61 // JPW NERVE -- make flamethrower range variable with single/multiplayer -- actual routine is in bg_pmove.c 62 float Com_GetFlamethrowerRange( void ); 63 #define FLAMETHROWER_RANGE Com_GetFlamethrowerRange() 64 //#define FLAMETHROWER_RANGE 850 65 // jpw 66 #define ZOMBIE_FLAME_SCALE 0.3 67 #define ZOMBIE_FLAME_RADIUS ( FLAMETHROWER_RANGE * ZOMBIE_FLAME_SCALE ) 68 69 // RF, AI effects 70 #define PORTAL_ZOMBIE_SPAWNTIME 3000 71 #define PORTAL_FEMZOMBIE_SPAWNTIME 3000 72 73 #define SCORE_NOT_PRESENT -9999 // for the CS_SCORES[12] when only one player is present 74 75 #define VOTE_TIME 30000 // 30 seconds before vote times out 76 77 #define DEAD_SINK_DURATION 12000 78 #define DEAD_SINK_DEPTH 64 79 80 // Ridah, disabled these 81 #define MINS_Z -24 82 //#define DEFAULT_VIEWHEIGHT 26 83 //#define CROUCH_VIEWHEIGHT 12 84 // done. 85 86 // Rafael 87 // note to self: Corky test 88 //#define DEFAULT_VIEWHEIGHT 26 89 //#define CROUCH_VIEWHEIGHT 12 90 #define DEFAULT_VIEWHEIGHT 40 91 #define CROUCH_VIEWHEIGHT 16 92 #define DEAD_VIEWHEIGHT -16 93 94 // RF, temp only, use infantryss so we can test new anim system 95 //#define DEFAULT_MODEL "american" 96 #define DEFAULT_MODEL "bj2" 97 #define DEFAULT_HEAD "default" // technically the default head skin. this means "head_default.skin" for the head 98 99 // RF, on fire effects 100 #define FIRE_FLASH_TIME 2000 101 #define FIRE_FLASH_FADEIN_TIME 1000 102 103 #define LIGHTNING_FLASH_TIME 150 104 105 // RF, client damage identifiers 106 typedef enum { 107 CLDMG_SPIRIT, 108 CLDMG_FLAMETHROWER, 109 CLDMG_TESLA, 110 CLDMG_BOSS1LIGHTNING, 111 CLDMG_DEBRIS, 112 CLDMG_MAX 113 } clientDamage_t; 114 115 // RF 116 #define MAX_TAGCONNECTS 32 117 118 // (SA) zoom sway values 119 #define ZOOM_PITCH_AMPLITUDE 0.13f 120 #define ZOOM_PITCH_FREQUENCY 0.24f 121 #define ZOOM_PITCH_MIN_AMPLITUDE 0.1f // minimum amount of sway even if completely settled on target 122 123 #define ZOOM_YAW_AMPLITUDE 0.7f 124 #define ZOOM_YAW_FREQUENCY 0.12f 125 #define ZOOM_YAW_MIN_AMPLITUDE 0.2f 126 127 // DHM - Nerve 128 #define MAX_OBJECTIVES 6 129 // dhm 130 131 // 132 // config strings are a general means of communicating variable length strings 133 // from the server to all connected clients. 134 // 135 136 // CS_SERVERINFO and CS_SYSTEMINFO are defined in q_shared.h 137 #define CS_MUSIC 2 138 #define CS_MESSAGE 3 // from the map worldspawn's message field 139 #define CS_MOTD 4 // g_motd string for server message of the day 140 #define CS_WARMUP 5 // server time when the match will be restarted 141 #define CS_SCORES1 6 142 #define CS_SCORES2 7 143 #define CS_VOTE_TIME 8 144 #define CS_VOTE_STRING 9 145 #define CS_VOTE_YES 10 146 #define CS_VOTE_NO 11 147 #define CS_GAME_VERSION 12 148 #define CS_LEVEL_START_TIME 13 // so the timer only shows the current level 149 #define CS_INTERMISSION 14 // when 1, fraglimit/timelimit has been hit and intermission will start in a second or two 150 // DHM - Nerve :: Wolf Multiplayer information 151 #define CS_MULTI_INFO 15 152 #define CS_MULTI_MAPDESC 16 153 #define CS_MULTI_OBJECTIVE1 17 154 #define CS_MULTI_OBJECTIVE2 18 155 #define CS_MULTI_OBJECTIVE3 19 156 #define CS_MULTI_OBJECTIVE4 20 157 #define CS_MULTI_OBJECTIVE5 21 158 #define CS_MULTI_OBJECTIVE6 22 159 // dhm 160 161 #define CS_MISSIONSTATS 23 //----(SA) added 162 163 #define CS_SHADERSTATE 24 164 #define CS_MUSIC_QUEUE 25 165 #define CS_ITEMS 27 // string of 0's and 1's that tell which items are present 166 167 #define CS_SCREENFADE 28 // Ridah, used to tell clients to fade their screen to black/normal 168 #define CS_FOGVARS 29 //----(SA) (hoping 29-31 are available) used for saving the current state/settings of the fog 169 #define CS_SKYBOXORG 30 // this is where we should view the skybox from 170 #define CS_TARGETEFFECT 31 //----(SA) 171 #define CS_MODELS 32 172 #define CS_SOUNDS ( CS_MODELS + MAX_MODELS ) 173 #define CS_PLAYERS ( CS_SOUNDS + MAX_SOUNDS ) 174 #define CS_LOCATIONS ( CS_PLAYERS + MAX_CLIENTS ) 175 #define CS_PARTICLES ( CS_LOCATIONS + MAX_LOCATIONS ) 176 177 // JPW NERVE -- for spawnpoint selection 178 #define CS_MULTI_SPAWNTARGETS ( CS_PARTICLES + MAX_PARTICLES_AREAS ) 179 // jpw 180 181 //----(SA) 182 #define CS_DLIGHTS ( CS_MULTI_SPAWNTARGETS + MAX_MULTI_SPAWNTARGETS ) 183 #define CS_CLIPBOARDS ( CS_DLIGHTS + MAX_DLIGHT_CONFIGSTRINGS ) 184 #define CS_SPLINES ( CS_CLIPBOARDS + MAX_CLIPBOARD_CONFIGSTRINGS ) 185 //----(SA) 186 187 // RF 188 #define CS_TAGCONNECTS ( CS_SPLINES + MAX_SPLINE_CONFIGSTRINGS ) 189 190 //#define CS_MAX (CS_LOCATIONS+MAX_LOCATIONS) 191 //#define CS_MAX (CS_PARTICLES+MAX_PARTICLES_AREAS) 192 //#define CS_MAX (CS_DLIGHTS+MAX_DLIGHT_CONFIGSTRINGS) //----(SA) 193 #define CS_MAX ( CS_TAGCONNECTS + MAX_TAGCONNECTS ) 194 195 #if ( CS_MAX ) > MAX_CONFIGSTRINGS 196 #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS 197 #endif 198 199 typedef enum { 200 GT_FFA, // free for all 201 GT_TOURNAMENT, // one on one tournament 202 GT_SINGLE_PLAYER, // single player tournament 203 204 //-- team games go after this -- 205 206 GT_TEAM, // team deathmatch 207 GT_CTF, // capture the flag 208 GT_WOLF, // DHM - Nerve :: Wolfenstein Multiplayer 209 210 GT_MAX_GAME_TYPE 211 } gametype_t; 212 213 // Rafael gameskill 214 typedef enum { 215 GSKILL_EASY, 216 GSKILL_MEDIUM, 217 GSKILL_HARD, 218 GSKILL_MAX // must always be last 219 } gameskill_t; 220 221 typedef enum { GENDER_MALE, GENDER_FEMALE, GENDER_NEUTER } gender_t; 222 223 /* 224 =================================================================================== 225 226 PMOVE MODULE 227 228 The pmove code takes a player_state_t and a usercmd_t and generates a new player_state_t 229 and some other output data. Used for local prediction on the client game and true 230 movement on the server game. 231 =================================================================================== 232 */ 233 234 typedef enum { 235 PM_NORMAL, // can accelerate and turn 236 PM_NOCLIP, // noclip movement 237 PM_SPECTATOR, // still run into walls 238 PM_DEAD, // no acceleration or turning, but free falling 239 PM_FREEZE, // stuck in place with no control 240 PM_INTERMISSION // no movement or status bar 241 } pmtype_t; 242 243 typedef enum { 244 WEAPON_READY, 245 WEAPON_RAISING, 246 WEAPON_RAISING_TORELOAD, //----(SA) added 247 WEAPON_DROPPING, 248 WEAPON_DROPPING_TORELOAD, //----(SA) added. will reload upon completion of weapon switch 249 WEAPON_READYING, // getting from 'ready' to 'firing' 250 WEAPON_RELAXING, // weapon is ready, but since not firing, it's on it's way to a "relaxed" stance 251 WEAPON_VENOM_REST, 252 WEAPON_FIRING, 253 WEAPON_FIRINGALT, 254 WEAPON_WAITING, //----(SA) added. player allowed to switch/reload, but not fire 255 WEAPON_RELOADING //----(SA) added 256 } weaponstate_t; 257 258 // pmove->pm_flags (sent as max 16 bits in msg.c) 259 #define PMF_DUCKED 1 260 #define PMF_JUMP_HELD 2 261 #define PMF_LADDER 4 // player is on a ladder 262 #define PMF_BACKWARDS_JUMP 8 // go into backwards land 263 #define PMF_BACKWARDS_RUN 16 // coast down to backwards run 264 #define PMF_TIME_LAND 32 // pm_time is time before rejump 265 #define PMF_TIME_KNOCKBACK 64 // pm_time is an air-accelerate only time 266 #define PMF_TIME_WATERJUMP 256 // pm_time is waterjump 267 #define PMF_RESPAWNED 512 // clear after attack and jump buttons come up 268 #define PMF_USE_ITEM_HELD 1024 269 // RF, removed since it's not used 270 //#define PMF_GRAPPLE_PULL 2048 // pull towards grapple location 271 #define PMF_IGNORE_INPUT 2048 // no movement/firing commands allowed 272 #define PMF_FOLLOW 4096 // spectate following another player 273 #define PMF_SCOREBOARD 8192 // spectate as a scoreboard 274 #define PMF_LIMBO 16384 // JPW NERVE limbo state, pm_time is time until reinforce 275 #define PMF_TIME_LOAD 32768 // hold for this time after a load game, and prevent large thinks 276 277 #define PMF_ALL_TIMES ( PMF_TIME_WATERJUMP | PMF_TIME_LAND | PMF_TIME_KNOCKBACK | PMF_TIME_LOAD ) 278 279 #define MAXTOUCH 32 280 typedef struct { 281 // state (in / out) 282 playerState_t *ps; 283 284 // command (in) 285 usercmd_t cmd, oldcmd; 286 int tracemask; // collide against these types of surfaces 287 int debugLevel; // if set, diagnostic output will be printed 288 qboolean noFootsteps; // if the game is setup for no footsteps by the server 289 qboolean noWeapClips; // if the game is setup for no weapon clips by the server 290 qboolean gauntletHit; // true if a gauntlet attack would actually hit something 291 292 // results (out) 293 int numtouch; 294 int touchents[MAXTOUCH]; 295 296 vec3_t mins, maxs; // bounding box size 297 298 int watertype; 299 int waterlevel; 300 301 float xyspeed; 302 303 // for fixed msec Pmove 304 int pmove_fixed; 305 int pmove_msec; 306 307 // callbacks to test the world 308 // these will be different functions during game and cgame 309 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 ); 310 int ( *pointcontents )( const vec3_t point, int passEntityNum ); 311 } pmove_t; 312 313 // if a full pmove isn't done on the client, you can just update the angles 314 void PM_UpdateViewAngles( playerState_t * ps, usercmd_t * cmd, 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 ) ); 315 int Pmove( pmove_t *pmove ); 316 317 //=================================================================================== 318 319 // JPW NERVE 320 #define PC_SOLDIER 0 // shoot stuff 321 #define PC_MEDIC 1 // heal stuff 322 #define PC_ENGINEER 2 // build stuff 323 #define PC_LT 3 // bomb stuff 324 #define PC_MEDIC_CHARGETIME 30000 // FIXME just for testing, this will change to server cvars for each class 325 // jpw 326 327 // player_state->stats[] indexes 328 typedef enum { 329 STAT_HEALTH, 330 STAT_HOLDABLE_ITEM, 331 // STAT_WEAPONS, // 16 bit fields 332 STAT_ARMOR, 333 //----(SA) Keys for Wolf 334 STAT_KEYS, // 16 bit fields 335 //----(SA) end 336 STAT_DEAD_YAW, // look this direction when dead (FIXME: get rid of?) 337 STAT_CLIENTS_READY, // bit mask of clients wishing to exit the intermission (FIXME: configstring?) 338 STAT_MAX_HEALTH, // health / armor limit, changable by handicap 339 STAT_PLAYER_CLASS // DHM - Nerve :: player class in multiplayer 340 } statIndex_t; 341 342 343 // player_state->persistant[] indexes 344 // these fields are the only part of player_state that isn't 345 // cleared on respawn 346 typedef enum { 347 PERS_SCORE, // !!! MUST NOT CHANGE, SERVER AND GAME BOTH REFERENCE !!! 348 PERS_HITS, // total points damage inflicted so damage beeps can sound on change 349 PERS_RANK, 350 PERS_TEAM, 351 PERS_SPAWN_COUNT, // incremented every respawn 352 PERS_REWARD_COUNT, // incremented for each reward sound 353 PERS_REWARD, // a reward_t 354 PERS_ATTACKER, // clientnum of last damage inflicter 355 PERS_KILLED, // count of the number of times you died 356 // these were added for single player awards tracking 357 PERS_IMPRESSIVE_COUNT, 358 PERS_EXCELLENT_COUNT, 359 PERS_GAUNTLET_FRAG_COUNT, 360 PERS_ACCURACY_SHOTS, 361 PERS_ACCURACY_HITS, 362 363 364 // Rafael - mg42 // (SA) I don't understand these here. can someone explain? 365 PERS_HWEAPON_USE, 366 // Rafael wolfkick 367 PERS_WOLFKICK 368 369 } persEnum_t; 370 371 372 // entityState_t->eFlags 373 #define EF_DEAD 0x00000001 // don't draw a foe marker over players with EF_DEAD 374 #define EF_NONSOLID_BMODEL 0x00000002 // bmodel is visible, but not solid 375 #define EF_FORCE_END_FRAME EF_NONSOLID_BMODEL // force client to end of current animation (after loading a savegame) 376 #define EF_TELEPORT_BIT 0x00000004 // toggled every time the origin abruptly changes 377 #define EF_MONSTER_EFFECT 0x00000008 // draw an aiChar dependant effect for this character 378 #define EF_CAPSULE 0x00000010 // use capsule for collisions 379 #define EF_CROUCHING 0x00000020 // player is crouching 380 #define EF_MG42_ACTIVE 0x00000040 // currently using an MG42 381 #define EF_NODRAW 0x00000080 // may have an event, but no model (unspawned items) 382 #define EF_FIRING 0x00000100 // for lightning gun 383 #define EF_INHERITSHADER EF_FIRING // some ents will never use EF_FIRING, hijack it for "USESHADER" 384 #define EF_BOUNCE_HEAVY 0x00000200 // more realistic bounce. not as rubbery as above (currently for c4) 385 #define EF_SPINNING 0x00000400 // (SA) added for level editor control of spinning pickup items 386 #define EF_BREATH EF_SPINNING // Characters will not have EF_SPINNING set, hijack for drawing character breath 387 388 #define EF_MELEE_ACTIVE 0x00000800 // (SA) added for client knowledge of melee items held (chair/etc.) 389 #define EF_TALK 0x00001000 // draw a talk balloon 390 #define EF_CONNECTION 0x00002000 // draw a connection trouble sprite 391 #define EF_MONSTER_EFFECT2 0x00004000 // show the secondary special effect for this character 392 #define EF_HEADSHOT 0x00008000 // last hit to player was head shot 393 #define EF_MONSTER_EFFECT3 0x00010000 // show the third special effect for this character 394 #define EF_HEADLOOK 0x00020000 // make the head look around 395 #define EF_STAND_IDLE2 0x00040000 // when standing, play idle2 instead of the default 396 #define EF_VIEWING_CAMERA EF_STAND_IDLE2 // NOTE: REMOVE STAND_IDLE2 !! 397 #define EF_TAGCONNECT 0x00080000 // connected to another entity via tag 398 // RF, disabled, not used anymore 399 //#define EF_MOVER_BLOCKED 0x00100000 // mover was blocked dont lerp on the client 400 #define EF_NO_TURN_ANIM 0x00100000 // dont play turning anims in the cgame 401 #define EF_FORCED_ANGLES 0x00200000 // enforce all body parts to use these angles 402 403 #define EF_ZOOMING 0x00400000 // client is zooming 404 #define EF_NOSWINGANGLES 0x00800000 // try and keep all parts facing same direction 405 406 #define EF_DUMMY_PMOVE 0x01000000 407 #define EF_VOTED 0x02000000 // already cast a vote 408 #define EF_BOUNCE 0x04000000 // for missiles 409 #define EF_CIG EF_BOUNCE // players should never use bounce, hijack for cigarette 410 #define EF_BOUNCE_HALF 0x08000000 // for missiles 411 #define EF_MOVER_STOP 0x10000000 // will push otherwise // (SA) moved down to make space for one more client flag 412 #define EF_MOVER_ANIMATE 0x20000000 // interpolate animation 413 #define EF_DEATH_FRAME EF_MOVER_ANIMATE // hijack to stick death at last frame after vid_restart 414 #define EF_RECENTLY_FIRING 0x40000000 // fired recently, lock torso angles, etc 415 416 typedef enum { 417 PW_NONE, 418 419 PW_QUAD, 420 PW_BATTLESUIT, 421 PW_HASTE, 422 PW_INVIS, 423 PW_REGEN, 424 PW_FLIGHT, 425 426 // (SA) for Wolf 427 PW_INVULNERABLE, 428 // PW_FIRE, //----(SA) 429 // PW_ELECTRIC, //----(SA) 430 // PW_BREATHER, //----(SA) 431 PW_NOFATIGUE, //----(SA) 432 433 PW_REDFLAG, 434 PW_BLUEFLAG, 435 PW_BALL, 436 437 PW_NUM_POWERUPS 438 } powerup_t; 439 440 typedef enum { 441 //----(SA) These will probably all change to INV_n to get the word 'key' out of the game. 442 // id and DM don't want references to 'keys' in the game. 443 // I'll change to 'INV' as the item becomes 'permanent' and not a test item. 444 KEY_NONE, 445 // KEY_1, // skull 446 // KEY_2, // chalice 447 // KEY_3, // eye 448 // KEY_4, // field radio 449 // KEY_5, // satchel charge 450 INV_BINOCS, // binoculars 451 // KEY_7, 452 // KEY_8, 453 // KEY_9, 454 // KEY_10, 455 // KEY_11, 456 // KEY_12, 457 // KEY_13, 458 // KEY_14, 459 // KEY_15, 460 // KEY_16, 461 KEY_NUM_KEYS, 462 463 KEY_UNLOCKED_ENT, // ent is unlocked (will be replaced by KEY_NONE after checks for all manners of being locked) 464 KEY_LOCKED_TARGET, // ent is locked by virtue of being the target of another ent 465 KEY_LOCKED_ENT, // ent has key set to -1 in entity 466 KEY_LOCKED_TRIGGERED // locked by a target_lock 467 } wkey_t; // key_t conflicted with <types.h> 468 469 typedef enum { 470 HI_NONE, 471 472 // HI_TELEPORTER, 473 // HI_MEDKIT, 474 475 // new for Wolf 476 HI_WINE, 477 // HI_SKULL, 478 // HI_WATER, 479 // HI_ELECTRIC, 480 // HI_FIRE, 481 HI_STAMINA, 482 HI_BOOK1, //----(SA) added 483 HI_BOOK2, //----(SA) added 484 HI_BOOK3, //----(SA) added 485 HI_11, 486 HI_12, 487 HI_13, 488 HI_14, 489 // HI_15, // ? 490 491 HI_NUM_HOLDABLE 492 } holdable_t; 493 494 // Ridah 495 // 496 // character presets 497 typedef enum 498 { 499 AICHAR_NONE, 500 501 AICHAR_SOLDIER, 502 AICHAR_AMERICAN, 503 AICHAR_ZOMBIE, 504 AICHAR_WARZOMBIE, 505 AICHAR_VENOM, 506 AICHAR_LOPER, 507 AICHAR_ELITEGUARD, 508 AICHAR_STIMSOLDIER1, // dual machineguns 509 AICHAR_STIMSOLDIER2, // rocket in left hand 510 AICHAR_STIMSOLDIER3, // tesla in left hand 511 AICHAR_SUPERSOLDIER, 512 AICHAR_BLACKGUARD, 513 AICHAR_PROTOSOLDIER, 514 515 AICHAR_FROGMAN, 516 AICHAR_HELGA, 517 AICHAR_HEINRICH, //----(SA) added 518 519 AICHAR_PARTISAN, 520 AICHAR_CIVILIAN, 521 522 NUM_CHARACTERS 523 } AICharacters_t; 524 // done. 525 526 527 528 // NOTE: we can only use up to 15 in the client-server stream 529 // SA NOTE: should be 31 now (I added 1 bit in msg.c) 530 typedef enum { 531 WP_NONE, // 0 532 533 WP_KNIFE, // 1 534 // German weapons 535 WP_LUGER, // 2 536 WP_MP40, // 3 537 WP_MAUSER, // 4 538 WP_FG42, // 5 539 WP_GRENADE_LAUNCHER, // 6 540 WP_PANZERFAUST, // 7 541 WP_VENOM, // 8 542 WP_FLAMETHROWER, // 9 543 WP_TESLA, // 10 544 // WP_SPEARGUN, // 11 545 546 // weapon keys only go 1-0, so put the alternates above that (since selection will be a double click on the german weapon key) 547 548 // American equivalents 549 // WP_KNIFE2, // 12 550 WP_COLT, // 11 equivalent american weapon to german luger 551 WP_THOMPSON, // 12 equivalent american weapon to german mp40 552 WP_GARAND, // 13 equivalent american weapon to german mauser 553 // WP_BAR, // 16 equivalent american weapon to german fg42 554 WP_GRENADE_PINEAPPLE, // 14 555 // WP_ROCKET_LAUNCHER, // 18 equivalent american weapon to german panzerfaust 556 557 // secondary fire weapons 558 WP_SNIPERRIFLE, // 15 559 WP_SNOOPERSCOPE, // 16 560 // WP_VENOM_FULL, // 21 561 // WP_SPEARGUN_CO2, // 22 562 WP_FG42SCOPE, // 17 fg42 alt fire 563 // WP_BAR2, // 24 564 565 // more weapons 566 WP_STEN, // 18 silenced sten sub-machinegun 567 WP_SILENCER, // 19 // used to be sp5 568 WP_AKIMBO, // 20 //----(SA) added 569 570 // specialized/one-time weapons 571 // JPW NERVE -- swapped mortar & antitank (unused?) and added class_special 572 WP_CLASS_SPECIAL, // 21 // class-specific multiplayer weapon (airstrike, engineer, or medpack) 573 // (SA) go ahead and take the 'freezeray' spot. it ain't happenin 574 // (I checked for instances of WP_CLASS_SPECIAL and I don't think this'll cause you a problem. however, if it does, move it where you need to. ) (SA) 575 // jpw 576 // WP_CROSS, // 29 577 WP_DYNAMITE, // 22 578 // WP_DYNAMITE2, // 31 579 // WP_PROX, // 32 580 581 WP_MONSTER_ATTACK1, // 23 // generic monster attack, slot 1 582 WP_MONSTER_ATTACK2, // 24 // generic monster attack, slot 2 583 WP_MONSTER_ATTACK3, // 25 // generic monster attack, slot 2 584 585 WP_GAUNTLET, // 26 586 587 WP_SNIPER, // 27 588 WP_GRENADE_SMOKE, // 28 // smoke grenade for LT multiplayer 589 WP_MEDIC_HEAL, // 29 // DHM - Nerve :: Medic special weapon 590 WP_MORTAR, // 30 591 592 VERYBIGEXPLOSION, // 31 // explosion effect for airplanes 593 594 WP_NUM_WEAPONS // 32 NOTE: this cannot be larger than 64 for AI/player weapons! 595 596 } weapon_t; 597 598 599 typedef struct ammotable_s { 600 int maxammo; // 601 int uses; // 602 int maxclip; // 603 int reloadTime; // 604 int fireDelayTime; // 605 int nextShotTime; // 606 //----(SA) added 607 int maxHeat; // max active firing time before weapon 'overheats' (at which point the weapon will fail) 608 int coolRate; // how fast the weapon cools down. (per second) 609 //----(SA) end 610 int mod; // means of death 611 } ammotable_t; 612 613 extern ammotable_t ammoTable[]; // defined in bg_misc.c 614 extern int weapAlts[]; // defined in bg_misc.c 615 616 617 //----(SA) 618 // for routines that need to check if a WP_ is </=/> a given set of weapons 619 #define WP_FIRST WP_KNIFE 620 #define WP_BEGINGERMAN WP_KNIFE 621 #define WP_LASTGERMAN WP_TESLA 622 #define WP_BEGINAMERICAN WP_COLT 623 #define WP_LASTAMERICAN WP_GRENADE_PINEAPPLE 624 #define WP_BEGINSECONDARY WP_SNIPERRIFLE 625 #define WP_LASTSECONDARY WP_FG42SCOPE 626 627 #define WEAPS_ONE_HANDED ( ( 1 << WP_KNIFE ) | ( 1 << WP_LUGER ) | ( 1 << WP_COLT ) | ( 1 << WP_SILENCER ) | ( 1 << WP_GRENADE_LAUNCHER ) | ( 1 << WP_GRENADE_PINEAPPLE ) ) 628 //----(SA) end 629 630 typedef enum { 631 WPOS_HIGH, 632 WPOS_LOW, 633 WPOS_KNIFE, 634 WPOS_PISTOL, 635 WPOS_SHOULDER, 636 WPOS_THROW, 637 WPOS_NUM_POSITIONS 638 } pose_t; 639 640 641 /* 642 // Original Q3A weaps/order 643 typedef enum { 644 WP_NONE, // 0 645 WP_GAUNTLET, // 1 646 WP_MACHINEGUN = 20, // 2 647 WP_SHOTGUN, // 3 648 WP_GRENADE_LAUNCHER, // 4 649 WP_ROCKET_LAUNCHER, // 5 650 WP_LIGHTNING, // 6 651 WP_RAILGUN, // 7 652 WP_PLASMAGUN, // 8 653 WP_BFG, // 9 654 WP_GRAPPLING_HOOK // 10 655 WP_NUM_WEAPONS // 11 656 } weapon_t; 657 658 */ 659 // reward sounds 660 typedef enum { 661 REWARD_BAD, 662 663 REWARD_IMPRESSIVE, 664 REWARD_EXCELLENT, 665 REWARD_DENIED, 666 REWARD_GAUNTLET 667 } reward_t; 668 669 670 // entityState_t->event values 671 // entity events are for effects that take place relative 672 // to an existing entities origin. Very network efficient. 673 674 // two bits at the top of the entityState->event field 675 // will be incremented with each change in the event so 676 // that an identical event started twice in a row can 677 // be distinguished. And off the value with ~EV_EVENT_BITS 678 // to retrieve the actual event number 679 #define EV_EVENT_BIT1 0x00000100 680 #define EV_EVENT_BIT2 0x00000200 681 #define EV_EVENT_BITS ( EV_EVENT_BIT1 | EV_EVENT_BIT2 ) 682 683 typedef enum { 684 EV_NONE, 685 EV_FOOTSTEP, 686 EV_FOOTSTEP_METAL, 687 EV_FOOTSTEP_WOOD, 688 EV_FOOTSTEP_GRASS, 689 EV_FOOTSTEP_GRAVEL, 690 EV_FOOTSTEP_ROOF, 691 EV_FOOTSTEP_SNOW, 692 EV_FOOTSTEP_CARPET, 693 EV_FOOTSPLASH, 694 EV_FOOTWADE, 695 EV_SWIM, 696 EV_STEP_4, 697 EV_STEP_8, 698 EV_STEP_12, 699 EV_STEP_16, 700 EV_FALL_SHORT, 701 EV_FALL_MEDIUM, 702 EV_FALL_FAR, 703 EV_FALL_NDIE, 704 EV_FALL_DMG_10, 705 EV_FALL_DMG_15, 706 EV_FALL_DMG_25, 707 EV_FALL_DMG_50, 708 EV_JUMP_PAD, // boing sound at origin, jump sound on player 709 EV_JUMP, 710 EV_WATER_TOUCH, // foot touches 711 EV_WATER_LEAVE, // foot leaves 712 EV_WATER_UNDER, // head touches 713 EV_WATER_CLEAR, // head leaves 714 EV_ITEM_PICKUP, // normal item pickups are predictable 715 EV_ITEM_PICKUP_QUIET, // (SA) same, but don't play the default pickup sound as it was specified in the ent 716 EV_GLOBAL_ITEM_PICKUP, // powerup / team sounds are broadcast to everyone 717 EV_NOITEM, 718 EV_NOAMMO, 719 EV_EMPTYCLIP, 720 EV_FILL_CLIP, 721 EV_WEAP_OVERHEAT, 722 EV_CHANGE_WEAPON, 723 EV_FIRE_WEAPON, 724 EV_FIRE_WEAPONB, 725 EV_FIRE_WEAPON_LASTSHOT, 726 EV_FIRE_QUICKGREN, // "Quickgrenade" 727 EV_NOFIRE_UNDERWATER, 728 EV_FIRE_WEAPON_MG42, 729 EV_SUGGESTWEAP, //----(SA) added 730 EV_GRENADE_SUICIDE, //----(SA) added 731 EV_USE_ITEM0, 732 EV_USE_ITEM1, 733 EV_USE_ITEM2, 734 EV_USE_ITEM3, 735 EV_USE_ITEM4, 736 EV_USE_ITEM5, 737 EV_USE_ITEM6, 738 EV_USE_ITEM7, 739 EV_USE_ITEM8, 740 EV_USE_ITEM9, 741 EV_USE_ITEM10, 742 EV_USE_ITEM11, 743 EV_USE_ITEM12, 744 EV_USE_ITEM13, 745 EV_USE_ITEM14, 746 EV_USE_ITEM15, 747 EV_ITEM_RESPAWN, 748 EV_ITEM_POP, 749 EV_PLAYER_TELEPORT_IN, 750 EV_PLAYER_TELEPORT_OUT, 751 EV_GRENADE_BOUNCE, // eventParm will be the soundindex 752 EV_GENERAL_SOUND, 753 EV_GLOBAL_SOUND, // no attenuation 754 EV_BULLET_HIT_FLESH, 755 EV_BULLET_HIT_WALL, 756 EV_MISSILE_HIT, 757 EV_MISSILE_MISS, 758 EV_RAILTRAIL, 759 EV_VENOM, 760 EV_VENOMFULL, 761 EV_BULLET, // otherEntity is the shooter 762 EV_LOSE_HAT, //----(SA) 763 EV_GIB_HEAD, // only blow off the head 764 EV_PAIN, 765 EV_CROUCH_PAIN, 766 EV_DEATH1, 767 EV_DEATH2, 768 EV_DEATH3, 769 EV_ENTDEATH, //----(SA) added 770 EV_OBITUARY, 771 EV_POWERUP_QUAD, 772 EV_POWERUP_BATTLESUIT, 773 EV_POWERUP_REGEN, 774 EV_GIB_PLAYER, // gib a previously living player 775 EV_DEBUG_LINE, 776 EV_STOPLOOPINGSOUND, 777 EV_STOPSTREAMINGSOUND, 778 EV_TAUNT, 779 EV_SMOKE, 780 EV_SPARKS, 781 EV_SPARKS_ELECTRIC, 782 EV_BATS, 783 EV_BATS_UPDATEPOSITION, 784 EV_BATS_DEATH, 785 EV_EXPLODE, // func_explosive 786 EV_EFFECT, // target_effect 787 EV_MORTAREFX, // mortar firing 788 EV_SPINUP, // JPW NERVE panzerfaust preamble 789 EV_SNOW_ON, 790 EV_SNOW_OFF, 791 EV_MISSILE_MISS_SMALL, 792 EV_MISSILE_MISS_LARGE, 793 EV_WOLFKICK_HIT_FLESH, 794 EV_WOLFKICK_HIT_WALL, 795 EV_WOLFKICK_MISS, 796 EV_SPIT_HIT, 797 EV_SPIT_MISS, 798 EV_SHARD, 799 EV_JUNK, 800 EV_EMITTER, //----(SA) added // generic particle emitter that uses client-side particle scripts 801 EV_OILPARTICLES, 802 EV_OILSLICK, 803 EV_OILSLICKREMOVE, 804 EV_MG42EFX, 805 EV_FLAMEBARREL_BOUNCE, 806 EV_FLAKGUN1, 807 EV_FLAKGUN2, 808 EV_FLAKGUN3, 809 EV_FLAKGUN4, 810 EV_EXERT1, 811 EV_EXERT2, 812 EV_EXERT3, 813 EV_SNOWFLURRY, 814 EV_CONCUSSIVE, 815 EV_DUST, 816 EV_RUMBLE_EFX, 817 EV_GUNSPARKS, 818 EV_FLAMETHROWER_EFFECT, 819 EV_SNIPER_SOUND, 820 EV_POPUP, 821 EV_POPUPBOOK, 822 EV_GIVEPAGE, //----(SA) added 823 EV_CLOSEMENU, //----(SA) added 824 EV_SPAWN_SPIRIT, 825 826 EV_MAX_EVENTS // just added as an 'endcap' 827 828 } entity_event_t; 829 830 831 // animations 832 /* // straight Q3A for reference (SA) 833 typedef enum { 834 BOTH_DEATH1, 835 BOTH_DEAD1, 836 BOTH_DEATH2, 837 BOTH_DEAD2, 838 BOTH_DEATH3, 839 BOTH_DEAD3, 840 841 TORSO_GESTURE, 842 843 TORSO_ATTACK, 844 TORSO_ATTACK2, 845 846 TORSO_DROP, 847 TORSO_RAISE, 848 849 TORSO_STAND, 850 TORSO_STAND2, 851 852 LEGS_WALKCR, 853 LEGS_WALK, 854 LEGS_RUN, 855 LEGS_BACK, 856 LEGS_SWIM, 857 858 LEGS_JUMP, 859 LEGS_LAND, 860 861 LEGS_JUMPB, 862 LEGS_LANDB, 863 864 LEGS_IDLE, 865 LEGS_IDLECR, 866 867 LEGS_TURN, 868 869 MAX_ANIMATIONS 870 } animNumber_t; 871 */ 872 873 // NOTE: this must be synched with the text list below 874 875 // new (10/18/00) 876 typedef enum { 877 BOTH_DEATH1, 878 BOTH_DEAD1, 879 BOTH_DEAD1_WATER, 880 BOTH_DEATH2, 881 BOTH_DEAD2, 882 BOTH_DEAD2_WATER, 883 BOTH_DEATH3, 884 BOTH_DEAD3, 885 BOTH_DEAD3_WATER, 886 887 BOTH_CLIMB, 888 /*10*/ BOTH_CLIMB_DOWN, 889 BOTH_CLIMB_DISMOUNT, 890 891 BOTH_SALUTE, 892 893 BOTH_PAIN1, // head 894 BOTH_PAIN2, // chest 895 BOTH_PAIN3, // groin 896 BOTH_PAIN4, // right shoulder 897 BOTH_PAIN5, // left shoulder 898 BOTH_PAIN6, // right knee 899 BOTH_PAIN7, // left knee 900 /*20*/ BOTH_PAIN8, // dazed 901 902 BOTH_GRAB_GRENADE, 903 904 BOTH_ATTACK1, 905 BOTH_ATTACK2, 906 BOTH_ATTACK3, 907 BOTH_ATTACK4, 908 BOTH_ATTACK5, 909 910 BOTH_EXTRA1, 911 BOTH_EXTRA2, 912 BOTH_EXTRA3, 913 /*30*/ BOTH_EXTRA4, 914 BOTH_EXTRA5, 915 BOTH_EXTRA6, 916 BOTH_EXTRA7, 917 BOTH_EXTRA8, 918 BOTH_EXTRA9, 919 BOTH_EXTRA10, 920 BOTH_EXTRA11, 921 BOTH_EXTRA12, 922 BOTH_EXTRA13, 923 /*40*/ BOTH_EXTRA14, 924 BOTH_EXTRA15, 925 BOTH_EXTRA16, 926 BOTH_EXTRA17, 927 BOTH_EXTRA18, 928 BOTH_EXTRA19, 929 BOTH_EXTRA20, 930 931 TORSO_GESTURE, 932 TORSO_GESTURE2, 933 TORSO_GESTURE3, 934 /*50*/ TORSO_GESTURE4, 935 936 TORSO_DROP, 937 938 TORSO_RAISE, // (low) 939 TORSO_ATTACK, 940 TORSO_STAND, 941 TORSO_STAND_ALT1, 942 TORSO_STAND_ALT2, 943 TORSO_READY, 944 TORSO_RELAX, 945 946 TORSO_RAISE2, // (high) 947 /*60*/ TORSO_ATTACK2, 948 TORSO_STAND2, 949 TORSO_STAND2_ALT1, 950 TORSO_STAND2_ALT2, 951 TORSO_READY2, 952 TORSO_RELAX2, 953 954 TORSO_RAISE3, // (pistol) 955 TORSO_ATTACK3, 956 TORSO_STAND3, 957 TORSO_STAND3_ALT1, 958 /*70*/ TORSO_STAND3_ALT2, 959 TORSO_READY3, 960 TORSO_RELAX3, 961 962 TORSO_RAISE4, // (shoulder) 963 TORSO_ATTACK4, 964 TORSO_STAND4, 965 TORSO_STAND4_ALT1, 966 TORSO_STAND4_ALT2, 967 TORSO_READY4, 968 TORSO_RELAX4, 969 970 /*80*/ TORSO_RAISE5, // (throw) 971 TORSO_ATTACK5, 972 TORSO_ATTACK5B, 973 TORSO_STAND5, 974 TORSO_STAND5_ALT1, 975 TORSO_STAND5_ALT2, 976 TORSO_READY5, 977 TORSO_RELAX5, 978 979 TORSO_RELOAD1, // (low) 980 TORSO_RELOAD2, // (high) 981 /*90*/ TORSO_RELOAD3, // (pistol) 982 TORSO_RELOAD4, // (shoulder) 983 984 TORSO_MG42, // firing tripod mounted weapon animation 985 986 TORSO_MOVE, // torso anim to play while moving and not firing (swinging arms type thing) 987 TORSO_MOVE_ALT, 988 989 TORSO_EXTRA, 990 TORSO_EXTRA2, 991 TORSO_EXTRA3, 992 TORSO_EXTRA4, 993 TORSO_EXTRA5, 994 /*100*/ TORSO_EXTRA6, 995 TORSO_EXTRA7, 996 TORSO_EXTRA8, 997 TORSO_EXTRA9, 998 TORSO_EXTRA10, 999 1000 LEGS_WALKCR, 1001 LEGS_WALKCR_BACK, 1002 LEGS_WALK, 1003 LEGS_RUN, 1004 LEGS_BACK, 1005 /*110*/ LEGS_SWIM, 1006 LEGS_SWIM_IDLE, 1007 1008 LEGS_JUMP, 1009 LEGS_JUMPB, 1010 LEGS_LAND, 1011 1012 LEGS_IDLE, 1013 LEGS_IDLE_ALT, // LEGS_IDLE2 1014 LEGS_IDLECR, 1015 1016 LEGS_TURN, 1017 1018 LEGS_BOOT, // kicking animation 1019 1020 /*120*/ LEGS_EXTRA1, 1021 LEGS_EXTRA2, 1022 LEGS_EXTRA3, 1023 LEGS_EXTRA4, 1024 LEGS_EXTRA5, 1025 LEGS_EXTRA6, 1026 LEGS_EXTRA7, 1027 LEGS_EXTRA8, 1028 LEGS_EXTRA9, 1029 LEGS_EXTRA10, 1030 1031 /*130*/ MAX_ANIMATIONS 1032 } animNumber_t; 1033 1034 // text represenation for scripting 1035 extern char *animStrings[]; // defined in bg_misc.c 1036 extern char *animStringsOld[]; // defined in bg_misc.c 1037 1038 1039 typedef enum { 1040 WEAP_IDLE1, 1041 WEAP_IDLE2, 1042 WEAP_ATTACK1, 1043 WEAP_ATTACK2, 1044 WEAP_ATTACK_LASTSHOT, // used when firing the last round before having an empty clip. 1045 WEAP_DROP, 1046 WEAP_RAISE, 1047 WEAP_RELOAD1, 1048 WEAP_RELOAD2, 1049 WEAP_RELOAD3, 1050 WEAP_ALTSWITCHFROM, // switch from alt fire mode weap (scoped/silencer/etc) 1051 WEAP_ALTSWITCHTO, // switch to alt fire mode weap 1052 MAX_WP_ANIMATIONS 1053 } weapAnimNumber_t; 1054 1055 1056 #define ANIMFL_LADDERANIM 0x1 1057 #define ANIMFL_FIRINGANIM 0x2 1058 1059 typedef struct animation_s { 1060 char name[MAX_QPATH]; 1061 int firstFrame; 1062 int numFrames; 1063 int loopFrames; // 0 to numFrames 1064 int frameLerp; // msec between frames 1065 int initialLerp; // msec to get to first frame 1066 int moveSpeed; 1067 int animBlend; // take this long to blend to next anim 1068 int priority; 1069 // 1070 // derived 1071 // 1072 int duration; 1073 int nameHash; 1074 int flags; 1075 int movetype; 1076 float stepGap; 1077 } animation_t; 1078 1079 // Ridah, head animations 1080 typedef enum { 1081 HEAD_NEUTRAL_CLOSED, 1082 HEAD_NEUTRAL_A, 1083 HEAD_NEUTRAL_O, 1084 HEAD_NEUTRAL_I, 1085 HEAD_NEUTRAL_E, 1086 HEAD_HAPPY_CLOSED, 1087 HEAD_HAPPY_O, 1088 HEAD_HAPPY_I, 1089 HEAD_HAPPY_E, 1090 HEAD_HAPPY_A, 1091 HEAD_ANGRY_CLOSED, 1092 HEAD_ANGRY_O, 1093 HEAD_ANGRY_I, 1094 HEAD_ANGRY_E, 1095 HEAD_ANGRY_A, 1096 1097 MAX_HEAD_ANIMS 1098 } animHeadNumber_t; 1099 1100 typedef struct headAnimation_s { 1101 int firstFrame; 1102 int numFrames; 1103 } headAnimation_t; 1104 // done. 1105 1106 // flip the togglebit every time an animation 1107 // changes so a restart of the same anim can be detected 1108 #define ANIM_TOGGLEBIT ( 1 << ( ANIM_BITS - 1 ) ) 1109 1110 1111 typedef enum { 1112 TEAM_FREE, 1113 TEAM_RED, 1114 TEAM_BLUE, 1115 TEAM_SPECTATOR, 1116 1117 TEAM_NUM_TEAMS 1118 } team_t; 1119 1120 // Time between location updates 1121 #define TEAM_LOCATION_UPDATE_TIME 1000 1122 1123 // How many players on the overlay 1124 #define TEAM_MAXOVERLAY 8 1125 1126 // means of death 1127 typedef enum { 1128 MOD_UNKNOWN, 1129 MOD_SHOTGUN, 1130 MOD_GAUNTLET, 1131 MOD_MACHINEGUN, 1132 MOD_GRENADE, 1133 MOD_GRENADE_SPLASH, 1134 MOD_ROCKET, 1135 MOD_ROCKET_SPLASH, 1136 MOD_RAILGUN, 1137 MOD_LIGHTNING, 1138 MOD_BFG, 1139 MOD_BFG_SPLASH, 1140 MOD_KNIFE, 1141 MOD_KNIFE2, 1142 MOD_KNIFE_STEALTH, 1143 MOD_LUGER, 1144 MOD_COLT, 1145 MOD_MP40, 1146 MOD_THOMPSON, 1147 MOD_STEN, 1148 MOD_MAUSER, 1149 MOD_SNIPERRIFLE, 1150 MOD_GARAND, 1151 MOD_SNOOPERSCOPE, 1152 MOD_SILENCER, //----(SA) 1153 MOD_AKIMBO, //----(SA) 1154 MOD_BAR, //----(SA) 1155 MOD_FG42, 1156 MOD_FG42SCOPE, 1157 MOD_PANZERFAUST, 1158 MOD_ROCKET_LAUNCHER, 1159 MOD_GRENADE_LAUNCHER, 1160 MOD_VENOM, 1161 MOD_VENOM_FULL, 1162 MOD_FLAMETHROWER, 1163 MOD_TESLA, 1164 MOD_SPEARGUN, 1165 MOD_SPEARGUN_CO2, 1166 MOD_GRENADE_PINEAPPLE, 1167 MOD_CROSS, 1168 MOD_MORTAR, 1169 MOD_MORTAR_SPLASH, 1170 MOD_KICKED, 1171 MOD_GRABBER, 1172 MOD_DYNAMITE, 1173 MOD_DYNAMITE_SPLASH, 1174 MOD_AIRSTRIKE, // JPW NERVE 1175 MOD_WATER, 1176 MOD_SLIME, 1177 MOD_LAVA, 1178 MOD_CRUSH, 1179 MOD_TELEFRAG, 1180 MOD_FALLING, 1181 MOD_SUICIDE, 1182 MOD_TARGET_LASER, 1183 MOD_TRIGGER_HURT, 1184 MOD_GRAPPLE, 1185 MOD_EXPLOSIVE, 1186 MOD_POISONGAS, 1187 MOD_ZOMBIESPIT, 1188 MOD_ZOMBIESPIT_SPLASH, 1189 MOD_ZOMBIESPIRIT, 1190 MOD_ZOMBIESPIRIT_SPLASH, 1191 MOD_LOPER_LEAP, 1192 MOD_LOPER_GROUND, 1193 MOD_LOPER_HIT, 1194 1195 // JPW NERVE multiplayer class-specific MODs 1196 MOD_LT_ARTILLERY, 1197 MOD_LT_AIRSTRIKE, 1198 MOD_ENGINEER, // not sure if we'll use 1199 MOD_MEDIC, // these like this or not 1200 // 1201 MOD_BAT 1202 1203 } meansOfDeath_t; 1204 1205 1206 //--------------------------------------------------------- 1207 1208 // gitem_t->type 1209 typedef enum { 1210 IT_BAD, 1211 IT_WEAPON, // EFX: rotate + upscale + minlight 1212 1213 IT_AMMO, // EFX: rotate 1214 IT_ARMOR, // EFX: rotate + minlight 1215 IT_HEALTH, // EFX: static external sphere + rotating internal 1216 IT_POWERUP, // instant on, timer based 1217 // EFX: rotate + external ring that rotates 1218 IT_HOLDABLE, // single use, holdable item 1219 // EFX: rotate + bob 1220 IT_KEY, 1221 IT_TREASURE, // gold bars, etc. things that can be picked up and counted for a tally at end-level 1222 IT_CLIPBOARD, // 'clipboard' used as a general term for 'popup' items where you pick up the item and it pauses and opens a menu 1223 IT_TEAM 1224 } itemType_t; 1225 1226 #define MAX_ITEM_MODELS 5 1227 #define MAX_ITEM_ICONS 4 1228 1229 // JOSEPH 4-17-00 1230 typedef struct gitem_s { 1231 char *classname; // spawning name 1232 char *pickup_sound; 1233 char *world_model[MAX_ITEM_MODELS]; 1234 1235 char *icon; 1236 char *ammoicon; 1237 char *pickup_name; // for printing on pickup 1238 1239 int quantity; // for ammo how much, or duration of powerup (value not necessary for ammo/health. that value set in gameskillnumber[] below) 1240 itemType_t giType; // IT_* flags 1241 1242 int giTag; 1243 1244 int giAmmoIndex; // type of weapon ammo this uses. (ex. WP_MP40 and WP_LUGER share 9mm ammo, so they both have WP_LUGER for giAmmoIndex) 1245 int giClipIndex; // which clip this weapon uses. this allows the sniper rifle to use the same clip as the garand, etc. 1246 1247 char *precaches; // string of all models and images this item will use 1248 char *sounds; // string of all sounds this item will use 1249 1250 int gameskillnumber[4]; 1251 } gitem_t; 1252 // END JOSEPH 1253 1254 // included in both the game dll and the client 1255 extern gitem_t bg_itemlist[]; 1256 extern int bg_numItems; 1257 1258 gitem_t *BG_FindItem( const char *pickupName ); 1259 gitem_t *BG_FindItem2( const char *name ); //----(SA) added 1260 gitem_t *BG_FindItemForWeapon( weapon_t weapon ); 1261 gitem_t *BG_FindItemForPowerup( powerup_t pw ); 1262 gitem_t *BG_FindItemForHoldable( holdable_t pw ); 1263 gitem_t *BG_FindItemForAmmo( int ammo ); //----(SA) modified 1264 gitem_t *BG_FindItemForKey( wkey_t k, int *index ); 1265 weapon_t BG_FindAmmoForWeapon( weapon_t weapon ); 1266 weapon_t BG_FindClipForWeapon( weapon_t weapon ); 1267 1268 qboolean BG_AkimboFireSequence( int weapon, int akimboClip, int coltClip ); 1269 //qboolean BG_AkimboFireSequence ( playerState_t *ps ); //----(SA) added 1270 1271 #define ITEM_INDEX( x ) ( ( x ) - bg_itemlist ) 1272 1273 qboolean BG_CanItemBeGrabbed( const entityState_t *ent, const playerState_t *ps ); 1274 1275 1276 // g_dmflags->integer flags 1277 #define DF_NO_FALLING 8 1278 #define DF_FIXED_FOV 16 1279 #define DF_NO_FOOTSTEPS 32 1280 #define DF_NO_WEAPRELOAD 64 1281 1282 // content masks 1283 #define MASK_ALL ( -1 ) 1284 #define MASK_SOLID ( CONTENTS_SOLID ) 1285 #define MASK_PLAYERSOLID ( CONTENTS_SOLID | CONTENTS_PLAYERCLIP | CONTENTS_BODY ) 1286 #define MASK_DEADSOLID ( CONTENTS_SOLID | CONTENTS_PLAYERCLIP ) 1287 #define MASK_WATER ( CONTENTS_WATER | CONTENTS_LAVA | CONTENTS_SLIME ) 1288 //#define MASK_OPAQUE (CONTENTS_SOLID|CONTENTS_SLIME|CONTENTS_LAVA) 1289 #define MASK_OPAQUE ( CONTENTS_SOLID | CONTENTS_LAVA ) //----(SA) modified since slime is no longer deadly 1290 #define MASK_SHOT ( CONTENTS_SOLID | CONTENTS_BODY | CONTENTS_CORPSE | CONTENTS_CLIPSHOT ) 1291 #define MASK_MISSILESHOT ( MASK_SHOT | CONTENTS_MISSILECLIP ) 1292 #define MASK_AISIGHT ( CONTENTS_SOLID | CONTENTS_AI_NOSIGHT ) 1293 1294 // 1295 // entityState_t->eType 1296 // 1297 typedef enum { 1298 ET_GENERAL, 1299 ET_PLAYER, 1300 ET_ITEM, 1301 ET_MISSILE, 1302 ET_MOVER, 1303 ET_BEAM, 1304 ET_PORTAL, 1305 ET_SPEAKER, 1306 ET_PUSH_TRIGGER, 1307 ET_TELEPORT_TRIGGER, 1308 ET_INVISIBLE, 1309 ET_GRAPPLE, // grapple hooked on wall 1310 1311 //---- (SA) Wolf 1312 ET_EXPLOSIVE, // brush that will break into smaller bits when damaged 1313 ET_TESLA_EF, 1314 ET_SPOTLIGHT_EF, 1315 ET_EFFECT3, 1316 ET_ALARMBOX, 1317 ET_CORONA, 1318 ET_TRAP, 1319 1320 ET_GAMEMODEL, // misc_gamemodel. similar to misc_model, but it's a dynamic model so we have LOD 1321 ET_FOOTLOCKER, //----(SA) added 1322 ET_LEAKY, //----(SA) added 1323 ET_MG42, //----(SA) why didn't we do /this/ earlier... 1324 //---- end 1325 1326 ET_ZOMBIESPIT, 1327 ET_FLAMEBARREL, 1328 ET_ZOMBIESPIRIT, 1329 1330 ET_FP_PARTS, 1331 1332 // FIRE PROPS 1333 ET_FIRE_COLUMN, 1334 ET_FIRE_COLUMN_SMOKE, 1335 ET_RAMJET, 1336 1337 ET_EXPLO_PART, 1338 1339 ET_CROWBAR, 1340 1341 ET_PROP, 1342 ET_BAT, 1343 1344 ET_AI_EFFECT, 1345 1346 ET_CAMERA, 1347 ET_MOVERSCALED, 1348 1349 ET_RUMBLE, 1350 1351 ET_SPIRIT_SPAWNER, 1352 1353 ET_FLAMETHROWER_PROP, 1354 1355 ET_EVENTS // any of the EV_* events can be added freestanding 1356 // by setting eType to ET_EVENTS + eventNum 1357 // this avoids having to set eFlags and eventNum 1358 } entityType_t; 1359 1360 1361 // cursorhints (stored in ent->s.dmgFlags since that's only used for players at the moment) 1362 typedef enum { 1363 HINT_NONE, // reserved 1364 HINT_FORCENONE, // reserved 1365 HINT_PLAYER, 1366 HINT_ACTIVATE, 1367 HINT_NOACTIVATE, 1368 HINT_DOOR, 1369 HINT_DOOR_ROTATING, 1370 HINT_DOOR_LOCKED, 1371 HINT_DOOR_ROTATING_LOCKED, 1372 HINT_MG42, 1373 HINT_BREAKABLE, // 10 1374 HINT_BREAKABLE_DYNAMITE, 1375 HINT_CHAIR, 1376 HINT_ALARM, 1377 HINT_HEALTH, 1378 HINT_TREASURE, 1379 HINT_KNIFE, 1380 HINT_LADDER, 1381 HINT_BUTTON, 1382 HINT_WATER, 1383 HINT_CAUTION, // 20 1384 HINT_DANGER, 1385 HINT_SECRET, 1386 HINT_QUESTION, 1387 HINT_EXCLAMATION, 1388 HINT_CLIPBOARD, 1389 HINT_WEAPON, 1390 HINT_AMMO, 1391 HINT_ARMOR, 1392 HINT_POWERUP, 1393 HINT_HOLDABLE, // 30 1394 HINT_INVENTORY, 1395 HINT_SCENARIC, 1396 HINT_EXIT, 1397 HINT_NOEXIT, 1398 HINT_EXIT_FAR, 1399 HINT_NOEXIT_FAR, 1400 HINT_PLYR_FRIEND, 1401 HINT_PLYR_NEUTRAL, 1402 HINT_PLYR_ENEMY, 1403 HINT_PLYR_UNKNOWN, // 40 1404 HINT_BUILD, 1405 1406 HINT_BAD_USER, // invisible user with no target 1407 1408 HINT_NUM_HINTS 1409 } hintType_t; 1410 1411 1412 1413 void BG_EvaluateTrajectory( const trajectory_t *tr, int atTime, vec3_t result ); 1414 void BG_EvaluateTrajectoryDelta( const trajectory_t *tr, int atTime, vec3_t result ); 1415 void BG_GetMarkDir( const vec3_t dir, const vec3_t normal, vec3_t out ); 1416 1417 void BG_AddPredictableEventToPlayerstate( int newEvent, int eventParm, playerState_t *ps ); 1418 1419 //void BG_TouchJumpPad( playerState_t *ps, entityState_t *jumppad ); 1420 1421 void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean snap ); 1422 void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s, int time, qboolean snap ); 1423 1424 qboolean BG_PlayerTouchesItem( playerState_t *ps, entityState_t *item, int atTime ); 1425 qboolean BG_PlayerSeesItem( playerState_t *ps, entityState_t *item, int atTime ); 1426 1427 //----(SA) removed PM_ammoNeeded 11/27/00 1428 void PM_ClipVelocity( vec3_t in, vec3_t normal, vec3_t out, float overbounce ); 1429 1430 #define ARENAS_PER_TIER 4 1431 #define MAX_ARENAS 64 1432 #define MAX_ARENAS_TEXT 8192 1433 1434 #define MAX_BOTS 64 1435 #define MAX_BOTS_TEXT 8192 1436 1437 typedef enum { 1438 FOOTSTEP_NORMAL, 1439 FOOTSTEP_BOOT, 1440 FOOTSTEP_FLESH, 1441 FOOTSTEP_MECH, 1442 FOOTSTEP_ENERGY, 1443 FOOTSTEP_METAL, 1444 FOOTSTEP_WOOD, 1445 FOOTSTEP_GRASS, 1446 FOOTSTEP_GRAVEL, 1447 // END JOSEPH 1448 FOOTSTEP_SPLASH, 1449 1450 FOOTSTEP_ROOF, 1451 FOOTSTEP_SNOW, 1452 FOOTSTEP_CARPET, //----(SA) added 1453 1454 FOOTSTEP_ELITE_STEP, 1455 FOOTSTEP_ELITE_METAL, 1456 FOOTSTEP_ELITE_ROOF, 1457 FOOTSTEP_ELITE_WOOD, 1458 FOOTSTEP_ELITE_GRAVEL, 1459 1460 FOOTSTEP_SUPERSOLDIER_METAL, 1461 FOOTSTEP_SUPERSOLDIER_GRASS, 1462 FOOTSTEP_SUPERSOLDIER_GRAVEL, 1463 FOOTSTEP_SUPERSOLDIER_STEP, 1464 FOOTSTEP_SUPERSOLDIER_WOOD, 1465 1466 FOOTSTEP_PROTOSOLDIER_METAL, 1467 FOOTSTEP_PROTOSOLDIER_GRASS, 1468 FOOTSTEP_PROTOSOLDIER_GRAVEL, 1469 FOOTSTEP_PROTOSOLDIER_STEP, 1470 FOOTSTEP_PROTOSOLDIER_WOOD, 1471 1472 FOOTSTEP_LOPER_METAL, 1473 FOOTSTEP_LOPER_STEP, 1474 FOOTSTEP_LOPER_WOOD, 1475 1476 FOOTSTEP_ZOMBIE_GRAVEL, 1477 FOOTSTEP_ZOMBIE_STEP, 1478 FOOTSTEP_ZOMBIE_WOOD, 1479 1480 FOOTSTEP_BEAST, 1481 1482 FOOTSTEP_HEINRICH, 1483 1484 FOOTSTEP_TOTAL 1485 } footstep_t; 1486 1487 1488 //----(SA) added 1489 typedef enum { 1490 GRENBOUNCE_DIRT, 1491 GRENBOUNCE_WOOD, 1492 GRENBOUNCE_METAL, 1493 GRENBOUNCE_DEFAULT, 1494 GRENBOUNCE_TOTAL 1495 } grenbounde_t; 1496 //----(SA) added 1497 1498 //================================================================== 1499 // New Animation Scripting Defines 1500 1501 #define MAX_ANIMSCRIPT_MODELS 32 // allocated dynamically, so limit is scalable 1502 #define MAX_ANIMSCRIPT_ITEMS_PER_MODEL 256 1503 #define MAX_MODEL_ANIMATIONS 256 // animations per model 1504 #define MAX_ANIMSCRIPT_ANIMCOMMANDS 8 1505 #define MAX_ANIMSCRIPT_ITEMS 32 1506 1507 // NOTE: these must all be in sync with string tables in bg_animation.c 1508 1509 typedef enum 1510 { 1511 ANIM_MT_UNUSED, 1512 ANIM_MT_IDLE, 1513 ANIM_MT_IDLECR, 1514 ANIM_MT_WALK, 1515 ANIM_MT_WALKBK, 1516 ANIM_MT_WALKCR, 1517 ANIM_MT_WALKCRBK, 1518 ANIM_MT_RUN, 1519 ANIM_MT_RUNBK, 1520 ANIM_MT_SWIM, 1521 ANIM_MT_SWIMBK, 1522 ANIM_MT_STRAFERIGHT, 1523 ANIM_MT_STRAFELEFT, 1524 ANIM_MT_TURNRIGHT, 1525 ANIM_MT_TURNLEFT, 1526 ANIM_MT_CLIMBUP, 1527 ANIM_MT_CLIMBDOWN, 1528 1529 NUM_ANIM_MOVETYPES 1530 } scriptAnimMoveTypes_t; 1531 1532 typedef enum 1533 { 1534 ANIM_ET_PAIN, 1535 ANIM_ET_DEATH, 1536 ANIM_ET_FIREWEAPON, 1537 ANIM_ET_JUMP, 1538 ANIM_ET_JUMPBK, 1539 ANIM_ET_LAND, 1540 ANIM_ET_DROPWEAPON, 1541 ANIM_ET_RAISEWEAPON, 1542 ANIM_ET_CLIMB_MOUNT, 1543 ANIM_ET_CLIMB_DISMOUNT, 1544 ANIM_ET_RELOAD, 1545 ANIM_ET_PICKUPGRENADE, 1546 ANIM_ET_KICKGRENADE, 1547 ANIM_ET_QUERY, 1548 ANIM_ET_INFORM_FRIENDLY_OF_ENEMY, 1549 ANIM_ET_KICK, 1550 ANIM_ET_REVIVE, 1551 ANIM_ET_FIRSTSIGHT, 1552 ANIM_ET_ROLL, 1553 ANIM_ET_FLIP, 1554 ANIM_ET_DIVE, 1555 ANIM_ET_PRONE_TO_CROUCH, 1556 ANIM_ET_BULLETIMPACT, 1557 ANIM_ET_INSPECTSOUND, 1558 ANIM_ET_SECONDLIFE, 1559 1560 NUM_ANIM_EVENTTYPES 1561 } scriptAnimEventTypes_t; 1562 1563 typedef enum 1564 { 1565 ANIM_BP_UNUSED, 1566 ANIM_BP_LEGS, 1567 ANIM_BP_TORSO, 1568 ANIM_BP_BOTH, 1569 1570 NUM_ANIM_BODYPARTS 1571 } animBodyPart_t; 1572 1573 typedef enum 1574 { 1575 ANIM_COND_WEAPON, 1576 ANIM_COND_ENEMY_POSITION, 1577 ANIM_COND_ENEMY_WEAPON, 1578 ANIM_COND_UNDERWATER, 1579 ANIM_COND_MOUNTED, 1580 ANIM_COND_MOVETYPE, 1581 ANIM_COND_UNDERHAND, 1582 ANIM_COND_LEANING, 1583 ANIM_COND_IMPACT_POINT, 1584 ANIM_COND_CROUCHING, 1585 ANIM_COND_STUNNED, 1586 ANIM_COND_FIRING, 1587 ANIM_COND_SHORT_REACTION, 1588 ANIM_COND_ENEMY_TEAM, 1589 ANIM_COND_PARACHUTE, 1590 ANIM_COND_CHARGING, 1591 ANIM_COND_SECONDLIFE, 1592 ANIM_COND_HEALTH_LEVEL, 1593 ANIM_COND_DEFENSE, 1594 ANIM_COND_SPECIAL_CONDITION, 1595 1596 NUM_ANIM_CONDITIONS 1597 } scriptAnimConditions_t; 1598 1599 //------------------------------------------------------------------- 1600 1601 typedef struct 1602 { 1603 char *string; 1604 int hash; 1605 } animStringItem_t; 1606 1607 typedef struct 1608 { 1609 int index; // reference into the table of possible conditionals 1610 int value[2]; // can store anything from weapon bits, to position enums, etc 1611 } animScriptCondition_t; 1612 1613 typedef struct 1614 { 1615 short int bodyPart[2]; // play this animation on legs/torso/both 1616 short int animIndex[2]; // animation index in our list of animations 1617 short int animDuration[2]; 1618 short int soundIndex; 1619 short int accShowBits; //----(SA) added 1620 short int accHideBits; //----(SA) added 1621 } animScriptCommand_t; 1622 1623 typedef struct 1624 { 1625 int numConditions; 1626 animScriptCondition_t conditions[NUM_ANIM_CONDITIONS]; 1627 int numCommands; 1628 animScriptCommand_t commands[MAX_ANIMSCRIPT_ANIMCOMMANDS]; 1629 } animScriptItem_t; 1630 1631 typedef struct 1632 { 1633 int numItems; 1634 animScriptItem_t *items[MAX_ANIMSCRIPT_ITEMS]; // pointers into a global list of items 1635 } animScript_t; 1636 1637 typedef struct 1638 { 1639 char modelname[MAX_QPATH]; // name of the model 1640 1641 // parsed from the start of the cfg file 1642 gender_t gender; 1643 footstep_t footsteps; 1644 vec3_t headOffset; 1645 int version; 1646 qboolean isSkeletal; 1647 1648 // parsed from cfg file 1649 animation_t animations[MAX_MODEL_ANIMATIONS]; // anim names, frame ranges, etc 1650 headAnimation_t headAnims[MAX_HEAD_ANIMS]; 1651 int numAnimations, numHeadAnims; 1652 1653 // parsed from script file 1654 animScript_t scriptAnims[MAX_AISTATES][NUM_ANIM_MOVETYPES]; // locomotive anims, etc 1655 animScript_t scriptCannedAnims[MAX_AISTATES][NUM_ANIM_MOVETYPES]; // played randomly 1656 animScript_t scriptStateChange[MAX_AISTATES][MAX_AISTATES]; // state change events 1657 animScript_t scriptEvents[NUM_ANIM_EVENTTYPES]; // events that trigger special anims 1658 1659 // global list of script items for this model 1660 animScriptItem_t scriptItems[MAX_ANIMSCRIPT_ITEMS_PER_MODEL]; 1661 int numScriptItems; 1662 1663 } animModelInfo_t; 1664 1665 // this is the main structure that is duplicated on the client and server 1666 typedef struct 1667 { 1668 int clientModels[MAX_CLIENTS]; // so we know which model each client is using 1669 animModelInfo_t *modelInfo[MAX_ANIMSCRIPT_MODELS]; 1670 int clientConditions[MAX_CLIENTS][NUM_ANIM_CONDITIONS][2]; 1671 // 1672 // pointers to functions from the owning module 1673 // 1674 int ( *soundIndex )( const char *name ); 1675 void ( *playSound )( int soundIndex, vec3_t org, int clientNum ); 1676 } animScriptData_t; 1677 1678 //------------------------------------------------------------------ 1679 // Conditional Constants 1680 1681 typedef enum 1682 { 1683 POSITION_UNUSED, 1684 POSITION_BEHIND, 1685 POSITION_INFRONT, 1686 POSITION_RIGHT, 1687 POSITION_LEFT, 1688 1689 NUM_ANIM_COND_POSITIONS 1690 } animScriptPosition_t; 1691 1692 typedef enum 1693 { 1694 MOUNTED_UNUSED, 1695 MOUNTED_MG42, 1696 1697 NUM_ANIM_COND_MOUNTED 1698 } animScriptMounted_t; 1699 1700 typedef enum 1701 { 1702 LEANING_UNUSED, 1703 LEANING_RIGHT, 1704 LEANING_LEFT, 1705 1706 NUM_ANIM_COND_LEANING 1707 } animScriptLeaning_t; 1708 1709 typedef enum 1710 { 1711 IMPACTPOINT_UNUSED, 1712 IMPACTPOINT_HEAD, 1713 IMPACTPOINT_CHEST, 1714 IMPACTPOINT_GUT, 1715 IMPACTPOINT_GROIN, 1716 IMPACTPOINT_SHOULDER_RIGHT, 1717 IMPACTPOINT_SHOULDER_LEFT, 1718 IMPACTPOINT_KNEE_RIGHT, 1719 IMPACTPOINT_KNEE_LEFT, 1720 1721 NUM_ANIM_COND_IMPACTPOINT 1722 } animScriptImpactPoint_t; 1723 1724 //------------------------------------------------------------------ 1725 // Global Function Decs 1726 1727 animModelInfo_t *BG_ModelInfoForModelname( char *modelname ); 1728 qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *filename, const char *input ); 1729 void BG_AnimParseAnimScript( animModelInfo_t *modelInfo, animScriptData_t *scriptData, int client, char *filename, char *input ); 1730 int BG_AnimScriptAnimation( playerState_t *ps, aistateEnum_t state, scriptAnimMoveTypes_t movetype, qboolean isContinue ); 1731 int BG_AnimScriptCannedAnimation( playerState_t *ps, aistateEnum_t state ); 1732 int BG_AnimScriptStateChange( playerState_t *ps, aistateEnum_t newState, aistateEnum_t oldState ); 1733 int BG_AnimScriptEvent( playerState_t *ps, scriptAnimEventTypes_t event, qboolean isContinue, qboolean force ); 1734 int BG_IndexForString( char *token, animStringItem_t *strings, qboolean allowFail ); 1735 int BG_PlayAnimName( playerState_t *ps, char *animName, animBodyPart_t bodyPart, qboolean setTimer, qboolean isContinue, qboolean force ); 1736 qboolean BG_ValidAnimScript( int clientNum ); 1737 char *BG_GetAnimString( int client, int anim ); 1738 void BG_UpdateConditionValue( int client, int condition, int value, qboolean checkConversion ); 1739 int BG_GetConditionValue( int client, int condition, qboolean checkConversion ); 1740 int BG_GetAnimScriptAnimation( int client, aistateEnum_t state, scriptAnimMoveTypes_t movetype ); 1741 void BG_AnimUpdatePlayerStateConditions( pmove_t *pmove ); 1742 int BG_AnimationIndexForString( char *string, int client ); 1743 animation_t *BG_AnimationForString( char *string, animModelInfo_t *modelInfo ); 1744 animation_t *BG_GetAnimationForIndex( int client, int index ); 1745 int BG_GetAnimScriptEvent( playerState_t *ps, scriptAnimEventTypes_t event ); 1746 void QDECL BG_AnimParseError( const char *msg, ... ) __attribute__ ((format (printf, 1, 2))); 1747 void BG_UpdateConditionValueStrings( int client, char *conditionStr, char *valueStr ); 1748 float BG_AnimGetFootstepGap( playerState_t *ps, float xyspeed ); 1749 1750 extern animStringItem_t animStateStr[]; 1751 extern animStringItem_t animBodyPartsStr[]; 1752