Debian Codegraph @

code/game/bg_public.h

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