#ifdef SVQC
#include "../gamemode.qh"
+
+void ctf_Initialize();
+
+REGISTER_MUTATOR(ctf, false)
+{
+ MUTATOR_STATIC();
+ MUTATOR_ONADD
+ {
+ GameRules_teams(true);
+ GameRules_limit_score(autocvar_capturelimit_override);
+ GameRules_limit_lead(autocvar_captureleadlimit_override);
+
+ ctf_Initialize();
+ }
+ return 0;
+}
+
// used in cheats.qc
void ctf_RespawnFlag(entity flag);
const int ST_CTF_CAPS = 1;
CLASS(Flag, Pickup)
- ATTRIB(Flag, m_mins, vector, PL_MIN_CONST + '0 0 -13');
- ATTRIB(Flag, m_maxs, vector, PL_MAX_CONST + '0 0 -13');
+ ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned
+ ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4);
ENDCLASS(Flag)
Flag CTF_FLAG; STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); }
void ctf_FlagTouch(entity this, entity toucher) { ITEM_HANDLE(Pickup, CTF_FLAG, this, toucher); }
.string snd_flag_touch;
.string snd_flag_pass;
+// score fields
+.float score_assist;
+.float score_capture;
+.float score_drop; // note: negated
+.float score_pickup;
+.float score_return;
+.float score_team_capture; // shouldn't be too high
+
// effects
.string toucheffect;
.string passeffect;
.entity ctf_staleflagnext;
// waypoint sprites
-.entity bot_basewaypoint; // flag waypointsprite
.entity wps_helpme;
.entity wps_flagbase;
.entity wps_flagcarrier;
.float next_take_time;
.bool ctf_flagdamaged_byworld;
int ctf_teams;
+.entity enemy; // when flag is back in the base, it remembers last player who carried/touched the flag, useful to bots
// passing/throwing properties
.float pass_distance;
.bool havocbot_cantfindflag;
-vector havocbot_ctf_middlepoint;
-float havocbot_ctf_middlepoint_radius;
-
void havocbot_role_ctf_setrole(entity bot, int role);
// team checking