]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixes to stalemate
authorSamual Lenks <samual@xonotic.org>
Sat, 22 Sep 2012 01:48:55 +0000 (21:48 -0400)
committerSamual Lenks <samual@xonotic.org>
Sat, 22 Sep 2012 01:48:55 +0000 (21:48 -0400)
gamemodes.cfg
qcsrc/server/autocvars.qh
qcsrc/server/mutators/gamemode_ctf.qc

index 84ed85e50ea87be783186bc925fd04fd754a0f2a..53b6e3f914f83329b7d6f75b008f117f534bf91a 100644 (file)
@@ -183,7 +183,9 @@ set g_ctf_flagcarrier_selfdamagefactor 1
 set g_ctf_flagcarrier_selfforcefactor 1
 set g_ctf_flagcarrier_damagefactor 1
 set g_ctf_flagcarrier_forcefactor 1
-set g_ctf_flagcarrier_waypointforenemy_stalemate 60 "show the enemy flagcarrier location after both teams have held the flags for this amount of time"
+set g_ctf_stalemate 1 "show the enemy flagcarrier location after both teams have held the flags a certain amount of time"
+set g_ctf_stalemate_endcondition 1 "condition for stalemate mode to be finished: 1 = If ONE flag is no longer stale, 2 = If BOTH flags are no longer stale"
+set g_ctf_stalemate_time 60 "time for each flag until stalemate mode is activated"
 set g_ctf_flagcarrier_waypointforenemy_spotting 1 "show the enemy flagcarrier location if a team mate presses +use to spot them"
 set g_ctf_dropped_capture_delay 1 "dropped capture delay"
 set g_ctf_dropped_capture_radius 100 "allow dropped flags to be automatically captured by base flags if the dropped flag is within this radius of it"
index c383d69e7ad99e31b99747c3343f9568e82017c0..00a257acdd767a9caf6c7f9b64ef7d3c35bf47a3 100644 (file)
@@ -808,7 +808,6 @@ float autocvar_g_ctf_flagcarrier_selfdamagefactor;
 float autocvar_g_ctf_flagcarrier_selfforcefactor;
 float autocvar_g_ctf_flagcarrier_damagefactor;
 float autocvar_g_ctf_flagcarrier_forcefactor;
-float autocvar_g_ctf_flagcarrier_waypointforenemy_stalemate;
 //float autocvar_g_ctf_flagcarrier_waypointforenemy_spotting;
 float autocvar_g_ctf_fullbrightflags;
 float autocvar_g_ctf_ignore_frags;
@@ -825,6 +824,9 @@ float autocvar_g_ctf_score_return;
 float autocvar_g_ctf_shield_force;
 float autocvar_g_ctf_shield_max_ratio;
 float autocvar_g_ctf_shield_min_negscore;
+float autocvar_g_ctf_stalemate;
+float autocvar_g_ctf_stalemate_endcondition;
+float autocvar_g_ctf_stalemate_time;
 float autocvar_g_ctf_reverse;
 float autocvar_g_ctf_dropped_capture_delay;
 float autocvar_g_ctf_dropped_capture_radius;
index 705469d6efd3a694d76a2e95024066d79873e24e..5233aa635c8679f7cba7d6e895dad0e52284e523 100644 (file)
@@ -502,7 +502,10 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype)
        FOR_EACH_REALPLAYER(tmp_player)
        {
                if(tmp_player == player)
+               {
                        centerprint(tmp_player, strcat("You got the ", flag.netname, "!"));
+                       //if(ctf_stalemate) { centerprint(tmp_player, "Stalemate! Enemies can see you on radar!"); }
+               }
                //else if(!IsDifferentTeam(tmp_player, player))
                //      centerprint(tmp_player, strcat("Your ", Team_ColorCode(player.team), "team mate ", verbosename, "^7got the flag! Protect them!"));
                else if(!IsDifferentTeam(tmp_player, flag))
@@ -592,9 +595,9 @@ void ctf_CheckStalemate(void)
        // build list of stale flags
        for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext)
        {
-               if(autocvar_g_ctf_flagcarrier_waypointforenemy_stalemate)
+               if(autocvar_g_ctf_stalemate)
                if(tmp_entity.ctf_status != FLAG_BASE)
-               if(time >= tmp_entity.ctf_pickuptime + autocvar_g_ctf_flagcarrier_waypointforenemy_stalemate)
+               if(time >= tmp_entity.ctf_pickuptime + autocvar_g_ctf_stalemate_time)
                {
                        tmp_entity.ctf_staleflagnext = ctf_staleflaglist; // link flag into staleflaglist
                        ctf_staleflaglist = tmp_entity;
@@ -609,9 +612,11 @@ void ctf_CheckStalemate(void)
 
        if(stale_red_flags && stale_blue_flags)
                ctf_stalemate = TRUE;
-       else if(!stale_red_flags && !stale_blue_flags)
-               ctf_stalemate = FALSE;
-       
+       else if((!stale_red_flags && !stale_blue_flags) && autocvar_g_ctf_stalemate_endcondition == 2)
+               { ctf_stalemate = FALSE; wpforenemy_announced = FALSE; }
+       else if((!stale_red_flags || !stale_blue_flags) && autocvar_g_ctf_stalemate_endcondition == 1)
+               { ctf_stalemate = FALSE; wpforenemy_announced = FALSE; }
+               
        // if sufficient stalemate, then set up the waypointsprite and announce the stalemate if necessary
        if(ctf_stalemate)
        {
@@ -745,7 +750,7 @@ void ctf_FlagThink()
                                ImpulseCommands();
                                self = tmp_entity;
                        }
-                       if(autocvar_g_ctf_flagcarrier_waypointforenemy_stalemate)
+                       if(autocvar_g_ctf_stalemate)
                        {
                                if(time >= wpforenemy_nextthink)
                                {
@@ -907,8 +912,6 @@ void ctf_RespawnFlag(entity flag)
        flag.ctf_dropper = world;
        flag.ctf_pickuptime = 0;
        flag.ctf_droptime = 0;
-
-       wpforenemy_announced = FALSE;
 }
 
 void ctf_Reset()