]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into LegendaryGuard/bai_mod
authorLegendaryGuard <rootuser999@gmail.com>
Thu, 15 Apr 2021 00:46:10 +0000 (02:46 +0200)
committerLegendaryGuard <rootuser999@gmail.com>
Thu, 15 Apr 2021 00:46:10 +0000 (02:46 +0200)
qcsrc/server/world.qc

index 4dbf79199728c40db6ede0abfbdacc9fb83c6046..6f9591e5bf5886aae57dd66dcf869a0e2e70d4ce 100644 (file)
@@ -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)
 {