]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Implemented Capture medal (CTF)
authorz411 <z411@omaera.org>
Wed, 11 Nov 2020 06:37:09 +0000 (03:37 -0300)
committerz411 <z411@omaera.org>
Wed, 11 Nov 2020 06:37:09 +0000 (03:37 -0300)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/notifications/all.inc
qcsrc/common/notifications/all.qc
qcsrc/common/scores.qh

index 43df946cf7c98c90b4ae38fd28920f02a65b3148..2391ceadcf17c99de3fe58bf4b9b3f63f1b6bf6f 100644 (file)
@@ -1524,6 +1524,7 @@ vector Scoreboard_MedalStats_Draw(vector pos)
        
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/accuracy",           height, pl.(scores(SP_MEDAL_ACCURACY)));
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/assist",             height, pl.(scores(SP_MEDAL_ASSIST)));
+       pos = Scoreboard_DrawMedal(pos, "gfx/medal/capture",            height, pl.(scores(SP_MEDAL_CAPTURE)));
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/defense",            height, pl.(scores(SP_MEDAL_DEFENSE)));
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/perfect",            height, pl.(scores(SP_MEDAL_PERFECT)));
        
index f285d6270305a1dd50eb821a39303f43fb2cde73..9602a16d58440751ede914680c6957e88ac34c70 100644 (file)
@@ -611,6 +611,8 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype)
        if(!old_time || new_time < old_time)
                GameRules_scoring_add(player, CTF_CAPTIME, new_time - old_time);
        
+       Give_Medal(player, CAPTURE);
+       
        // announcer
        WinningConditionHelper(NULL);
        if (Score_NewLeader())
@@ -2268,6 +2270,7 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerDies)
                        // Killing an enemy flag carrier
                        GameRules_scoring_add_team(frag_attacker, SCORE, ((SAME_TEAM(frag_attacker, frag_target)) ? -autocvar_g_ctf_score_kill : autocvar_g_ctf_score_kill));
                        GameRules_scoring_add(frag_attacker, CTF_FCKILLS, 1);
+               } else if(frag_attacker.flagcarried) {
                        Give_Medal(frag_attacker, DEFENSE);
                } else {
                        entity tmp_entity;
index 9bbf7fac728be6d1f9db39fc5acabb7c87a1c13f..db42a40a2ac86e6970b3b90fd8d981adf0d2e82d 100644 (file)
        MSG_MEDAL_NOTIF(IMPRESSIVE, N__ALWAYS,     "impressive",    ANNCE_ACHIEVEMENT_IMPRESSIVE)
        MSG_MEDAL_NOTIF(YODA, N__ALWAYS,           "yoda",          ANNCE_ACHIEVEMENT_YODA)
        
+       MSG_MEDAL_NOTIF(CAPTURE, N__ALWAYS,        "capture",       NULL)
        MSG_MEDAL_NOTIF(PERFECT, N__ALWAYS,        "perfect",       ANNCE_ACHIEVEMENT_PERFECT)
        MSG_MEDAL_NOTIF(ACCURACY, N__ALWAYS,       "accuracy",      ANNCE_ACHIEVEMENT_ACCURACY)
        
index cc031b60aa8b6cc5585e277ad018f49ebbb53797..88f0a4ad020db4895efffdd58bfa8be7e9d048bd 100644 (file)
@@ -1236,7 +1236,12 @@ void Local_Notification_Queue_Run(MSG net_type, entity notif, float f1)
                case MSG_MEDAL:
                {
                        centerprint_Medal(notif.nent_icon, f1);
-                       Local_Notification_sound(notif.nent_msgannce.nent_channel, notif.nent_msgannce.nent_snd, notif.nent_msgannce.nent_vol, notif.nent_msgannce.nent_position);
+                       if(notif.nent_msgannce)
+                               Local_Notification_sound(
+                                       notif.nent_msgannce.nent_channel,
+                                       notif.nent_msgannce.nent_snd,
+                                       notif.nent_msgannce.nent_vol,
+                                       notif.nent_msgannce.nent_position);
                        break;
                }
        }
@@ -1480,7 +1485,7 @@ void Local_Notification(MSG net_type, Notification net_name, ...count)
                        Local_Notification_Queue_Add(
                                net_type,
                                notif,
-                               MSG_MEDAL_TIME,
+                               (notif.nent_msgannce ? MSG_MEDAL_TIME : 0),
                                f1);
                        break;
                }
index b40378d18099864b9835be0da6d59ca4711f444f..669af3d27c7b5b1f94e79da66081ec516e0780a5 100644 (file)
@@ -98,6 +98,7 @@ REGISTER_SP(MEDAL_YODA);
 
 REGISTER_SP(MEDAL_ACCURACY);
 REGISTER_SP(MEDAL_ASSIST);
+REGISTER_SP(MEDAL_CAPTURE);
 REGISTER_SP(MEDAL_DEFENSE);
 REGISTER_SP(MEDAL_PERFECT);