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