3 // these are needed since mutators are compiled last
7 void ctf_RespawnFlag(entity flag);
9 // score rule declarations
10 const float ST_CTF_CAPS = 1;
11 const float SP_CTF_CAPS = 4;
12 const float SP_CTF_CAPTIME = 5;
13 const float SP_CTF_PICKUPS = 6;
14 const float SP_CTF_DROPS = 7;
15 const float SP_CTF_FCKILLS = 8;
16 const float SP_CTF_RETURNS = 9;
18 // flag constants // for most of these, there is just one question to be asked: WHYYYYY?
19 #define FLAG_MIN (PL_MIN + '0 0 -13')
20 #define FLAG_MAX (PL_MAX + '0 0 -13')
22 const float FLAG_SCALE = 0.6;
24 const float FLAG_THINKRATE = 0.2;
25 const float FLAG_TOUCHRATE = 0.5;
26 const float WPFE_THINKRATE = 0.5;
28 #define FLAG_DROP_OFFSET ('0 0 32')
29 #define FLAG_CARRY_OFFSET ('-16 0 8')
30 #define FLAG_SPAWN_OFFSET ('0 0 1' * (PL_MAX_z - 13))
31 #define FLAG_WAYPOINT_OFFSET ('0 0 64')
32 #define FLAG_FLOAT_OFFSET ('0 0 32')
33 #define FLAG_PASS_ARC_OFFSET ('0 0 -10')
35 #define VEHICLE_FLAG_OFFSET ('0 0 96')
36 const float VEHICLE_FLAG_SCALE = 1.0;
39 #define WPCOLOR_ENEMYFC(t) (colormapPaletteColor(t - 1, false) * 0.75)
40 #define WPCOLOR_FLAGCARRIER(t) ('0.8 0.8 0')
41 #define WPCOLOR_DROPPEDFLAG(t) (('0.25 0.25 0.25' + colormapPaletteColor(t - 1, false)) * 0.5)
44 #define snd_flag_taken noise
45 #define snd_flag_returned noise1
46 #define snd_flag_capture noise2
47 #define snd_flag_respawn noise3
48 .string snd_flag_dropped;
49 .string snd_flag_touch;
50 .string snd_flag_pass;
57 // list of flags on the map
58 entity ctf_worldflaglist;
59 .entity ctf_worldflagnext;
60 .entity ctf_staleflagnext;
63 .entity bot_basewaypoint; // flag waypointsprite
66 .entity wps_flagcarrier;
67 .entity wps_flagdropped;
68 .entity wps_enemyflagcarrier;
69 .float wps_helpme_time;
70 float wpforenemy_announced;
71 float wpforenemy_nextthink;
74 const float FLAG_BASE = 1;
75 const float FLAG_DROPPED = 2;
76 const float FLAG_CARRY = 3;
77 const float FLAG_PASSING = 4;
79 const float DROP_NORMAL = 1;
80 const float DROP_THROW = 2;
81 const float DROP_PASS = 3;
82 const float DROP_RESET = 4;
84 const float PICKUP_BASE = 1;
85 const float PICKUP_DROPPED = 2;
87 const float CAPTURE_NORMAL = 1;
88 const float CAPTURE_DROPPED = 2;
90 const float RETURN_TIMEOUT = 1;
91 const float RETURN_DROPPED = 2;
92 const float RETURN_DAMAGE = 3;
93 const float RETURN_SPEEDRUN = 4;
94 const float RETURN_NEEDKILL = 5;
97 #define ctf_spawnorigin dropped_origin
98 float ctf_stalemate; // indicates that a stalemate is active
99 float ctf_captimerecord; // record time for capturing the flag
100 .float ctf_pickuptime;
102 .float ctf_status; // status of the flag (FLAG_BASE, FLAG_DROPPED, FLAG_CARRY declared globally)
103 .entity ctf_dropper; // don't allow spam of dropping the flag
104 .float max_flag_health;
105 .float next_take_time;
107 // passing/throwing properties
108 .float pass_distance;
111 .float throw_antispam;
112 .float throw_prevtime;
115 // CaptureShield: If the player is too bad to be allowed to capture, shield them from taking the flag.
116 .float ctf_captureshielded; // set to 1 if the player is too bad to be allowed to capture
117 float ctf_captureshield_min_negscore; // punish at -20 points
118 float ctf_captureshield_max_ratio; // punish at most 30% of each team
119 float ctf_captureshield_force; // push force of the shield
122 const float HAVOCBOT_CTF_ROLE_NONE = 0;
123 const float HAVOCBOT_CTF_ROLE_DEFENSE = 2;
124 const float HAVOCBOT_CTF_ROLE_MIDDLE = 4;
125 const float HAVOCBOT_CTF_ROLE_OFFENSE = 8;
126 const float HAVOCBOT_CTF_ROLE_CARRIER = 16;
127 const float HAVOCBOT_CTF_ROLE_RETRIEVER = 32;
128 const float HAVOCBOT_CTF_ROLE_ESCORT = 64;
130 .float havocbot_cantfindflag;
132 vector havocbot_ctf_middlepoint;
133 float havocbot_ctf_middlepoint_radius;
135 void havocbot_role_ctf_setrole(entity bot, float role);