]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_ctf.qh
Merge branch 'master' into Mario/ctf_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_ctf.qh
index ca4961eddc24231a6056943a0b2bffcdb5dcec06..bb76aa9e1c051b8c4df285b9163d8e1c107290f3 100644 (file)
@@ -34,9 +34,9 @@ void ctf_RespawnFlag(entity flag);
 #define VEHICLE_FLAG_SCALE 1.0
 
 // waypoint colors
-#define WPCOLOR_ENEMYFC(t) (colormapPaletteColor(t - 1, FALSE) * 0.75)
+#define WPCOLOR_ENEMYFC(t) ((t) ? colormapPaletteColor(t - 1, FALSE) * 0.75 : '1 1 1')
 #define WPCOLOR_FLAGCARRIER(t) ('0.8 0.8 0')
-#define WPCOLOR_DROPPEDFLAG(t) (('0.25 0.25 0.25' + colormapPaletteColor(t - 1, FALSE)) * 0.5)
+#define WPCOLOR_DROPPEDFLAG(t) ((t) ? ('0.25 0.25 0.25' + colormapPaletteColor(t - 1, FALSE)) * 0.5 : '1 1 1')
 
 // sounds
 #define snd_flag_taken noise
@@ -101,6 +101,8 @@ float ctf_captimerecord; // record time for capturing the flag
 .entity ctf_dropper; // don't allow spam of dropping the flag
 .float max_flag_health;
 .float next_take_time;
+.float ctf_flagdamaged;
+float ctf_teams;
 
 // passing/throwing properties
 .float pass_distance;
@@ -116,6 +118,9 @@ float ctf_captureshield_min_negscore; // punish at -20 points
 float ctf_captureshield_max_ratio; // punish at most 30% of each team
 float ctf_captureshield_force; // push force of the shield
 
+// 1 flag ctf
+float ctf_oneflag; // indicates whether or not a neutral flag has been found
+
 // bot player logic
 #define HAVOCBOT_CTF_ROLE_NONE 0
 #define HAVOCBOT_CTF_ROLE_DEFENSE 2
@@ -131,4 +136,30 @@ vector havocbot_ctf_middlepoint;
 float havocbot_ctf_middlepoint_radius;
 
 void havocbot_role_ctf_setrole(entity bot, float role);
+
+// team checking
+#define CTF_SAMETEAM(a,b) ((autocvar_g_ctf_reverse || (ctf_oneflag && autocvar_g_ctf_oneflag_reverse)) ? DIFF_TEAM(a,b) : SAME_TEAM(a,b))
+#define CTF_DIFFTEAM(a,b) ((autocvar_g_ctf_reverse || (ctf_oneflag && autocvar_g_ctf_oneflag_reverse)) ? SAME_TEAM(a,b) : DIFF_TEAM(a,b))
+
 #endif
+
+// networked flag statuses
+.float ctf_flagstatus;
+
+const float    CTF_RED_FLAG_TAKEN                      = 1;
+const float    CTF_RED_FLAG_LOST                       = 2;
+const float    CTF_RED_FLAG_CARRYING           = 3;
+const float    CTF_BLUE_FLAG_TAKEN                     = 4;
+const float    CTF_BLUE_FLAG_LOST                      = 8;
+const float    CTF_BLUE_FLAG_CARRYING          = 12;
+const float    CTF_YELLOW_FLAG_TAKEN           = 16;
+const float    CTF_YELLOW_FLAG_LOST            = 32;
+const float    CTF_YELLOW_FLAG_CARRYING        = 48;
+const float    CTF_PINK_FLAG_TAKEN                     = 64;
+const float    CTF_PINK_FLAG_LOST                      = 128;
+const float    CTF_PINK_FLAG_CARRYING          = 192;
+const float    CTF_NEUTRAL_FLAG_TAKEN          = 256;
+const float    CTF_NEUTRAL_FLAG_LOST           = 512;
+const float    CTF_NEUTRAL_FLAG_CARRYING       = 768;
+const float CTF_FLAG_NEUTRAL                   = 2048;
+const float CTF_SHIELDED                               = 4096;