]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_ctf.qh
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_ctf.qh
index 0b86a57f809936604fd51a5514b899108558dcac..09d23164370484b8fb3d34554eb5fa9ffc2d62ce 100644 (file)
@@ -8,16 +8,16 @@ 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;
+       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
@@ -27,10 +27,14 @@ 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') * 1.4); // scaling be damned
-    ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4);
+       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); }
+Flag CTF_FLAG;
+STATIC_INIT(Flag)
+{
+       CTF_FLAG = NEW(Flag);
+}
 void ctf_FlagTouch(entity this, entity toucher) { ITEM_HANDLE(Pickup, CTF_FLAG, this, toucher); }
 
 // flag constants // for most of these, there is just one question to be asked: WHYYYYY?
@@ -68,7 +72,7 @@ const float VEHICLE_FLAG_SCALE = 1.0;
 // score fields
 .float score_assist;
 .float score_capture;
-.float score_drop; // note: negated
+.float score_drop;         // note: negated
 .float score_pickup;
 .float score_return;
 .float score_team_capture; // shouldn't be too high
@@ -123,12 +127,12 @@ void ctf_Handle_Throw(entity player, entity receiver, float droptype);
 
 // flag properties
 #define ctf_spawnorigin dropped_origin
-bool ctf_stalemate; // indicates that a stalemate is active
+bool ctf_stalemate;      // indicates that a stalemate is active
 float ctf_captimerecord; // record time for capturing the flag
 .float ctf_pickuptime;
 .float ctf_droptime;
-.int ctf_status; // status of the flag (FLAG_BASE, FLAG_DROPPED, FLAG_CARRY declared globally)
-.entity ctf_dropper; // don't allow spam of dropping the flag
+.int ctf_status;         // status of the flag (FLAG_BASE, FLAG_DROPPED, FLAG_CARRY declared globally)
+.entity ctf_dropper;     // don't allow spam of dropping the flag
 .int max_flag_health;
 .float next_take_time;
 .bool ctf_flagdamaged_byworld;
@@ -143,13 +147,13 @@ int ctf_teams;
 .int throw_count;
 
 // CaptureShield: If the player is too bad to be allowed to capture, shield them from taking the flag.
-.bool ctf_captureshielded; // set to 1 if the player is too bad to be allowed to capture
+.bool ctf_captureshielded;            // set to 1 if the player is too bad to be allowed to capture
 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
+float ctf_captureshield_max_ratio;    // punish at most 30% of each team
+float ctf_captureshield_force;        // push force of the shield
 
 // 1 flag ctf
-bool ctf_oneflag; // indicates whether or not a neutral flag has been found
+bool ctf_oneflag;                     // indicates whether or not a neutral flag has been found
 
 // bot player logic
 const int HAVOCBOT_CTF_ROLE_NONE = 0;
@@ -165,28 +169,28 @@ const int HAVOCBOT_CTF_ROLE_ESCORT = 64;
 void havocbot_role_ctf_setrole(entity bot, int 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))
+#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))
 
 // networked flag statuses
 .int ctf_flagstatus = _STAT(CTF_FLAGSTATUS);
 #endif
 
-const int CTF_RED_FLAG_TAKEN                   = 1;
-const int CTF_RED_FLAG_LOST                            = 2;
-const int CTF_RED_FLAG_CARRYING                        = 3;
-const int CTF_BLUE_FLAG_TAKEN                  = 4;
-const int CTF_BLUE_FLAG_LOST                   = 8;
-const int CTF_BLUE_FLAG_CARRYING               = 12;
-const int CTF_YELLOW_FLAG_TAKEN                        = 16;
-const int CTF_YELLOW_FLAG_LOST                 = 32;
-const int CTF_YELLOW_FLAG_CARRYING             = 48;
-const int CTF_PINK_FLAG_TAKEN                  = 64;
-const int CTF_PINK_FLAG_LOST                   = 128;
-const int CTF_PINK_FLAG_CARRYING               = 192;
-const int CTF_NEUTRAL_FLAG_TAKEN               = 256;
-const int CTF_NEUTRAL_FLAG_LOST                        = 512;
-const int CTF_NEUTRAL_FLAG_CARRYING            = 768;
-const int CTF_FLAG_NEUTRAL                             = 2048;
-const int CTF_SHIELDED                                 = 4096;
-const int CTF_STALEMATE                                        = 8192;
+const int CTF_RED_FLAG_TAKEN            = 1;
+const int CTF_RED_FLAG_LOST             = 2;
+const int CTF_RED_FLAG_CARRYING         = 3;
+const int CTF_BLUE_FLAG_TAKEN           = 4;
+const int CTF_BLUE_FLAG_LOST            = 8;
+const int CTF_BLUE_FLAG_CARRYING        = 12;
+const int CTF_YELLOW_FLAG_TAKEN         = 16;
+const int CTF_YELLOW_FLAG_LOST          = 32;
+const int CTF_YELLOW_FLAG_CARRYING      = 48;
+const int CTF_PINK_FLAG_TAKEN           = 64;
+const int CTF_PINK_FLAG_LOST            = 128;
+const int CTF_PINK_FLAG_CARRYING        = 192;
+const int CTF_NEUTRAL_FLAG_TAKEN        = 256;
+const int CTF_NEUTRAL_FLAG_LOST         = 512;
+const int CTF_NEUTRAL_FLAG_CARRYING     = 768;
+const int CTF_FLAG_NEUTRAL              = 2048;
+const int CTF_SHIELDED                  = 4096;
+const int CTF_STALEMATE                 = 8192;