void nades_Clear(entity);
void nades_GiveBonus(entity player, float score);
+entity freezetag_LastPlayer(float tm)
+{
+ entity last_pl = NULL;
+ FOREACH_CLIENT(IS_PLAYER(it) && it.team == tm, {
+ if (STAT(FROZEN, it) != FROZEN_NORMAL && GetResource(it, RES_HEALTH) >= 1)
+ {
+ if (!last_pl)
+ last_pl = it;
+ else
+ return NULL;
+ }
+ });
+ return last_pl;
+}
+
bool freezetag_CheckWinner()
{
if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_ROUND_OVER);
+
FOREACH_CLIENT(IS_PLAYER(it), {
it.freezetag_frozen_timeout = 0;
it.freezetag_revive_time = 0;
nades_Clear(it);
});
- game_stopped = true;
+ if(autocvar_g_freezetag_round_stop)
+ game_stopped = true;
round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
return true;
}
int winner_team = freezetag_getWinnerTeam();
if(winner_team > 0)
{
- Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
+ entity last_pl = freezetag_LastPlayer(winner_team);
+ if(last_pl) {
+ Give_Medal(last_pl, DEFENSE);
+ }
+
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_SCORES));
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_SCORES));
+ if(fragsleft > 1) Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, APP_TEAM_NUM(winner_team, ANNCE_ROUND_TEAM_WIN));
TeamScore_AddToTeam(winner_team, ST_FT_ROUNDS, +1);
}
else if(winner_team == -1)
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_ROUND_TIED);
}
FOREACH_CLIENT(IS_PLAYER(it), {
nades_Clear(it);
});
- game_stopped = true;
+ if(autocvar_g_freezetag_round_stop)
+ game_stopped = true;
round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
return true;
}
if(round_handler_IsRoundStarted())
{
entity pl = freezetag_LastPlayerForTeam(this);
- if(pl)
+ if(pl) {
Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_ALONE);
+ Send_Notification(NOTIF_ONE, pl, MSG_ANNCE, ANNCE_ALONE);
+ }
}
}
{
FOREACH_CLIENT(IS_PLAYER(it), {
CS(it).killcount = 0;
- it.freezetag_revive_time = 0;
- it.freezetag_frozen_timeout = -1;
- PutClientInServer(it);
+
+ if(autocvar_g_freezetag_round_respawn) {
+ it.freezetag_frozen_timeout = -1;
+ PutClientInServer(it);
+ } else {
+ ResetPlayerResources(it);
+ }
+
it.freezetag_frozen_timeout = 0;
});
freezetag_count_alive_players();
{
entity targ = M_ARGV(0, entity);
targ.freezetag_frozen_time = 0;
+
+ if(autocvar_g_freezetag_revive_respawn) {
+ targ.freezetag_frozen_timeout = -1;
+ PutClientInServer(targ);
+ }
+
targ.freezetag_frozen_timeout = 0;
}
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, first.netname);
Send_Notification(NOTIF_ONE, first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, first.netname);
+ Give_Medal(first, ASSIST);
}
for(entity it = reviving_players_first; it; it = it.chain)