1 /*
2 ===========================================================================
3 
4 Return to Castle Wolfenstein single player 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 single player GPL Source Code (“RTCW SP Source Code”).
8 
9 RTCW SP 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 SP 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 SP Source Code.  If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the RTCW SP 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 SP 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 #define CTF_CAPTURE_BONUS       5       // what you get for capture
31 #define CTF_TEAM_BONUS          0       // what your team gets for capture
32 #define CTF_RECOVERY_BONUS      1       // what you get for recovery
33 #define CTF_FLAG_BONUS          0       // what you get for picking up enemy flag
34 #define CTF_FRAG_CARRIER_BONUS  2       // what you get for fragging enemy flag carrier
35 #define CTF_FLAG_RETURN_TIME    40000   // seconds until auto return
36 
37 #define CTF_CARRIER_DANGER_PROTECT_BONUS    2   // bonus for fraggin someone who has recently hurt your flag carrier
38 #define CTF_CARRIER_PROTECT_BONUS           1   // bonus for fraggin someone while either you or your target are near your flag carrier
39 #define CTF_FLAG_DEFENSE_BONUS              1   // bonus for fraggin someone while either you or your target are near your flag
40 #define CTF_RETURN_FLAG_ASSIST_BONUS        1   // awarded for returning a flag that causes a capture to happen almost immediately
41 #define CTF_FRAG_CARRIER_ASSIST_BONUS       2   // award for fragging a flag carrier if a capture happens almost immediately
42 
43 #define CTF_TARGET_PROTECT_RADIUS           400 // the radius around an object being defended where a target will be worth extra frags
44 #define CTF_ATTACKER_PROTECT_RADIUS         400 // the radius around an object being defended where an attacker will get extra frags when making kills
45 
46 #define CTF_CARRIER_DANGER_PROTECT_TIMEOUT  8
47 #define CTF_FRAG_CARRIER_ASSIST_TIMEOUT     10000
48 #define CTF_RETURN_FLAG_ASSIST_TIMEOUT      10000
49 
50 #define CTF_GRAPPLE_SPEED                   750 // speed of grapple in flight
51 #define CTF_GRAPPLE_PULL_SPEED              750 // speed player is pulled at
52 
53 // Prototypes
54 
55 int OtherTeam( int team );
56 const char *TeamName( int team );
57 const char *TeamColorString( int team );
58 
59 void Team_DroppedFlagThink( gentity_t *ent );
60 void Team_FragBonuses( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker );
61 void Team_CheckHurtCarrier( gentity_t *targ, gentity_t *attacker );
62 void Team_InitGame( void );
63 void Team_ReturnFlag( int team );
64 void Team_FreeEntity( gentity_t *ent );
65 gentity_t *SelectCTFSpawnPoint ( team_t team, int teamstate, vec3_t origin, vec3_t angles, qboolean isbot );
66 gentity_t *Team_GetLocation( gentity_t *ent );
67 qboolean Team_GetLocationMsg( gentity_t *ent, char *loc, int loclen );
68 void TeamplayInfoMessage( gentity_t *ent );
69 void CheckTeamStatus( void );
70 
71 int Pickup_Team( gentity_t *ent, gentity_t *other );
72