]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added incremental timer after overtime
authorz411 <z411@omaera.org>
Tue, 1 Sep 2020 14:43:59 +0000 (10:43 -0400)
committerz411 <z411@omaera.org>
Tue, 1 Sep 2020 14:43:59 +0000 (10:43 -0400)
qcsrc/client/hud/panel/timer.qc
qcsrc/common/stats.qh
qcsrc/server/world.qc

index 4a38d91d7c9b9a334c3e65208459536abc908049..4fa3886b60ce2302f8e4170ffec18452952e6412 100644 (file)
@@ -79,6 +79,8 @@ void HUD_Timer()
        } else {
                if (time < STAT(GAMESTARTTIME))
                        timer = seconds_tostring(floor(timelimit * 60));
+               else if (overtimes > 0)
+                       timer = seconds_tostring(floor(time - STAT(OVERTIMESTARTTIME)));
                else
                        timer = seconds_tostring(timeleft);
        }
index 2554bd1efcc22d91e5ac491bf8f04043f590a771..2a614e427dad700bd7035ec33ca6e9f478fb2d60 100644 (file)
@@ -66,6 +66,7 @@ float W_WeaponRateFactor(entity this);
 float game_stopped;
 float game_starttime; //point in time when the countdown to game start is over
 float round_starttime; //point in time when the countdown to round start is over
+float overtime_starttime; // z411 point in time where first overtime started
 float checkrules_overtimesadded; // z411 add
 bool autocvar_g_allow_oldvortexbeam;
 int autocvar_leadlimit;
@@ -106,6 +107,7 @@ REGISTER_STAT(SECRETS_TOTAL, int, secrets_total)
 REGISTER_STAT(SECRETS_FOUND, int, secrets_found)
 REGISTER_STAT(RESPAWN_TIME, float)
 REGISTER_STAT(ROUNDSTARTTIME, float, round_starttime)
+REGISTER_STAT(OVERTIMESTARTTIME, float, overtime_starttime)
 REGISTER_STAT(OVERTIMESADDED, float, checkrules_overtimesadded)
 REGISTER_STAT(MONSTERS_TOTAL, int)
 REGISTER_STAT(MONSTERS_KILLED, int)
index 5b27094eaf998bcabf82fe07fcb3beec8c8dbfef..82ec1f3acb37005099a84916b4d7c9267d3b849b 100644 (file)
@@ -1666,8 +1666,10 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true
        Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime * 60);
        
        sound(NULL, CH_INFO, SND_OVERTIME, VOL_BASE, ATTN_NONE);
-       if(checkrules_overtimesadded == 1)
+       if(checkrules_overtimesadded == 1) {
                Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_OVERTIME);
+               overtime_starttime = time;
+       }
 }
 
 float GetWinningCode(float fraglimitreached, float equality)