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