From: LegendaryGuard Date: Thu, 15 Apr 2021 00:46:10 +0000 (+0200) Subject: Merge branch 'master' into LegendaryGuard/bai_mod X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b9f78517543c59e2b1feb1ff086cd9b41f876178;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into LegendaryGuard/bai_mod --- diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 4dbf79199..6f9591e5b 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -1429,6 +1429,51 @@ void ClearWinners() FOREACH_CLIENT(IS_PLAYER(it), { it.winning = 0; }); } +//z411 +void AnnounceNewLeader() +{ + if(teamplay) { + if (WinningConditionHelper_equality) + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_TEAM_LEADS_TIED); + else + FOREACH_CLIENT(IS_PLAYER(it), { + if(it.team == WinningConditionHelper_winnerteam) + Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_TEAM_LEADS_TEAM); + else + Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_TEAM_LEADS_ENEMY); + }); + Send_Notification(NOTIF_ALL_SPEC, NULL, MSG_ANNCE, APP_TEAM_NUM(WinningConditionHelper_winnerteam, ANNCE_TEAM_LEADS)); + } else { + if (WinningConditionHelper_equality) + { + Send_Notification(NOTIF_ONE, WinningConditionHelper_equality_one, MSG_ANNCE, ANNCE_LEAD_TIED); + Send_Notification(NOTIF_ONE, WinningConditionHelper_equality_two, MSG_ANNCE, ANNCE_LEAD_TIED); + } + else + { + Send_Notification(NOTIF_ONE, WinningConditionHelper_winner, MSG_ANNCE, ANNCE_LEAD_GAINED); + Send_Notification(NOTIF_ONE, WinningConditionHelper_second, MSG_ANNCE, ANNCE_LEAD_LOST); + } + } +} + +//z411 +void AnnounceScores(float tm) +{ + WinningConditionHelper(NULL); + if (Score_NewLeader()) { + AnnounceNewLeader(); + } else { + FOREACH_CLIENT(IS_PLAYER(it), { + if(it.team == tm) + Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_TEAM_SCORES_TEAM); + else + Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_TEAM_SCORES_ENEMY); + }); + Send_Notification(NOTIF_ALL_SPEC, NULL, MSG_ANNCE, APP_TEAM_NUM(tm, ANNCE_TEAM_SCORES)); + } +} + int fragsleft_last; float WinningCondition_Scores(float limit, float leadlimit) {