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 
24 #ifdef MISSIONPACK
25 
26 #define CTF_CAPTURE_BONUS		100		// what you get for capture
27 #define CTF_TEAM_BONUS			25		// what your team gets for capture
28 #define CTF_RECOVERY_BONUS		10		// what you get for recovery
29 #define CTF_FLAG_BONUS			10		// what you get for picking up enemy flag
30 #define CTF_FRAG_CARRIER_BONUS	20		// what you get for fragging enemy flag carrier
31 #define CTF_FLAG_RETURN_TIME	40000	// seconds until auto return
32 
33 #define CTF_CARRIER_DANGER_PROTECT_BONUS	5	// bonus for fraggin someone who has recently hurt your flag carrier
34 #define CTF_CARRIER_PROTECT_BONUS			2	// bonus for fraggin someone while either you or your target are near your flag carrier
35 #define CTF_FLAG_DEFENSE_BONUS				10	// bonus for fraggin someone while either you or your target are near your flag
36 #define CTF_RETURN_FLAG_ASSIST_BONUS		10	// awarded for returning a flag that causes a capture to happen almost immediately
37 #define CTF_FRAG_CARRIER_ASSIST_BONUS		10	// award for fragging a flag carrier if a capture happens almost immediately
38 
39 #else
40 
41 #define CTF_CAPTURE_BONUS		5		// what you get for capture
42 #define CTF_TEAM_BONUS			0		// what your team gets for capture
43 #define CTF_RECOVERY_BONUS		1		// what you get for recovery
44 #define CTF_FLAG_BONUS			0		// what you get for picking up enemy flag
45 #define CTF_FRAG_CARRIER_BONUS	2		// what you get for fragging enemy flag carrier
46 #define CTF_FLAG_RETURN_TIME	40000	// seconds until auto return
47 
48 #define CTF_CARRIER_DANGER_PROTECT_BONUS	2	// bonus for fraggin someone who has recently hurt your flag carrier
49 #define CTF_CARRIER_PROTECT_BONUS			1	// bonus for fraggin someone while either you or your target are near your flag carrier
50 #define CTF_FLAG_DEFENSE_BONUS				1	// bonus for fraggin someone while either you or your target are near your flag
51 #define CTF_RETURN_FLAG_ASSIST_BONUS		1	// awarded for returning a flag that causes a capture to happen almost immediately
52 #define CTF_FRAG_CARRIER_ASSIST_BONUS		2	// award for fragging a flag carrier if a capture happens almost immediately
53 
54 #endif
55 
56 #define CTF_TARGET_PROTECT_RADIUS			1000	// the radius around an object being defended where a target will be worth extra frags
57 #define CTF_ATTACKER_PROTECT_RADIUS			1000	// the radius around an object being defended where an attacker will get extra frags when making kills
58 
59 #define CTF_CARRIER_DANGER_PROTECT_TIMEOUT	8000
60 #define CTF_FRAG_CARRIER_ASSIST_TIMEOUT		10000
61 #define CTF_RETURN_FLAG_ASSIST_TIMEOUT		10000
62 
63 #define CTF_GRAPPLE_SPEED					750 // speed of grapple in flight
64 #define CTF_GRAPPLE_PULL_SPEED				750	// speed player is pulled at
65 
66 #define OVERLOAD_ATTACK_BASE_SOUND_TIME		20000
67 
68 // Prototypes
69 
70 int OtherTeam(int team);
71 const char *TeamName(int team);
72 const char *OtherTeamName(int team);
73 const char *TeamColorString(int team);
74 void AddTeamScore(vec3_t origin, int team, int score);
75 
76 void Team_DroppedFlagThink(gentity_t *ent);
77 void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker);
78 void Team_CheckHurtCarrier(gentity_t *targ, gentity_t *attacker);
79 void Team_InitGame(void);
80 void Team_ReturnFlag(int team);
81 void Team_FreeEntity(gentity_t *ent);
82 gentity_t *SelectCTFSpawnPoint ( team_t team, int teamstate, vec3_t origin, vec3_t angles );
83 gentity_t *Team_GetLocation(gentity_t *ent);
84 qboolean Team_GetLocationMsg(gentity_t *ent, char *loc, int loclen);
85 void TeamplayInfoMessage( gentity_t *ent );
86 void CheckTeamStatus(void);
87 
88 int Pickup_Team( gentity_t *ent, gentity_t *other );
89