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