set g_ca_warmup 10 "time players get to run around before the round starts"
set g_ca_damage2score 100 "every this amount of damage done give players 1 point"
set g_ca_round_timelimit 180 "round time limit in seconds"
+set g_ca_round_enddelay 1 "seconds of delay for score evaluation after round could end"
set g_ca_teams_override 0
set g_ca_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any"
set g_ca_teams 0
set g_freezetag_revive_nade_health 40 "Amount of health player has if they revived from their own nade explosion"
set g_freezetag_revive_time_to_score 1.5 "every this amount of seconds give players reviving a frozen teammate 1 point"
set g_freezetag_round_timelimit 360 "round time limit in seconds"
+set g_freezetag_round_enddelay 1 "seconds of delay for score evaluation after round could end"
set g_freezetag_revive_auto 1 "automatically revive frozen players after some time (g_freezetag_frozen_maxtime)"
set g_freezetag_revive_auto_progress 1 "start the automatic reviving progress as soon as the player gets frozen"
set g_freezetag_revive_auto_reducible 1 "reduce auto-revival time when frozen players are hit by enemies; set to -1 to reduce it even when they are hit by teammates"
set g_survival_reward_survival 1 "give a point to all surviving players if the round timelimit is reached, in addition to the points given for kills"
set g_survival_warmup 10 "how long the players will have time to run around the map before the round starts"
set g_survival_round_timelimit 120 "round time limit in seconds"
+set g_survival_round_enddelay 1 "seconds of delay for score evaluation after round could end"
return -2; // Equality. Can't avoid the stalemate.
}
+float autocvar_g_ca_round_enddelay = 1;
float CA_CheckWinner()
{
int winner_team = 0;
if (!winner_team)
winner_team = Team_GetWinnerAliveTeam();
if (!winner_team)
+ {
+ // Dr. Jaska:
+ // reset delay time here only for consistency
+ // CA players currently have no known ways to resurrect
+ round_handler_ResetEndDelayTime();
return 0;
+ }
+
+ // delay round ending a bit
+ if (autocvar_g_ca_round_enddelay
+ && round_handler_GetEndTime() > 0
+ && round_handler_GetEndTime() - time > 0) // don't delay past timelimit
+ {
+ if (round_handler_GetEndDelayTime() == -1)
+ {
+ round_handler_SetEndDelayTime(min(time + autocvar_g_ca_round_enddelay, round_handler_GetEndTime()));
+ return 0;
+ }
+ else if (round_handler_GetEndDelayTime() >= time)
+ {
+ return 0;
+ }
+ }
if(winner_team > 0)
{
void nades_Clear(entity);
void nades_GiveBonus(entity player, float score);
+float autocvar_g_freezetag_round_enddelay = 1;
bool freezetag_CheckWinner()
{
- if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
+ if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0
+ && round_handler_GetEndDelayTime() == -1)
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
int winner_team = Team_GetWinnerAliveTeam();
if (!winner_team)
+ {
+ round_handler_ResetEndDelayTime();
return false;
+ }
+
+ // delay round ending a bit
+ if (autocvar_g_freezetag_round_enddelay
+ && round_handler_GetEndTime() > 0
+ && round_handler_GetEndTime() - time > 0) // don't delay past timelimit
+ {
+ if (round_handler_GetEndDelayTime() == -1)
+ {
+ round_handler_SetEndDelayTime(min(time + autocvar_g_freezetag_round_enddelay, round_handler_GetEndTime()));
+ return 0;
+ }
+ else if (round_handler_GetEndDelayTime() >= time)
+ {
+ return 0;
+ }
+ }
if(winner_team > 0)
{
});
}
+float autocvar_g_survival_round_enddelay = 1;
float Surv_CheckWinner()
{
- if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
+ if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0
+ && autocvar_g_survival_round_enddelay == -1)
{
// if the match times out, survivors win too!
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_SURVIVAL_SURVIVOR_WIN);
});
if(survivor_count > 0 && hunter_count > 0)
{
+ // Dr. Jaska:
+ // reset delay time here only for consistency
+ // Survival players currently have no known ways to resurrect
+ round_handler_ResetEndDelayTime();
return 0;
}
+ // delay round ending a bit
+ if (autocvar_g_survival_round_enddelay
+ && round_handler_GetEndTime() > 0
+ && round_handler_GetEndTime() - time > 0) // don't delay past timelimit
+ {
+ if (round_handler_GetEndDelayTime() == -1)
+ {
+ round_handler_SetEndDelayTime(min(time + autocvar_g_survival_round_enddelay, round_handler_GetEndTime()));
+ return 0;
+ }
+ else if (round_handler_GetEndDelayTime() >= time)
+ {
+ return 0;
+ }
+ }
+
if(hunter_count > 0) // hunters win
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_SURVIVAL_HUNTER_WIN);
// schedule a new round
this.wait = true;
this.nextthink = time + this.delay;
+ round_handler_ResetEndDelayTime();
}
else
{
this.canRoundEnd = canRoundEnd_func;
this.roundStart = roundStart_func;
this.wait = false;
+ round_handler_ResetEndDelayTime();
round_handler_Init(5, 5, 180);
this.nextthink = time;
{
entity this = round_handler;
this.wait = false;
+ round_handler_ResetEndDelayTime();
if (this.count)
if (this.cnt < this.count + 1) this.cnt = this.count + 1;
this.nextthink = next_think;
// reaches 0 when the round starts
.float round_timelimit;
.float round_endtime;
+.float round_enddelaytime;
.bool() canRoundStart;
.bool() canRoundEnd;
.void() roundStart;
#define round_handler_CountdownRunning() (!round_handler.wait && round_handler.cnt)
#define round_handler_IsRoundStarted() (!round_handler.wait && !round_handler.cnt)
#define round_handler_GetEndTime() (round_handler.round_endtime)
+#define round_handler_GetEndDelayTime() (round_handler.round_enddelaytime)
+#define round_handler_SetEndDelayTime(t) (round_handler.round_enddelaytime = t)
+#define round_handler_ResetEndDelayTime() (round_handler.round_enddelaytime = -1)
BADPREFIX("sv_vote_");
BADPREFIX("timelimit_");
BADPRESUFFIX("g_", "_round_timelimit");
+ BADPRESUFFIX("g_", "_round_enddelay");
// allowed changes to server admins (please sync this to server.cfg)
// vi commands: