]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added new CTF relative announcers
authorz411 <z411@omaera.org>
Tue, 9 Mar 2021 05:57:23 +0000 (02:57 -0300)
committerz411 <z411@omaera.org>
Tue, 9 Mar 2021 05:57:23 +0000 (02:57 -0300)
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
qcsrc/common/notifications/all.inc
qcsrc/server/world.qc

index 728a5ee16341a9ae9eba496d6a54a21881a36610..eef845fb7354922bcffa8c119df2f9e57ee7f16c 100644 (file)
@@ -614,11 +614,7 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype)
        Give_Medal(player, CAPTURE);
        
        // announcer
-       WinningConditionHelper(NULL);
-       if (Score_NewLeader())
-               AnnounceNewLeader();
-       else
-               Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, APP_TEAM_NUM(player.team, ANNCE_TEAM_SCORES));
+       AnnounceScores(player.team);
 
        // effects
        Send_Effect_(flag.capeffect, flag.origin, '0 0 0', 1);
@@ -657,6 +653,14 @@ void ctf_Handle_Return(entity flag, entity player)
        {
                Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_NUM(flag.team, CENTER_CTF_RETURN));
                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(flag.team, INFO_CTF_RETURN), player.netname);
+               
+               FOREACH_CLIENT(IS_PLAYER(it), {
+                       if(it.team == flag.team)
+                               Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_CTF_RETURN_TEAM);
+                       else
+                               Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_CTF_RETURN_ENEMY);
+               });
+               Send_Notification(NOTIF_ALL_SPEC, NULL, MSG_ANNCE, APP_TEAM_NUM(flag.team, ANNCE_CTF_RETURN));
        }
        _sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTEN_NONE);
        ctf_EventLog("return", flag.team, player);
@@ -726,7 +730,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
 
        // messages and sounds
        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_NUM(flag.team, INFO_CTF_PICKUP), player.netname);
-       Send_Notification(NOTIF_ALL_SPEC, NULL, MSG_ANNCE, APP_TEAM_NUM(flag.team, ANNCE_CTF_SPEC_PICKUP));
+       Send_Notification(NOTIF_ALL_SPEC, NULL, MSG_ANNCE, APP_TEAM_NUM(flag.team, ANNCE_CTF_PICKUP));
        
        if(ctf_stalemate)
                Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER);
@@ -735,7 +739,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
        else if(CTF_DIFFTEAM(player, flag))
        {
                Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_NUM(flag.team, CENTER_CTF_PICKUP));
-               Send_Notification(NOTIF_ONE_ONLY, player, MSG_ANNCE, ANNCE_CTF_PICKUP);
+               Send_Notification(NOTIF_ONE_ONLY, player, MSG_ANNCE, ANNCE_CTF_PICKUP_YOU);
        }
        else
                Send_Notification(NOTIF_ONE, player, MSG_CENTER, ((SAME_TEAM(player, flag)) ? CENTER_CTF_PICKUP_RETURN : CENTER_CTF_PICKUP_RETURN_ENEMY), Team_ColorCode(flag.team));
index fee45755df403349017ef28d1163f86059885f72..5eb256320336d994e0d99c9ac7908141ee5ed472 100644 (file)
@@ -155,8 +155,8 @@ bool freezetag_CheckWinner()
        
                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);
+               if(fragsleft > 1) AnnounceScores(winner_team);
        }
        else if(winner_team == -1)
        {
index efa3d03da6a14d2748f06c9a3a01b63a331b5c00..94965fc2dfcd8a2b6b955a53dbba2b43f66671fb 100644 (file)
        MSG_ANNCE_NOTIF(LEAD_TIED,                  N__ALWAYS, "leadtied",          CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
        
        MULTITEAM_ANNCE(ROUND_TEAM_WIN,                         N__ALWAYS, "round_win_%s",              CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       
+       MSG_ANNCE_NOTIF(TEAM_SCORES_TEAM,                       N__ALWAYS, "scores_team",               CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       MSG_ANNCE_NOTIF(TEAM_SCORES_ENEMY,                      N__ALWAYS, "scores_enemy",              CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
        MULTITEAM_ANNCE(TEAM_SCORES,                            N__ALWAYS, "scores_%s",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       
+       MSG_ANNCE_NOTIF(TEAM_LEADS_TEAM,                        N__ALWAYS, "leads_team",                CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       MSG_ANNCE_NOTIF(TEAM_LEADS_ENEMY,                       N__ALWAYS, "leads_enemy",               CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       MULTITEAM_ANNCE(TEAM_LEADS,                                     N__ALWAYS, "leads_%s",                  CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       
        MULTITEAM_ANNCE(TEAM_WINS,                                      N__ALWAYS, "wins_%s",                   CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
-       MULTITEAM_ANNCE(TEAM_LEADS,                                     N__ALWAYS, "%steamtakeslead",   CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
-       MSG_ANNCE_NOTIF(TEAM_LEADS_TIED,            N__ALWAYS, "teamstied",        CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       
+       MSG_ANNCE_NOTIF(TEAM_LEADS_TIED,            N__ALWAYS, "teamstied",         CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
        MSG_ANNCE_NOTIF(ROUND_OVER,                 N__ALWAYS, "round_over",        CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
        MSG_ANNCE_NOTIF(ROUND_TIED,                 N__ALWAYS, "round_tied",        CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
        MSG_ANNCE_NOTIF(ALONE,                      N__ALWAYS, "alone",             CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
        
-       MSG_ANNCE_NOTIF(CTF_PICKUP,                 N__ALWAYS, "ctf_pickup",        CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       MSG_ANNCE_NOTIF(CTF_PICKUP_YOU,             N__ALWAYS, "ctf_pickup_you",    CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
        MSG_ANNCE_NOTIF(CTF_PICKUP_TEAM,            N__ALWAYS, "ctf_pickup_team",   CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
        MSG_ANNCE_NOTIF(CTF_PICKUP_ENEMY,           N__ALWAYS, "ctf_pickup_enemy",  CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
-       MULTITEAM_ANNCE(CTF_SPEC_PICKUP,                        N__ALWAYS, "ctf_spec_pickup_%s",CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       MULTITEAM_ANNCE(CTF_PICKUP,                                     N__ALWAYS, "ctf_pickup_%s",             CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       
+       MSG_ANNCE_NOTIF(CTF_RETURN_TEAM,            N__ALWAYS, "ctf_return_team",   CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       MSG_ANNCE_NOTIF(CTF_RETURN_ENEMY,           N__ALWAYS, "ctf_return_enemy",  CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       MULTITEAM_ANNCE(CTF_RETURN,                                     N__ALWAYS, "ctf_return_%s",             CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
 
 // MSG_MEDAL_NOTIFICATIONS
 
index 84586cb73f1723a7a44fad1a42fc1d4f98729f90..703cd15b92e006857420195c038a2ed564a90103 100644 (file)
@@ -1451,7 +1451,13 @@ void AnnounceNewLeader()
                if (WinningConditionHelper_equality)
                        Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_TEAM_LEADS_TIED);
                else
-                       Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, APP_TEAM_NUM(WinningConditionHelper_winnerteam, ANNCE_TEAM_LEADS));
+                       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)
                {
@@ -1466,6 +1472,22 @@ void AnnounceNewLeader()
        }
 }
 
+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));
+       }
+}
+
 float WinningCondition_Scores(float limit, float leadlimit)
 {
        // TODO make everything use THIS winning condition (except LMS)