seta g_freezetag_revive_speed 0.4 "Speed for reviving a frozen teammate"
seta g_freezetag_revive_clearspeed 1.6 "Speed at which reviving progress gets lost when out of range"
seta g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him"
+set g_freezetag_round_timelimit 180
seta g_freezetag_frozen_force 0.6 "How much to multiply the force on a frozen player with"
seta g_freezetag_teams_override 0
set g_freezetag_teams 0
float autocvar_g_freezetag_revive_extra_size;
float autocvar_g_freezetag_revive_speed;
float autocvar_g_freezetag_revive_clearspeed;
+float autocvar_g_freezetag_round_timelimit;
float autocvar_g_freezetag_teams;
float autocvar_g_freezetag_teams_override;
float autocvar_g_freezetag_warmup;
float CA_CheckWinner()
{
- // TODO round tied if(time - warmup > autocvar_g_ca_round_timelimit
+ entity e;
+ if(round_handler_GetTimeLeft() <= 0)
+ {
+ FOR_EACH_REALCLIENT(e)
+ centerprint(e, "Round over, there's no winner");
+ bprint("Round over, there's no winner.\n");
+ allowed_to_spawn = TRUE;
+ return 1;
+ }
if(inWarmupStage)
allowed_to_spawn = TRUE;
if(CA_ALIVE_TEAMS() > 1)
return 0;
- entity e;
float winner_team;
string teamname;
winner_team = CA_GetWinnerTeam();
{
allowed_to_spawn = TRUE;
- round_handler_Spawn(CA_CheckTeams, CA_CheckWinner, 5, autocvar_g_ca_warmup);
+ round_handler_Spawn(CA_CheckTeams, CA_CheckWinner, 5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
addstat(STAT_REDALIVE, AS_INT, redalive_stat);
addstat(STAT_BLUEALIVE, AS_INT, bluealive_stat);
precache_model("models/ice/ice.md3");
ScoreRules_freezetag();
- round_handler_Spawn(freezetag_CheckTeams, freezetag_CheckWinner, 5, autocvar_g_freezetag_warmup);
+ round_handler_Spawn(freezetag_CheckTeams, freezetag_CheckWinner, 5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
addstat(STAT_REDALIVE, AS_INT, redalive_stat);
addstat(STAT_BLUEALIVE, AS_INT, bluealive_stat);
float freezetag_CheckWinner()
{
+ entity e;
+ if(round_handler_GetTimeLeft() <= 0)
+ {
+ FOR_EACH_REALCLIENT(e)
+ centerprint(e, "Round over, there's no winner");
+ bprint("Round over, there's no winner.\n");
+ return 1;
+ }
+
if(FREEZETAG_ALIVE_TEAMS() > 1)
return 0;
- entity e;
float winner_team;
string teamname;
winner_team = freezetag_getWinnerTeam();
FOR_EACH_REALCLIENT(e)
Send_CSQC_Centerprint_Generic(e, CPID_ROUND_STARTING, "^1Begin!", 1, 0);
self.cnt = 0;
+ self.round_endtime = time + self.round_timelimit;
self.nextthink = time;
return;
}
}
}
-void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, float the_delay, float the_count)
+void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, float the_delay, float the_count, float the_round_timelimit)
{
if(round_handler)
{
round_handler.count = fabs(floor(the_count));
round_handler.wait = FALSE;
round_handler.cnt = round_handler.count + 1;
+ round_handler.round_timelimit = the_round_timelimit;
round_handler.nextthink = max(time, game_starttime + 1);
}
return (!round_handler.wait && !round_handler.cnt);
}
+float round_handler_GetTimeLeft()
+{
+ return (round_handler.round_endtime - time);
+}
+
void round_handler_Reset(float next_think)
{
entity e;
.float wait; // it's set to TRUE when round ends, to FALSE when countdown starts
.float cnt; // its initial value is .count + 1, then decreased while counting down
// reaches 0 when the round starts
+.float round_timelimit;
+.float round_endtime;
.float() canRoundStart;
.float() canRoundEnd;
-void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, float the_delay, float the_count);
+void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, float the_delay, float the_count, float the_round_timelimit);
float round_handler_IsActive();
float round_handler_AwaitingNextRound();
float round_handler_CountdownRunning();
float round_handler_IsRoundStarted();
+float round_handler_GetTimeLeft();
void round_handler_Reset(float next_think);
void round_handler_Remove();