| 1 |
/* |
| 2 |
=========================================================================== |
| 3 |
Copyright (C) 1999-2005 Id Software, Inc. |
| 4 |
|
| 5 |
This file is part of Quake III Arena source code. |
| 6 |
|
| 7 |
Quake III Arena source code is free software; you can redistribute it |
| 8 |
and/or modify it under the terms of the GNU General Public License as |
| 9 |
published by the Free Software Foundation; either version 2 of the License, |
| 10 |
or (at your option) any later version. |
| 11 |
|
| 12 |
Quake III Arena source code is distributed in the hope that it will be |
| 13 |
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
GNU General Public License for more details. |
| 16 |
|
| 17 |
You should have received a copy of the GNU General Public License |
| 18 |
along with Quake III Arena source code; if not, write to the Free Software |
| 19 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 |
=========================================================================== |
| 21 |
*/ |
| 22 |
// |
| 23 |
// bg_public.h -- definitions shared by both the server game and client game modules |
| 24 |
|
| 25 |
// because games can change separately from the main system version, we need a |
| 26 |
// second version that must match between game and cgame |
| 27 |
|
| •28 |
#if defined(MISSIONPACK) || !defined(OPENARENA_081_COMPATIBLE) |
| 29 |
// MISSIONPACK and 0.8.5 break ABI and network compatibility, because |
| 30 |
// STAT_PERSISTANT_POWERUP wasn't added at the end of its enum. Sad times. |
| 31 |
# define HAVE_STAT_PERSISTANT_POWERUP |
| 32 |
// Adding objects to the middle of the bg_itemlist also breaks network compat. |
| 33 |
# define HAVE_MISSIONPACK_ITEMLIST |
| 34 |
#endif |
| 35 |
|
| 36 |
#if defined(BG_PUBLIC_H) |
| 37 |
#else |
| 38 |
#define BG_PUBLIC_H 1 |
| 39 |
|
| 40 |
#define GAME_VERSION BASEGAME "-1" |
| 41 |
|
| 42 |
#define DEFAULT_GRAVITY 800 |
| 43 |
#define GIB_HEALTH -40 |
| 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 |
|
| 55 |
#define LIGHTNING_RANGE 768 |
| 56 |
|
| 57 |
#define SCORE_NOT_PRESENT -9999 // for the CS_SCORES[12] when only one player is present |
| 58 |
|
| 59 |
#define VOTE_TIME 30000 // 30 seconds before vote times out |
| 60 |
|
| 61 |
#define MINS_Z -24 |
| 62 |
#define DEFAULT_VIEWHEIGHT 26 |
| 63 |
#define CROUCH_VIEWHEIGHT 12 |
| 64 |
#define DEAD_VIEWHEIGHT -16 |
| 65 |
|
| 66 |
//Domination points |
| 67 |
#define MAX_DOMINATION_POINTS 6 |
| 68 |
#define MAX_DOMINATION_POINTS_NAMES 20 |
| 69 |
|
| 70 |
// |
| 71 |
// config strings are a general means of communicating variable length strings |
| 72 |
// from the server to all connected clients. |
| 73 |
// |
| 74 |
|
| 75 |
// CS_SERVERINFO and CS_SYSTEMINFO are defined in q_shared.h |
| 76 |
#define CS_MUSIC 2 |
| 77 |
#define CS_MESSAGE 3 // from the map worldspawn's message field |
| 78 |
#define CS_MOTD 4 // g_motd string for server message of the day |
| 79 |
#define CS_WARMUP 5 // server time when the match will be restarted |
| 80 |
#define CS_SCORES1 6 |
| 81 |
#define CS_SCORES2 7 |
| 82 |
#define CS_VOTE_TIME 8 |
| 83 |
#define CS_VOTE_STRING 9 |
| 84 |
#define CS_VOTE_YES 10 |
| 85 |
#define CS_VOTE_NO 11 |
| 86 |
|
| 87 |
#define CS_TEAMVOTE_TIME 12 |
| 88 |
#define CS_TEAMVOTE_STRING 14 |
| 89 |
#define CS_TEAMVOTE_YES 16 |
| 90 |
#define CS_TEAMVOTE_NO 18 |
| 91 |
|
| 92 |
#define CS_GAME_VERSION 20 |
| 93 |
#define CS_LEVEL_START_TIME 21 // so the timer only shows the current level |
| 94 |
#define CS_INTERMISSION 22 // when 1, fraglimit/timelimit has been hit and intermission will start in a second or two |
| 95 |
#define CS_FLAGSTATUS 23 // string indicating flag status in CTF |
| 96 |
#define CS_SHADERSTATE 24 |
| 97 |
#define CS_BOTINFO 25 |
| 98 |
|
| 99 |
#define CS_ITEMS 27 // string of 0's and 1's that tell which items are present |
| 100 |
|
| 101 |
#define CS_MODELS 32 |
| 102 |
#define CS_SOUNDS (CS_MODELS+MAX_MODELS) |
| 103 |
#define CS_PLAYERS (CS_SOUNDS+MAX_SOUNDS) |
| 104 |
#define CS_LOCATIONS (CS_PLAYERS+MAX_CLIENTS) |
| 105 |
#define CS_PARTICLES (CS_LOCATIONS+MAX_LOCATIONS) |
| 106 |
|
| 107 |
#define CS_MAX (CS_PARTICLES+MAX_LOCATIONS) |
| 108 |
|
| 109 |
#if (CS_MAX) > MAX_CONFIGSTRINGS |
| 110 |
#error overflow: (CS_MAX) > MAX_CONFIGSTRINGS |
| 111 |
#endif |
| 112 |
|
| 113 |
typedef enum { |
| 114 |
GT_FFA, // free for all |
| 115 |
GT_TOURNAMENT, // one on one tournament |
| 116 |
GT_SINGLE_PLAYER, // single player ffa |
| 117 |
|
| 118 |
//-- team games go after this -- |
| 119 |
|
| 120 |
GT_TEAM, // team deathmatch |
| 121 |
|
| 122 |
//-- team games that uses bases go after this |
| 123 |
|
| 124 |
GT_CTF, // capture the flag |
| 125 |
GT_1FCTF, |
| 126 |
GT_OBELISK, |
| 127 |
GT_HARVESTER, |
| 128 |
|
| 129 |
//-- custom game types, there will be a variable in |
| 130 |
|
| 131 |
GT_ELIMINATION, // team elimination (custom) |
| 132 |
GT_CTF_ELIMINATION, // ctf elimination |
| 133 |
GT_LMS, // Last man standing |
| 134 |
GT_DOUBLE_D, // Double Domination |
| 135 |
GT_DOMINATION, // Standard domination 12 |
| 136 |
GT_MAX_GAME_TYPE |
| 137 |
|
| 138 |
} gametype_t; |
| 139 |
|
| 140 |
typedef enum { GENDER_MALE, GENDER_FEMALE, GENDER_NEUTER } gender_t; |
| 141 |
|
| 142 |
/* |
| 143 |
=================================================================================== |
| 144 |
|
| 145 |
PMOVE MODULE |
| 146 |
|
| 147 |
The pmove code takes a player_state_t and a usercmd_t and generates a new player_state_t |
| 148 |
and some other output data. Used for local prediction on the client game and true |
| 149 |
movement on the server game. |
| 150 |
=================================================================================== |
| 151 |
*/ |
| 152 |
|
| 153 |
typedef enum { |
| 154 |
PM_NORMAL, // can accelerate and turn |
| 155 |
PM_NOCLIP, // noclip movement |
| 156 |
PM_SPECTATOR, // still run into walls |
| 157 |
PM_DEAD, // no acceleration or turning, but free falling |
| 158 |
PM_FREEZE, // stuck in place with no control |
| 159 |
PM_INTERMISSION, // no movement or status bar |
| 160 |
PM_SPINTERMISSION // no movement or status bar |
| 161 |
} pmtype_t; |
| 162 |
|
| 163 |
typedef enum { |
| 164 |
WEAPON_READY, |
| 165 |
WEAPON_RAISING, |
| 166 |
WEAPON_DROPPING, |
| 167 |
WEAPON_FIRING |
| 168 |
} weaponstate_t; |
| 169 |
|
| 170 |
// pmove->pm_flags |
| 171 |
#define PMF_DUCKED 1 |
| 172 |
#define PMF_JUMP_HELD 2 |
| 173 |
#define PMF_BACKWARDS_JUMP 8 // go into backwards land |
| 174 |
#define PMF_BACKWARDS_RUN 16 // coast down to backwards run |
| 175 |
#define PMF_TIME_LAND 32 // pm_time is time before rejump |
| 176 |
#define PMF_TIME_KNOCKBACK 64 // pm_time is an air-accelerate only time |
| 177 |
#define PMF_TIME_WATERJUMP 256 // pm_time is waterjump |
| 178 |
#define PMF_RESPAWNED 512 // clear after attack and jump buttons come up |
| 179 |
#define PMF_USE_ITEM_HELD 1024 |
| 180 |
#define PMF_GRAPPLE_PULL 2048 // pull towards grapple location |
| 181 |
#define PMF_FOLLOW 4096 // spectate following another player |
| 182 |
#define PMF_SCOREBOARD 8192 // spectate as a scoreboard |
| 183 |
#define PMF_INVULEXPAND 16384 // invulnerability sphere set to full size |
| 184 |
//Elimination players cannot fire in warmup |
| 185 |
#define PMF_ELIMWARMUP 32768 //I hope this is more than 16 signed bits! (it's not but it just works anyway...) |
| 186 |
//Don't add anymore, I have already set the sign bit :-( |
| 187 |
|
| 188 |
#define PMF_ALL_TIMES (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK) |
| 189 |
|
| 190 |
#define MAXTOUCH 32 |
| 191 |
typedef struct { |
| 192 |
// state (in / out) |
| 193 |
playerState_t *ps; |
| 194 |
|
| 195 |
// command (in) |
| 196 |
usercmd_t cmd; |
| 197 |
int tracemask; // collide against these types of surfaces |
| 198 |
int debugLevel; // if set, diagnostic output will be printed |
| 199 |
qboolean noFootsteps; // if the game is setup for no footsteps by the server |
| 200 |
qboolean gauntletHit; // true if a gauntlet attack would actually hit something |
| 201 |
|
| 202 |
int framecount; |
| 203 |
|
| 204 |
// results (out) |
| 205 |
int numtouch; |
| 206 |
int touchents[MAXTOUCH]; |
| 207 |
|
| 208 |
vec3_t mins, maxs; // bounding box size |
| 209 |
|
| 210 |
int watertype; |
| 211 |
int waterlevel; |
| 212 |
|
| 213 |
float xyspeed; |
| 214 |
|
| 215 |
// for fixed msec Pmove |
| 216 |
int pmove_fixed; |
| 217 |
int pmove_msec; |
| 218 |
|
| 219 |
//Sago's pmove |
| 220 |
int pmove_float; |
| 221 |
|
| 222 |
//Flags effecting movement (see dmflags) |
| 223 |
int pmove_flags; |
| 224 |
|
| 225 |
// callbacks to test the world |
| 226 |
// these will be different functions during game and cgame |
| 227 |
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 ); |
| 228 |
int (*pointcontents)( const vec3_t point, int passEntityNum ); |
| 229 |
} pmove_t; |
| 230 |
|
| 231 |
// if a full pmove isn't done on the client, you can just update the angles |
| 232 |
void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ); |
| 233 |
void Pmove (pmove_t *pmove); |
| 234 |
|
| 235 |
//=================================================================================== |
| 236 |
|
| 237 |
// player_state->stats[] indexes |
| 238 |
// NOTE: may not have more than 16 |
| 239 |
typedef enum { |
| 240 |
STAT_HEALTH, |
| 241 |
STAT_HOLDABLE_ITEM, |
| •242 |
#ifdef HAVE_STAT_PERSISTANT_POWERUP |
| 243 |
STAT_PERSISTANT_POWERUP, |
| •244 |
#endif |
| 245 |
STAT_WEAPONS, // 16 bit fields |
| 246 |
STAT_ARMOR, |
| 247 |
STAT_DEAD_YAW, // look this direction when dead (FIXME: get rid of?) |
| 248 |
STAT_CLIENTS_READY, // bit mask of clients wishing to exit the intermission (FIXME: configstring?) |
| 249 |
STAT_MAX_HEALTH // health / armor limit, changable by handicap |
| 250 |
} statIndex_t; |
| 251 |
|
| 252 |
|
| 253 |
// player_state->persistant[] indexes |
| 254 |
// these fields are the only part of player_state that isn't |
| 255 |
// cleared on respawn |
| 256 |
// NOTE: may not have more than 16 |
| 257 |
typedef enum { |
| 258 |
PERS_SCORE, // !!! MUST NOT CHANGE, SERVER AND GAME BOTH REFERENCE !!! |
| 259 |
PERS_HITS, // total points damage inflicted so damage beeps can sound on change |
| 260 |
PERS_RANK, // player rank or team rank |
| 261 |
PERS_TEAM, // player team |
| 262 |
PERS_SPAWN_COUNT, // incremented every respawn |
| 263 |
PERS_PLAYEREVENTS, // 16 bits that can be flipped for events |
| 264 |
PERS_ATTACKER, // clientnum of last damage inflicter |
| 265 |
PERS_ATTACKEE_ARMOR, // health/armor of last person we attacked |
| 266 |
PERS_KILLED, // count of the number of times you died |
| 267 |
// player awards tracking |
| 268 |
PERS_IMPRESSIVE_COUNT, // two railgun hits in a row |
| 269 |
PERS_EXCELLENT_COUNT, // two successive kills in a short amount of time |
| 270 |
PERS_DEFEND_COUNT, // defend awards |
| 271 |
PERS_ASSIST_COUNT, // assist awards |
| 272 |
PERS_GAUNTLET_FRAG_COUNT, // kills with the guantlet |
| 273 |
PERS_CAPTURES // captures |
| 274 |
} persEnum_t; |
| 275 |
|
| 276 |
|
| 277 |
// entityState_t->eFlags |
| 278 |
#define EF_DEAD 0x00000001 // don't draw a foe marker over players with EF_DEAD |
| 279 |
#define EF_TICKING 0x00000002 // used to make players play the prox mine ticking sound |
| 280 |
#define EF_TELEPORT_BIT 0x00000004 // toggled every time the origin abruptly changes |
| 281 |
#define EF_AWARD_EXCELLENT 0x00000008 // draw an excellent sprite |
| 282 |
#define EF_PLAYER_EVENT 0x00000010 |
| 283 |
#define EF_BOUNCE 0x00000010 // for missiles |
| 284 |
#define EF_BOUNCE_HALF 0x00000020 // for missiles |
| 285 |
#define EF_AWARD_GAUNTLET 0x00000040 // draw a gauntlet sprite |
| 286 |
#define EF_NODRAW 0x00000080 // may have an event, but no model (unspawned items) |
| 287 |
#define EF_FIRING 0x00000100 // for lightning gun |
| 288 |
#define EF_KAMIKAZE 0x00000200 |
| 289 |
#define EF_MOVER_STOP 0x00000400 // will push otherwise |
| 290 |
#define EF_AWARD_CAP 0x00000800 // draw the capture sprite |
| 291 |
#define EF_TALK 0x00001000 // draw a talk balloon |
| 292 |
#define EF_CONNECTION 0x00002000 // draw a connection trouble sprite |
| 293 |
#define EF_VOTED 0x00004000 // already cast a vote |
| 294 |
#define EF_AWARD_IMPRESSIVE 0x00008000 // draw an impressive sprite |
| 295 |
#define EF_AWARD_DEFEND 0x00010000 // draw a defend sprite |
| 296 |
#define EF_AWARD_ASSIST 0x00020000 // draw a assist sprite |
| 297 |
#define EF_AWARD_DENIED 0x00040000 // denied |
| 298 |
#define EF_TEAMVOTED 0x00080000 // already cast a team vote |
| 299 |
|
| 300 |
// NOTE: may not have more than 16 |
| 301 |
typedef enum { |
| 302 |
PW_NONE, |
| 303 |
|
| 304 |
PW_QUAD, |
| 305 |
PW_BATTLESUIT, |
| 306 |
PW_HASTE, |
| 307 |
PW_INVIS, |
| 308 |
PW_REGEN, |
| 309 |
PW_FLIGHT, |
| 310 |
|
| 311 |
PW_REDFLAG, |
| 312 |
PW_BLUEFLAG, |
| 313 |
PW_NEUTRALFLAG, |
| 314 |
|
| 315 |
PW_SCOUT, |
| 316 |
PW_GUARD, |
| 317 |
PW_DOUBLER, |
| 318 |
PW_AMMOREGEN, |
| 319 |
PW_INVULNERABILITY, |
| 320 |
|
| 321 |
PW_NUM_POWERUPS |
| 322 |
|
| 323 |
} powerup_t; |
| 324 |
|
| 325 |
typedef enum { |
| 326 |
HI_NONE, |
| 327 |
|
| 328 |
HI_TELEPORTER, |
| 329 |
HI_MEDKIT, |
| 330 |
HI_KAMIKAZE, |
| 331 |
HI_PORTAL, |
| 332 |
HI_INVULNERABILITY, |
| 333 |
|
| 334 |
HI_NUM_HOLDABLE |
| 335 |
} holdable_t; |
| 336 |
|
| 337 |
typedef enum { |
| 338 |
DD_NONE, |
| 339 |
|
| 340 |
DD_POINTARED, |
| 341 |
DD_POINTABLUE, |
| 342 |
DD_POINTAWHITE, |
| 343 |
DD_POINTBRED, |
| 344 |
DD_POINTBBLUE, |
| 345 |
DD_POINTBWHITE |
| 346 |
} doubled_t; |
| 347 |
|
| 348 |
typedef enum { |
| 349 |
DOM_NONE, |
| 350 |
|
| 351 |
DOM_POINTRED, |
| 352 |
DOM_POINTBLUE, |
| 353 |
DOM_POINTWHITE, |
| 354 |
} domination_t; |
| 355 |
|
| 356 |
|
| 357 |
typedef enum { |
| 358 |
WP_NONE, |
| 359 |
|
| 360 |
WP_GAUNTLET, |
| 361 |
WP_MACHINEGUN, |
| 362 |
WP_SHOTGUN, |
| 363 |
WP_GRENADE_LAUNCHER, |
| 364 |
WP_ROCKET_LAUNCHER, |
| 365 |
WP_LIGHTNING, |
| 366 |
WP_RAILGUN, |
| 367 |
WP_PLASMAGUN, |
| 368 |
WP_BFG, |
| 369 |
WP_GRAPPLING_HOOK, |
| 370 |
WP_NAILGUN, |
| 371 |
WP_PROX_LAUNCHER, |
| 372 |
WP_CHAINGUN, |
| 373 |
|
| 374 |
WP_NUM_WEAPONS |
| 375 |
} weapon_t; |
| 376 |
|
| 377 |
|
| 378 |
// reward sounds (stored in ps->persistant[PERS_PLAYEREVENTS]) |
| 379 |
#define PLAYEREVENT_DENIEDREWARD 0x0001 |
| 380 |
#define PLAYEREVENT_GAUNTLETREWARD 0x0002 |
| 381 |
#define PLAYEREVENT_HOLYSHIT 0x0004 |
| 382 |
|
| 383 |
// entityState_t->event values |
| 384 |
// entity events are for effects that take place reletive |
| 385 |
// to an existing entities origin. Very network efficient. |
| 386 |
|
| 387 |
// two bits at the top of the entityState->event field |
| 388 |
// will be incremented with each change in the event so |
| 389 |
// that an identical event started twice in a row can |
| 390 |
// be distinguished. And off the value with ~EV_EVENT_BITS |
| 391 |
// to retrieve the actual event number |
| 392 |
#define EV_EVENT_BIT1 0x00000100 |
| 393 |
#define EV_EVENT_BIT2 0x00000200 |
| 394 |
#define EV_EVENT_BITS (EV_EVENT_BIT1|EV_EVENT_BIT2) |
| 395 |
|
| 396 |
#define EVENT_VALID_MSEC 300 |
| 397 |
|
| 398 |
typedef enum { |
| 399 |
EV_NONE, |
| 400 |
|
| 401 |
EV_FOOTSTEP, |
| 402 |
EV_FOOTSTEP_METAL, |
| 403 |
EV_FOOTSPLASH, |
| 404 |
EV_FOOTWADE, |
| 405 |
EV_SWIM, |
| 406 |
|
| 407 |
EV_STEP_4, |
| 408 |
EV_STEP_8, |
| 409 |
EV_STEP_12, |
| 410 |
EV_STEP_16, |
| 411 |
|
| 412 |
EV_FALL_SHORT, |
| 413 |
EV_FALL_MEDIUM, |
| 414 |
EV_FALL_FAR, |
| 415 |
|
| 416 |
EV_JUMP_PAD, // boing sound at origin, jump sound on player |
| 417 |
|
| 418 |
EV_JUMP, //Event 14 |
| 419 |
EV_WATER_TOUCH, // foot touches |
| 420 |
EV_WATER_LEAVE, // foot leaves |
| 421 |
EV_WATER_UNDER, // head touches |
| 422 |
EV_WATER_CLEAR, // head leaves |
| 423 |
|
| 424 |
EV_ITEM_PICKUP, // normal item pickups are predictable |
| 425 |
EV_GLOBAL_ITEM_PICKUP, // powerup / team sounds are broadcast to everyone |
| 426 |
|
| 427 |
EV_NOAMMO, |
| 428 |
EV_CHANGE_WEAPON, |
| 429 |
EV_FIRE_WEAPON, |
| 430 |
|
| 431 |
EV_USE_ITEM0, //Event 24 |
| 432 |
EV_USE_ITEM1, |
| 433 |
EV_USE_ITEM2, |
| 434 |
EV_USE_ITEM3, |
| 435 |
EV_USE_ITEM4, |
| 436 |
EV_USE_ITEM5, |
| 437 |
EV_USE_ITEM6, |
| 438 |
EV_USE_ITEM7, |
| 439 |
EV_USE_ITEM8, |
| 440 |
EV_USE_ITEM9, |
| 441 |
EV_USE_ITEM10, |
| 442 |
EV_USE_ITEM11, |
| 443 |
EV_USE_ITEM12, |
| 444 |
EV_USE_ITEM13, |
| 445 |
EV_USE_ITEM14, |
| 446 |
EV_USE_ITEM15, |
| 447 |
|
| 448 |
EV_ITEM_RESPAWN, //Event 40 |
| 449 |
EV_ITEM_POP, |
| 450 |
EV_PLAYER_TELEPORT_IN, |
| 451 |
EV_PLAYER_TELEPORT_OUT, |
| 452 |
|
| 453 |
EV_GRENADE_BOUNCE, // eventParm will be the soundindex |
| 454 |
|
| 455 |
EV_GENERAL_SOUND, |
| 456 |
EV_GLOBAL_SOUND, // no attenuation |
| 457 |
EV_GLOBAL_TEAM_SOUND, |
| 458 |
|
| 459 |
EV_BULLET_HIT_FLESH, |
| 460 |
EV_BULLET_HIT_WALL, |
| 461 |
|
| 462 |
EV_MISSILE_HIT, //Event 50 |
| 463 |
EV_MISSILE_MISS, |
| 464 |
EV_MISSILE_MISS_METAL, |
| 465 |
EV_RAILTRAIL, |
| 466 |
EV_SHOTGUN, |
| 467 |
EV_BULLET, // otherEntity is the shooter |
| 468 |
|
| 469 |
EV_PAIN, |
| 470 |
EV_DEATH1, |
| 471 |
EV_DEATH2, |
| 472 |
EV_DEATH3, |
| 473 |
EV_OBITUARY, //Event 60 |
| 474 |
|
| 475 |
EV_POWERUP_QUAD, |
| 476 |
EV_POWERUP_BATTLESUIT, |
| 477 |
EV_POWERUP_REGEN, |
| 478 |
|
| 479 |
EV_GIB_PLAYER, // gib a previously living player |
| 480 |
EV_SCOREPLUM, // score plum |
| 481 |
|
| 482 |
EV_PROXIMITY_MINE_STICK, |
| 483 |
EV_PROXIMITY_MINE_TRIGGER, |
| 484 |
EV_KAMIKAZE, // kamikaze explodes |
| 485 |
EV_OBELISKEXPLODE, // obelisk explodes |
| 486 |
EV_OBELISKPAIN, // obelisk is in pain |
| 487 |
EV_INVUL_IMPACT, // invulnerability sphere impact |
| 488 |
EV_JUICED, // invulnerability juiced effect |
| 489 |
EV_LIGHTNINGBOLT, // lightning bolt bounced of invulnerability sphere |
| 490 |
|
| 491 |
EV_DEBUG_LINE, |
| 492 |
EV_STOPLOOPINGSOUND, |
| 493 |
EV_TAUNT, |
| 494 |
EV_TAUNT_YES, |
| 495 |
EV_TAUNT_NO, |
| 496 |
EV_TAUNT_FOLLOWME, |
| 497 |
EV_TAUNT_GETFLAG, |
| 498 |
EV_TAUNT_GUARDBASE, |
| 499 |
EV_TAUNT_PATROL |
| 500 |
|
| 501 |
} entity_event_t; |
| 502 |
|
| 503 |
|
| 504 |
typedef enum { |
| 505 |
GTS_RED_CAPTURE, |
| 506 |
GTS_BLUE_CAPTURE, |
| 507 |
GTS_RED_RETURN, |
| 508 |
GTS_BLUE_RETURN, |
| 509 |
GTS_RED_TAKEN, |
| 510 |
GTS_BLUE_TAKEN, |
| 511 |
GTS_REDOBELISK_ATTACKED, |
| 512 |
GTS_BLUEOBELISK_ATTACKED, |
| 513 |
GTS_REDTEAM_SCORED, |
| 514 |
GTS_BLUETEAM_SCORED, |
| 515 |
GTS_REDTEAM_TOOK_LEAD, |
| 516 |
GTS_BLUETEAM_TOOK_LEAD, |
| 517 |
GTS_TEAMS_ARE_TIED, |
| 518 |
GTS_KAMIKAZE |
| 519 |
} global_team_sound_t; |
| 520 |
|
| 521 |
// animations |
| 522 |
typedef enum { |
| 523 |
BOTH_DEATH1, |
| 524 |
BOTH_DEAD1, |
| 525 |
BOTH_DEATH2, |
| 526 |
BOTH_DEAD2, |
| 527 |
BOTH_DEATH3, |
| 528 |
BOTH_DEAD3, |
| 529 |
|
| 530 |
TORSO_GESTURE, |
| 531 |
|
| 532 |
TORSO_ATTACK, |
| 533 |
TORSO_ATTACK2, |
| 534 |
|
| 535 |
TORSO_DROP, |
| 536 |
TORSO_RAISE, |
| 537 |
|
| 538 |
TORSO_STAND, |
| 539 |
TORSO_STAND2, |
| 540 |
|
| 541 |
LEGS_WALKCR, |
| 542 |
LEGS_WALK, |
| 543 |
LEGS_RUN, |
| 544 |
LEGS_BACK, |
| 545 |
LEGS_SWIM, |
| 546 |
|
| 547 |
LEGS_JUMP, |
| 548 |
LEGS_LAND, |
| 549 |
|
| 550 |
LEGS_JUMPB, |
| 551 |
LEGS_LANDB, |
| 552 |
|
| 553 |
LEGS_IDLE, |
| 554 |
LEGS_IDLECR, |
| 555 |
|
| 556 |
LEGS_TURN, |
| 557 |
|
| 558 |
TORSO_GETFLAG, |
| 559 |
TORSO_GUARDBASE, |
| 560 |
TORSO_PATROL, |
| 561 |
TORSO_FOLLOWME, |
| 562 |
TORSO_AFFIRMATIVE, |
| 563 |
TORSO_NEGATIVE, |
| 564 |
|
| 565 |
// BOTH_POSE, // leilei - crappy ui posing code trying |
| 566 |
|
| 567 |
MAX_ANIMATIONS, |
| 568 |
|
| 569 |
LEGS_BACKCR, |
| 570 |
LEGS_BACKWALK, |
| 571 |
FLAG_RUN, |
| 572 |
FLAG_STAND, |
| 573 |
FLAG_STAND2RUN, |
| 574 |
|
| 575 |
MAX_TOTALANIMATIONS |
| 576 |
} animNumber_t; |
| 577 |
|
| 578 |
|
| 579 |
typedef struct animation_s { |
| 580 |
int firstFrame; |
| 581 |
int numFrames; |
| 582 |
int loopFrames; // 0 to numFrames |
| 583 |
int frameLerp; // msec between frames |
| 584 |
int initialLerp; // msec to get to first frame |
| 585 |
int reversed; // true if animation is reversed |
| 586 |
int flipflop; // true if animation should flipflop back to base |
| 587 |
} animation_t; |
| 588 |
|
| 589 |
|
| 590 |
// flip the togglebit every time an animation |
| 591 |
// changes so a restart of the same anim can be detected |
| 592 |
#define ANIM_TOGGLEBIT 128 |
| 593 |
|
| 594 |
|
| 595 |
typedef enum { |
| 596 |
TEAM_FREE, |
| 597 |
TEAM_RED, |
| 598 |
TEAM_BLUE, |
| 599 |
TEAM_SPECTATOR, |
| 600 |
|
| 601 |
TEAM_NUM_TEAMS |
| 602 |
} team_t; |
| 603 |
|
| 604 |
// This is a fair assumption for Double Domination: |
| 605 |
#define TEAM_NONE TEAM_SPECTATOR |
| 606 |
|
| 607 |
// Time between location updates |
| 608 |
#define TEAM_LOCATION_UPDATE_TIME 1000 |
| 609 |
|
| 610 |
// How many players on the overlay |
| 611 |
#define TEAM_MAXOVERLAY 32 |
| 612 |
|
| 613 |
//team task |
| 614 |
typedef enum { |
| 615 |
TEAMTASK_NONE, |
| 616 |
TEAMTASK_OFFENSE, |
| 617 |
TEAMTASK_DEFENSE, |
| 618 |
TEAMTASK_PATROL, |
| 619 |
TEAMTASK_FOLLOW, |
| 620 |
TEAMTASK_RETRIEVE, |
| 621 |
TEAMTASK_ESCORT, |
| 622 |
TEAMTASK_CAMP |
| 623 |
} teamtask_t; |
| 624 |
|
| 625 |
// means of death |
| 626 |
typedef enum { |
| 627 |
MOD_UNKNOWN, |
| 628 |
MOD_SHOTGUN, |
| 629 |
MOD_GAUNTLET, |
| 630 |
MOD_MACHINEGUN, |
| 631 |
MOD_GRENADE, |
| 632 |
MOD_GRENADE_SPLASH, |
| 633 |
MOD_ROCKET, |
| 634 |
MOD_ROCKET_SPLASH, |
| 635 |
MOD_PLASMA, |
| 636 |
MOD_PLASMA_SPLASH, |
| 637 |
MOD_RAILGUN, |
| 638 |
MOD_LIGHTNING, |
| 639 |
MOD_BFG, |
| 640 |
MOD_BFG_SPLASH, |
| 641 |
MOD_WATER, |
| 642 |
MOD_SLIME, |
| 643 |
MOD_LAVA, |
| 644 |
MOD_CRUSH, |
| 645 |
MOD_TELEFRAG, |
| 646 |
MOD_FALLING, |
| 647 |
MOD_SUICIDE, |
| 648 |
MOD_TARGET_LASER, |
| 649 |
MOD_TRIGGER_HURT, |
| 650 |
MOD_NAIL, |
| 651 |
MOD_CHAINGUN, |
| 652 |
MOD_PROXIMITY_MINE, |
| 653 |
MOD_KAMIKAZE, |
| 654 |
MOD_JUICED, |
| 655 |
MOD_GRAPPLE |
| 656 |
} meansOfDeath_t; |
| 657 |
|
| 658 |
|
| 659 |
//--------------------------------------------------------- |
| 660 |
|
| 661 |
// gitem_t->type |
| 662 |
typedef enum { |
| 663 |
IT_BAD, |
| 664 |
IT_WEAPON, // EFX: rotate + upscale + minlight |
| 665 |
IT_AMMO, // EFX: rotate |
| 666 |
IT_ARMOR, // EFX: rotate + minlight |
| 667 |
IT_HEALTH, // EFX: static external sphere + rotating internal |
| 668 |
IT_POWERUP, // instant on, timer based |
| 669 |
// EFX: rotate + external ring that rotates |
| 670 |
IT_HOLDABLE, // single use, holdable item |
| 671 |
// EFX: rotate + bob |
| 672 |
IT_PERSISTANT_POWERUP, |
| 673 |
IT_TEAM |
| 674 |
} itemType_t; |
| 675 |
|
| 676 |
#define MAX_ITEM_MODELS 4 |
| 677 |
|
| 678 |
typedef struct gitem_s { |
| 679 |
char *classname; // spawning name |
| 680 |
char *pickup_sound; |
| 681 |
char *world_model[MAX_ITEM_MODELS]; |
| 682 |
|
| 683 |
char *icon; |
| 684 |
char *pickup_name; // for printing on pickup |
| 685 |
|
| 686 |
int quantity; // for ammo how much, or duration of powerup |
| 687 |
itemType_t giType; // IT_* flags |
| 688 |
|
| 689 |
int giTag; |
| 690 |
|
| 691 |
char *precaches; // string of all models and images this item will use |
| 692 |
char *sounds; // string of all sounds this item will use |
| 693 |
} gitem_t; |
| 694 |
|
| 695 |
// included in both the game dll and the client |
| 696 |
extern gitem_t bg_itemlist[]; |
| 697 |
extern int bg_numItems; |
| 698 |
|
| 699 |
gitem_t *BG_FindItem( const char *pickupName ); |
| 700 |
gitem_t *BG_FindItemForWeapon( weapon_t weapon ); |
| 701 |
gitem_t *BG_FindItemForPowerup( powerup_t pw ); |
| 702 |
gitem_t *BG_FindItemForHoldable( holdable_t pw ); |
| 703 |
#define ITEM_INDEX(x) ((x)-bg_itemlist) |
| 704 |
|
| 705 |
qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const playerState_t *ps ); |
| 706 |
|
| 707 |
|
| 708 |
// g_dmflags->integer flags |
| 709 |
#define DF_NO_FALLING 8 |
| 710 |
#define DF_FIXED_FOV 16 |
| 711 |
#define DF_NO_FOOTSTEPS 32 |
| 712 |
#define DF_INSTANT_WEAPON_CHANGE 64 |
| 713 |
#define DF_NO_BUNNY 128 |
| 714 |
#define DF_INVIS 256 |
| 715 |
#define DF_LIGHT_VOTING 512 |
| 716 |
#define DF_NO_SELF_DAMAGE 1024 |
| 717 |
#define DF_PLAYER_OVERLAY 2048 |
| 718 |
|
| 719 |
//g_videoflags->integer |
| 720 |
#define VF_LOCK_CVARS_BASIC 1 |
| 721 |
#define VF_LOCK_CVARS_EXTENDED 2 |
| 722 |
#define VF_LOCK_VERTEX 4 |
| 723 |
|
| 724 |
// g_elimflags->integer |
| 725 |
//This is used to signal the client that it cannot go to free spectator: |
| 726 |
#define EF_ONEWAY 1 |
| 727 |
#define EF_NO_FREESPEC 2 |
| 728 |
|
| 729 |
//g_voteflags->integer |
| 730 |
//Autoparsed from allowedvote |
| 731 |
//List: "/map_restart/nextmap/map/g_gametype/kick/clientkick/g_doWarmup/timelimit/fraglimit/custom/shuffle/" |
| 732 |
#define VF_map_restart 1 |
| 733 |
#define VF_nextmap 2 |
| 734 |
#define VF_map 4 |
| 735 |
#define VF_g_gametype 8 |
| 736 |
//Note that we skipped kick... not needed |
| 737 |
#define VF_clientkick 16 |
| 738 |
#define VF_g_doWarmup 32 |
| 739 |
#define VF_timelimit 64 |
| 740 |
#define VF_fraglimit 128 |
| 741 |
#define VF_custom 256 |
| 742 |
#define VF_shuffle 512 |
| 743 |
|
| 744 |
// content masks |
| 745 |
#define MASK_ALL (-1) |
| 746 |
#define MASK_SOLID (CONTENTS_SOLID) |
| 747 |
#define MASK_PLAYERSOLID (CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_BODY) |
| 748 |
#define MASK_DEADSOLID (CONTENTS_SOLID|CONTENTS_PLAYERCLIP) |
| 749 |
#define MASK_WATER (CONTENTS_WATER|CONTENTS_LAVA|CONTENTS_SLIME) |
| 750 |
#define MASK_OPAQUE (CONTENTS_SOLID|CONTENTS_SLIME|CONTENTS_LAVA) |
| 751 |
#define MASK_SHOT (CONTENTS_SOLID|CONTENTS_BODY|CONTENTS_CORPSE) |
| 752 |
|
| 753 |
|
| 754 |
// |
| 755 |
// entityState_t->eType |
| 756 |
// |
| 757 |
typedef enum { |
| 758 |
ET_GENERAL, |
| 759 |
ET_PLAYER, |
| 760 |
ET_ITEM, |
| 761 |
ET_MISSILE, |
| 762 |
ET_MOVER, |
| 763 |
ET_BEAM, |
| 764 |
ET_PORTAL, |
| 765 |
ET_SPEAKER, |
| 766 |
ET_PUSH_TRIGGER, |
| 767 |
ET_TELEPORT_TRIGGER, |
| 768 |
ET_INVISIBLE, |
| 769 |
ET_GRAPPLE, // grapple hooked on wall |
| 770 |
ET_TEAM, |
| 771 |
|
| 772 |
ET_EVENTS // any of the EV_* events can be added freestanding |
| 773 |
// by setting eType to ET_EVENTS + eventNum |
| 774 |
// this avoids having to set eFlags and eventNum |
| 775 |
} entityType_t; |
| 776 |
|
| 777 |
//KK-OAX Using this now instead of g_mem.c |
| 778 |
// bg_alloc.c |
| 779 |
// |
| 780 |
qboolean BG_CanAlloc( unsigned int size ); |
| 781 |
void *BG_Alloc( unsigned int size ); |
| 782 |
void BG_InitMemory( void ); |
| 783 |
void BG_Free( void *ptr ); |
| 784 |
void BG_DefragmentMemory( void ); |
| 785 |
|
| 786 |
|
| 787 |
void BG_EvaluateTrajectory( const trajectory_t *tr, int atTime, vec3_t result ); |
| 788 |
void BG_EvaluateTrajectoryDelta( const trajectory_t *tr, int atTime, vec3_t result ); |
| 789 |
|
| 790 |
void BG_AddPredictableEventToPlayerstate( int newEvent, int eventParm, playerState_t *ps ); |
| 791 |
|
| 792 |
void BG_TouchJumpPad( playerState_t *ps, entityState_t *jumppad ); |
| 793 |
|
| 794 |
void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean snap ); |
| 795 |
void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s, int time, qboolean snap ); |
| 796 |
|
| 797 |
qboolean BG_PlayerTouchesItem( playerState_t *ps, entityState_t *item, int atTime ); |
| 798 |
|
| 799 |
|
| 800 |
#define ARENAS_PER_TIER 4 |
| 801 |
#define MAX_ARENAS 1024 |
| 802 |
#define MAX_ARENAS_TEXT 8192 |
| 803 |
|
| 804 |
#define MAX_BOTS 1024 |
| 805 |
#define MAX_BOTS_TEXT 8192 |
| 806 |
|
| 807 |
|
| 808 |
// Kamikaze |
| 809 |
|
| 810 |
// 1st shockwave times |
| 811 |
#define KAMI_SHOCKWAVE_STARTTIME 0 |
| 812 |
#define KAMI_SHOCKWAVEFADE_STARTTIME 1500 |
| 813 |
#define KAMI_SHOCKWAVE_ENDTIME 2000 |
| 814 |
// explosion/implosion times |
| 815 |
#define KAMI_EXPLODE_STARTTIME 250 |
| 816 |
#define KAMI_IMPLODE_STARTTIME 2000 |
| 817 |
#define KAMI_IMPLODE_ENDTIME 2250 |
| 818 |
// 2nd shockwave times |
| 819 |
#define KAMI_SHOCKWAVE2_STARTTIME 2000 |
| 820 |
#define KAMI_SHOCKWAVE2FADE_STARTTIME 2500 |
| 821 |
#define KAMI_SHOCKWAVE2_ENDTIME 3000 |
| 822 |
// radius of the models without scaling |
| 823 |
#define KAMI_SHOCKWAVEMODEL_RADIUS 88 |
| 824 |
#define KAMI_BOOMSPHEREMODEL_RADIUS 72 |
| 825 |
// maximum radius of the models during the effect |
| 826 |
#define KAMI_SHOCKWAVE_MAXRADIUS 1320 |
| 827 |
#define KAMI_BOOMSPHERE_MAXRADIUS 720 |
| 828 |
#define KAMI_SHOCKWAVE2_MAXRADIUS 704 |
| 829 |
|
| 830 |
//KK-OAX |
| 831 |
//bg_misc.c |
| 832 |
char *BG_TeamName( team_t team ); |
| 833 |
|
| 834 |
#endif |