Merge branch 'master' into terencehill/bot_ai
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / freezetag / freezetag.qc
1 #include "freezetag.qh"
2
3 // TODO: sv_freezetag
4 #ifdef SVQC
5 float autocvar_g_freezetag_frozen_maxtime;
6 float autocvar_g_freezetag_revive_clearspeed;
7 float autocvar_g_freezetag_round_timelimit;
8 //int autocvar_g_freezetag_teams;
9 int autocvar_g_freezetag_teams_override;
10 float autocvar_g_freezetag_warmup;
11
12 void freezetag_count_alive_players()
13 {
14         total_players = redalive = bluealive = yellowalive = pinkalive = 0;
15         FOREACH_CLIENT(IS_PLAYER(it), {
16                 switch(it.team)
17                 {
18                         case NUM_TEAM_1: ++total_players; if(it.health >= 1 && STAT(FROZEN, it) != 1) ++redalive; break;
19                         case NUM_TEAM_2: ++total_players; if(it.health >= 1 && STAT(FROZEN, it) != 1) ++bluealive; break;
20                         case NUM_TEAM_3: ++total_players; if(it.health >= 1 && STAT(FROZEN, it) != 1) ++yellowalive; break;
21                         case NUM_TEAM_4: ++total_players; if(it.health >= 1 && STAT(FROZEN, it) != 1) ++pinkalive; break;
22                 }
23         });
24         FOREACH_CLIENT(IS_REAL_CLIENT(it), {
25                 STAT(REDALIVE, it) = redalive;
26                 STAT(BLUEALIVE, it) = bluealive;
27                 STAT(YELLOWALIVE, it) = yellowalive;
28                 STAT(PINKALIVE, it) = pinkalive;
29         });
30
31         eliminatedPlayers.SendFlags |= 1;
32 }
33 #define FREEZETAG_ALIVE_TEAMS() ((redalive > 0) + (bluealive > 0) + (yellowalive > 0) + (pinkalive > 0))
34 #define FREEZETAG_ALIVE_TEAMS_OK() (FREEZETAG_ALIVE_TEAMS() == NumTeams(freezetag_teams))
35
36 float freezetag_CheckTeams()
37 {
38         static float prev_missing_teams_mask;
39         if(FREEZETAG_ALIVE_TEAMS_OK())
40         {
41                 if(prev_missing_teams_mask > 0)
42                         Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
43                 prev_missing_teams_mask = -1;
44                 return 1;
45         }
46         if(total_players == 0)
47         {
48                 if(prev_missing_teams_mask > 0)
49                         Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
50                 prev_missing_teams_mask = -1;
51                 return 0;
52         }
53         int missing_teams_mask = 0;
54         if(freezetag_teams & BIT(0))
55                 missing_teams_mask += (!redalive) * 1;
56         if(freezetag_teams & BIT(1))
57                 missing_teams_mask += (!bluealive) * 2;
58         if(freezetag_teams & BIT(2))
59                 missing_teams_mask += (!yellowalive) * 4;
60         if(freezetag_teams & BIT(3))
61                 missing_teams_mask += (!pinkalive) * 8;
62         if(prev_missing_teams_mask != missing_teams_mask)
63         {
64                 Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
65                 prev_missing_teams_mask = missing_teams_mask;
66         }
67         return 0;
68 }
69
70 float freezetag_getWinnerTeam()
71 {
72         float winner_team = 0;
73         if(redalive >= 1)
74                 winner_team = NUM_TEAM_1;
75         if(bluealive >= 1)
76         {
77                 if(winner_team) return 0;
78                 winner_team = NUM_TEAM_2;
79         }
80         if(yellowalive >= 1)
81         {
82                 if(winner_team) return 0;
83                 winner_team = NUM_TEAM_3;
84         }
85         if(pinkalive >= 1)
86         {
87                 if(winner_team) return 0;
88                 winner_team = NUM_TEAM_4;
89         }
90         if(winner_team)
91                 return winner_team;
92         return -1; // no player left
93 }
94
95 void nades_Clear(entity);
96 void nades_GiveBonus(entity player, float score);
97
98 float freezetag_CheckWinner()
99 {
100         if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
101         {
102                 Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
103                 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
104                 FOREACH_CLIENT(IS_PLAYER(it), {
105                         it.freezetag_frozen_timeout = 0;
106                         nades_Clear(it);
107                 });
108                 game_stopped = true;
109                 round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
110                 return 1;
111         }
112
113         if(FREEZETAG_ALIVE_TEAMS() > 1)
114                 return 0;
115
116         int winner_team = freezetag_getWinnerTeam();
117         if(winner_team > 0)
118         {
119                 Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
120                 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
121                 TeamScore_AddToTeam(winner_team, ST_SCORE, +1);
122         }
123         else if(winner_team == -1)
124         {
125                 Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
126                 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
127         }
128
129         FOREACH_CLIENT(IS_PLAYER(it), {
130                 it.freezetag_frozen_timeout = 0;
131                 nades_Clear(it);
132         });
133
134         game_stopped = true;
135         round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
136         return 1;
137 }
138
139 entity freezetag_LastPlayerForTeam(entity this)
140 {
141         entity last_pl = NULL;
142         FOREACH_CLIENT(IS_PLAYER(it) && it != this, {
143                 if(it.health >= 1)
144                 if(!STAT(FROZEN, it))
145                 if(SAME_TEAM(it, this))
146                 if(!last_pl)
147                         last_pl = it;
148                 else
149                         return NULL;
150         });
151         return last_pl;
152 }
153
154 void freezetag_LastPlayerForTeam_Notify(entity this)
155 {
156         if(round_handler_IsActive())
157         if(round_handler_IsRoundStarted())
158         {
159                 entity pl = freezetag_LastPlayerForTeam(this);
160                 if(pl)
161                         Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_ALONE);
162         }
163 }
164
165 void freezetag_Add_Score(entity targ, entity attacker)
166 {
167         if(attacker == targ)
168         {
169                 // you froze your own dumb targ
170                 // counted as "suicide" already
171                 GameRules_scoring_add(targ, SCORE, -1);
172         }
173         else if(IS_PLAYER(attacker))
174         {
175                 // got frozen by an enemy
176                 // counted as "kill" and "death" already
177                 GameRules_scoring_add(targ, SCORE, -1);
178                 GameRules_scoring_add(attacker, SCORE, +1);
179         }
180         // else nothing - got frozen by the game type rules themselves
181 }
182
183 void freezetag_Freeze(entity targ, entity attacker)
184 {
185         if(STAT(FROZEN, targ))
186                 return;
187
188         if(autocvar_g_freezetag_frozen_maxtime > 0)
189                 targ.freezetag_frozen_timeout = time + autocvar_g_freezetag_frozen_maxtime;
190
191         Freeze(targ, 0, 1, true);
192
193         freezetag_count_alive_players();
194
195         freezetag_Add_Score(targ, attacker);
196 }
197
198 void freezetag_Unfreeze(entity this)
199 {
200         this.freezetag_frozen_time = 0;
201         this.freezetag_frozen_timeout = 0;
202
203         Unfreeze(this);
204 }
205
206 float freezetag_isEliminated(entity e)
207 {
208         if(IS_PLAYER(e) && (STAT(FROZEN, e) == 1 || IS_DEAD(e)))
209                 return true;
210         return false;
211 }
212
213
214 // ================
215 // Bot player logic
216 // ================
217
218 void(entity this) havocbot_role_ft_freeing;
219 void(entity this) havocbot_role_ft_offense;
220
221 void havocbot_goalrating_freeplayers(entity this, float ratingscale, vector org, float sradius)
222 {
223         float t;
224         FOREACH_CLIENT(IS_PLAYER(it) && it != this && SAME_TEAM(it, this), {
225                 if (STAT(FROZEN, it) == 1)
226                 {
227                         if(vdist(it.origin - org, >, sradius))
228                                 continue;
229                         navigation_routerating(this, it, ratingscale, 2000);
230                 }
231                 else if(vdist(it.origin - org, >, 400)) // avoid gathering all teammates in one place
232                 {
233                         // If teamate is not frozen still seek them out as fight better
234                         // in a group.
235                         t = 0.2 * 150 / (this.health + this.armorvalue);
236                         navigation_routerating(this, it, t * ratingscale, 2000);
237                 }
238         });
239 }
240
241 void havocbot_role_ft_offense(entity this)
242 {
243         if(IS_DEAD(this))
244                 return;
245
246         if (!this.havocbot_role_timeout)
247                 this.havocbot_role_timeout = time + random() * 10 + 20;
248
249         // Count how many players on team are unfrozen.
250         int unfrozen = 0;
251         FOREACH_CLIENT(IS_PLAYER(it) && SAME_TEAM(it, this) && !(STAT(FROZEN, it) != 1), { unfrozen++; });
252
253         // If only one left on team or if role has timed out then start trying to free players.
254         if (((unfrozen == 0) && (!STAT(FROZEN, this))) || (time > this.havocbot_role_timeout))
255         {
256                 LOG_TRACE("changing role to freeing");
257                 this.havocbot_role = havocbot_role_ft_freeing;
258                 this.havocbot_role_timeout = 0;
259                 return;
260         }
261
262         if (navigation_goalrating_timeout(this))
263         {
264                 navigation_goalrating_start(this);
265                 havocbot_goalrating_items(this, 10000, this.origin, 10000);
266                 havocbot_goalrating_enemyplayers(this, 10000, this.origin, 10000);
267                 havocbot_goalrating_freeplayers(this, 9000, this.origin, 10000);
268                 havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
269                 navigation_goalrating_end(this);
270
271                 navigation_goalrating_timeout_set(this);
272         }
273 }
274
275 void havocbot_role_ft_freeing(entity this)
276 {
277         if(IS_DEAD(this))
278                 return;
279
280         if (!this.havocbot_role_timeout)
281                 this.havocbot_role_timeout = time + random() * 10 + 20;
282
283         if (time > this.havocbot_role_timeout)
284         {
285                 LOG_TRACE("changing role to offense");
286                 this.havocbot_role = havocbot_role_ft_offense;
287                 this.havocbot_role_timeout = 0;
288                 return;
289         }
290
291         if (navigation_goalrating_timeout(this))
292         {
293                 navigation_goalrating_start(this);
294                 havocbot_goalrating_items(this, 8000, this.origin, 10000);
295                 havocbot_goalrating_enemyplayers(this, 5000, this.origin, 10000);
296                 havocbot_goalrating_freeplayers(this, 20000, this.origin, 10000);
297                 havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
298                 navigation_goalrating_end(this);
299
300                 navigation_goalrating_timeout_set(this);
301         }
302 }
303
304
305 // ==============
306 // Hook Functions
307 // ==============
308
309 void ft_RemovePlayer(entity this)
310 {
311         this.health = 0; // neccessary to update correctly alive stats
312         if(!STAT(FROZEN, this))
313                 freezetag_LastPlayerForTeam_Notify(this);
314         freezetag_Unfreeze(this);
315         freezetag_count_alive_players();
316 }
317
318 MUTATOR_HOOKFUNCTION(ft, ClientDisconnect)
319 {
320         entity player = M_ARGV(0, entity);
321
322         ft_RemovePlayer(player);
323         return true;
324 }
325
326 MUTATOR_HOOKFUNCTION(ft, MakePlayerObserver)
327 {
328         entity player = M_ARGV(0, entity);
329
330         ft_RemovePlayer(player);
331 }
332
333 MUTATOR_HOOKFUNCTION(ft, PlayerDies)
334 {
335         entity frag_attacker = M_ARGV(1, entity);
336         entity frag_target = M_ARGV(2, entity);
337         float frag_deathtype = M_ARGV(3, float);
338
339         if(round_handler_IsActive())
340         if(round_handler_CountdownRunning())
341         {
342                 if(STAT(FROZEN, frag_target))
343                         freezetag_Unfreeze(frag_target);
344                 freezetag_count_alive_players();
345                 return true; // let the player die so that he can respawn whenever he wants
346         }
347
348         // Cases DEATH_TEAMCHANGE and DEATH_AUTOTEAMCHANGE are needed to fix a bug whe
349         // you succeed changing team through the menu: you both really die (gibbing) and get frozen
350         if(ITEM_DAMAGE_NEEDKILL(frag_deathtype)
351                 || frag_deathtype == DEATH_TEAMCHANGE.m_id || frag_deathtype == DEATH_AUTOTEAMCHANGE.m_id)
352         {
353                 // let the player die, he will be automatically frozen when he respawns
354                 if(STAT(FROZEN, frag_target) != 1)
355                 {
356                         freezetag_Add_Score(frag_target, frag_attacker);
357                         freezetag_count_alive_players();
358                         freezetag_LastPlayerForTeam_Notify(frag_target);
359                 }
360                 else
361                         freezetag_Unfreeze(frag_target); // remove ice
362                 frag_target.health = 0; // Unfreeze resets health
363                 frag_target.freezetag_frozen_timeout = -2; // freeze on respawn
364                 return true;
365         }
366
367         if(STAT(FROZEN, frag_target))
368                 return true;
369
370         freezetag_Freeze(frag_target, frag_attacker);
371         freezetag_LastPlayerForTeam_Notify(frag_target);
372
373         if(frag_attacker == frag_target || frag_attacker == NULL)
374         {
375                 if(IS_PLAYER(frag_target))
376                         Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_SELF);
377                 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_SELF, frag_target.netname);
378         }
379         else
380         {
381                 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_FREEZE, frag_target.netname, frag_attacker.netname);
382         }
383
384         return true;
385 }
386
387 MUTATOR_HOOKFUNCTION(ft, PlayerSpawn)
388 {
389         entity player = M_ARGV(0, entity);
390
391         if(player.freezetag_frozen_timeout == -1) // if PlayerSpawn is called by reset_map_players
392                 return true; // do nothing, round is starting right now
393
394         if(player.freezetag_frozen_timeout == -2) // player was dead
395         {
396                 freezetag_Freeze(player, NULL);
397                 return true;
398         }
399
400         freezetag_count_alive_players();
401
402         if(round_handler_IsActive())
403         if(round_handler_IsRoundStarted())
404         {
405                 Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_SPAWN_LATE);
406                 freezetag_Freeze(player, NULL);
407         }
408
409         return true;
410 }
411
412 MUTATOR_HOOKFUNCTION(ft, reset_map_players)
413 {
414         FOREACH_CLIENT(IS_PLAYER(it), {
415                 CS(it).killcount = 0;
416                 it.freezetag_frozen_timeout = -1;
417                 PutClientInServer(it);
418                 it.freezetag_frozen_timeout = 0;
419         });
420         freezetag_count_alive_players();
421         return true;
422 }
423
424 MUTATOR_HOOKFUNCTION(ft, GiveFragsForKill, CBC_ORDER_FIRST)
425 {
426         M_ARGV(2, float) = 0; // no frags counted in Freeze Tag
427         return true;
428 }
429
430 MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
431 {
432         if(game_stopped)
433                 return true;
434
435         if(round_handler_IsActive())
436         if(!round_handler_IsRoundStarted())
437                 return true;
438
439         int n;
440         entity o = NULL;
441         entity player = M_ARGV(0, entity);
442         //if(STAT(FROZEN, player))
443         //if(player.freezetag_frozen_timeout > 0 && time < player.freezetag_frozen_timeout)
444                 //player.iceblock.alpha = ICE_MIN_ALPHA + (ICE_MAX_ALPHA - ICE_MIN_ALPHA) * (player.freezetag_frozen_timeout - time) / (player.freezetag_frozen_timeout - player.freezetag_frozen_time);
445
446         if(player.freezetag_frozen_timeout > 0 && time >= player.freezetag_frozen_timeout)
447                 n = -1;
448         else
449         {
450                 vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
451                 n = 0;
452                 FOREACH_CLIENT(IS_PLAYER(it) && it != player, {
453                         if(STAT(FROZEN, it) == 0)
454                         if(!IS_DEAD(it))
455                         if(SAME_TEAM(it, player))
456                         if(boxesoverlap(player.absmin - revive_extra_size, player.absmax + revive_extra_size, it.absmin, it.absmax))
457                         {
458                                 if(!o)
459                                         o = it;
460                                 if(STAT(FROZEN, player) == 1)
461                                         it.reviving = true;
462                                 ++n;
463                         }
464                 });
465
466         }
467
468         if(n && STAT(FROZEN, player) == 1) // OK, there is at least one teammate reviving us
469         {
470                 STAT(REVIVE_PROGRESS, player) = bound(0, STAT(REVIVE_PROGRESS, player) + frametime * max(1/60, autocvar_g_freezetag_revive_speed), 1);
471                 player.health = max(1, STAT(REVIVE_PROGRESS, player) * ((warmup_stage) ? warmup_start_health : start_health));
472
473                 if(STAT(REVIVE_PROGRESS, player) >= 1)
474                 {
475                         freezetag_Unfreeze(player);
476                         freezetag_count_alive_players();
477
478                         if(n == -1)
479                         {
480                                 Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_AUTO_REVIVED, autocvar_g_freezetag_frozen_maxtime);
481                                 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_AUTO_REVIVED, player.netname, autocvar_g_freezetag_frozen_maxtime);
482                                 return true;
483                         }
484
485                         // EVERY team mate nearby gets a point (even if multiple!)
486                         FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, {
487                                 GameRules_scoring_add(it, FREEZETAG_REVIVALS, +1);
488                                 GameRules_scoring_add(it, SCORE, +1);
489                                 nades_GiveBonus(it,autocvar_g_nades_bonus_score_low);
490                         });
491
492                         Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, o.netname);
493                         Send_Notification(NOTIF_ONE, o, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
494                         Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, o.netname);
495                 }
496
497                 FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, {
498                         STAT(REVIVE_PROGRESS, it) = STAT(REVIVE_PROGRESS, player);
499                         it.reviving = false;
500                 });
501         }
502         else if(!n && STAT(FROZEN, player) == 1) // only if no teammate is nearby will we reset
503         {
504                 STAT(REVIVE_PROGRESS, player) = bound(0, STAT(REVIVE_PROGRESS, player) - frametime * autocvar_g_freezetag_revive_clearspeed, 1);
505                 player.health = max(1, STAT(REVIVE_PROGRESS, player) * ((warmup_stage) ? warmup_start_health : start_health));
506         }
507         else if(!n && !STAT(FROZEN, player))
508         {
509                 STAT(REVIVE_PROGRESS, player) = 0; // thawing nobody
510         }
511
512         return true;
513 }
514
515 MUTATOR_HOOKFUNCTION(ft, SetStartItems)
516 {
517         start_items &= ~IT_UNLIMITED_AMMO;
518         //start_health       = warmup_start_health       = cvar("g_lms_start_health");
519         //start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
520         start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
521         start_ammo_nails   = warmup_start_ammo_nails   = cvar("g_lms_start_ammo_nails");
522         start_ammo_rockets = warmup_start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
523         start_ammo_cells   = warmup_start_ammo_cells   = cvar("g_lms_start_ammo_cells");
524         start_ammo_plasma  = warmup_start_ammo_plasma  = cvar("g_lms_start_ammo_plasma");
525         start_ammo_fuel    = warmup_start_ammo_fuel    = cvar("g_lms_start_ammo_fuel");
526 }
527
528 MUTATOR_HOOKFUNCTION(ft, HavocBot_ChooseRole)
529 {
530         entity bot = M_ARGV(0, entity);
531
532         if (!IS_DEAD(bot))
533         {
534                 if (random() < 0.5)
535                         bot.havocbot_role = havocbot_role_ft_freeing;
536                 else
537                         bot.havocbot_role = havocbot_role_ft_offense;
538         }
539
540         return true;
541 }
542
543 MUTATOR_HOOKFUNCTION(ft, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
544 {
545         M_ARGV(0, float) = freezetag_teams;
546 }
547
548 MUTATOR_HOOKFUNCTION(ft, SetWeaponArena)
549 {
550         // most weapons arena
551         if(M_ARGV(0, string) == "0" || M_ARGV(0, string) == "")
552                 M_ARGV(0, string) = "most";
553 }
554
555 MUTATOR_HOOKFUNCTION(ft, FragCenterMessage)
556 {
557         entity frag_attacker = M_ARGV(0, entity);
558         entity frag_target = M_ARGV(1, entity);
559         //float frag_deathtype = M_ARGV(2, float);
560         int kill_count_to_attacker = M_ARGV(3, int);
561         int kill_count_to_target = M_ARGV(4, int);
562
563         if(STAT(FROZEN, frag_target))
564                 return; // target was already frozen, so this is just pushing them off the cliff
565
566         Send_Notification(NOTIF_ONE, frag_attacker, MSG_CHOICE, CHOICE_FRAG_FREEZE, frag_target.netname, kill_count_to_attacker, (IS_BOT_CLIENT(frag_target) ? -1 : CS(frag_target).ping));
567         Send_Notification(NOTIF_ONE, frag_target, MSG_CHOICE, CHOICE_FRAGGED_FREEZE, frag_attacker.netname, kill_count_to_target, frag_attacker.health, frag_attacker.armorvalue, (IS_BOT_CLIENT(frag_attacker) ? -1 : CS(frag_attacker).ping));
568
569         return true;
570 }
571
572 void freezetag_Initialize()
573 {
574         freezetag_teams = autocvar_g_freezetag_teams_override;
575         if(freezetag_teams < 2)
576                 freezetag_teams = cvar("g_freezetag_teams"); // read the cvar directly as it gets written earlier in the same frame
577
578         freezetag_teams = BITS(bound(2, freezetag_teams, 4));
579         GameRules_scoring(freezetag_teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
580             field(SP_FREEZETAG_REVIVALS, "revivals", 0);
581         });
582
583         round_handler_Spawn(freezetag_CheckTeams, freezetag_CheckWinner, func_null);
584         round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
585
586         EliminatedPlayers_Init(freezetag_isEliminated);
587 }
588 #endif