]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added Telefrag medal
authorz411 <z411@omaera.org>
Sun, 22 Nov 2020 00:31:54 +0000 (21:31 -0300)
committerz411 <z411@omaera.org>
Sun, 22 Nov 2020 00:31:54 +0000 (21:31 -0300)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc
qcsrc/common/notifications/all.inc
qcsrc/common/scores.qh
qcsrc/server/damage.qc
qcsrc/server/damage.qh

index 2391ceadcf17c99de3fe58bf4b9b3f63f1b6bf6f..9d973bbfa470e74e6cb89c75885be7b3be4f1b18 100644 (file)
@@ -1519,8 +1519,10 @@ vector Scoreboard_MedalStats_Draw(vector pos)
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/humiliation",        height, pl.(scores(SP_MEDAL_HUMILIATION)));
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/impressive",         height, pl.(scores(SP_MEDAL_IMPRESSIVE)));
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/yoda",                       height, pl.(scores(SP_MEDAL_YODA)));
+       pos = Scoreboard_DrawMedal(pos, "gfx/medal/telefrag",           height, pl.(scores(SP_MEDAL_TELEFRAG)));
        
-       pos.x += hud_fontsize.x;
+       if(total_medals)
+               pos.x += hud_fontsize.x;
        
        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)));
index d5ec7521d528f2b4a50d59c890d5f6052383a5cf..c0c39485b1db8ca959ed5188196f51d4db434452 100644 (file)
@@ -111,7 +111,9 @@ float CA_CheckWinner()
        bool perfect = false;
        if(winner_team > 0)
        {
+               entity tm = Team_GetTeam(winner_team);
                entity last_pl = ca_LastPlayer(winner_team);
+               
                if(last_pl && Team_GetNumberOfPlayers(tm) >= 3) {
                        Give_Medal(last_pl, DEFENSE);
                }
@@ -121,8 +123,6 @@ float CA_CheckWinner()
                if(fragsleft > 1) Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, APP_TEAM_NUM(winner_team, ANNCE_ROUND_TEAM_WIN));
                TeamScore_AddToTeam(winner_team, ST_CA_ROUNDS, +1);
                
-               entity tm = Team_GetTeam(winner_team);
-               
                if (Team_GetNumberOfPlayers(tm) >= 3 &&
                        Team_GetNumberOfAlivePlayers(tm) == Team_GetNumberOfPlayers(tm))
                                perfect = true;
index 540a64d611c211962b1a72b15ba4ad2b26f28f53..efa3d03da6a14d2748f06c9a3a01b63a331b5c00 100644 (file)
     MSG_ANNCE_NOTIF(ACHIEVEMENT_YODA,           N_GNTLOFF, "yoda",              CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
        MSG_ANNCE_NOTIF(ACHIEVEMENT_PERFECT,        N_GNTLOFF, "perfect",           CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
        MSG_ANNCE_NOTIF(ACHIEVEMENT_ACCURACY,       N_GNTLOFF, "accuracy",          CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
+       MSG_ANNCE_NOTIF(ACHIEVEMENT_TELEFRAG,       N_GNTLOFF, "telefrag",          CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME)
 
     MSG_ANNCE_NOTIF(BEGIN,                      N__ALWAYS, "begin",             CH_INFO, VOL_BASEVOICE, ATTEN_NONE, -1)
 
        MSG_MEDAL_NOTIF(HUMILIATION, N__ALWAYS,    "humiliation",   ANNCE_HUMILIATION)
        MSG_MEDAL_NOTIF(IMPRESSIVE, N__ALWAYS,     "impressive",    ANNCE_ACHIEVEMENT_IMPRESSIVE)
        MSG_MEDAL_NOTIF(YODA, N__ALWAYS,           "yoda",          ANNCE_ACHIEVEMENT_YODA)
+       MSG_MEDAL_NOTIF(TELEFRAG, N__ALWAYS,       "telefrag",      ANNCE_ACHIEVEMENT_TELEFRAG)
        
        MSG_MEDAL_NOTIF(CAPTURE, N__ALWAYS,        "capture",       NULL)
        MSG_MEDAL_NOTIF(PERFECT, N__ALWAYS,        "perfect",       ANNCE_ACHIEVEMENT_PERFECT)
index 669af3d27c7b5b1f94e79da66081ec516e0780a5..2869541b74679ea65d1eac3fc361c2dfa57150ed 100644 (file)
@@ -95,6 +95,7 @@ REGISTER_SP(MEDAL_HEADSHOT);
 REGISTER_SP(MEDAL_HUMILIATION);
 REGISTER_SP(MEDAL_IMPRESSIVE);
 REGISTER_SP(MEDAL_YODA);
+REGISTER_SP(MEDAL_TELEFRAG);
 
 REGISTER_SP(MEDAL_ACCURACY);
 REGISTER_SP(MEDAL_ASSIST);
index 9d1fadc00f76b8915f787ebe24e9601c228613e9..30c6cdca00f28d34bb795f13ad7151de30fce851 100644 (file)
@@ -126,6 +126,7 @@ void LogDeath(string mode, int deathtype, entity killer, entity killed)
 
 void Obituary_SpecialDeath(
        entity notif_target,
+       entity attacker,
        float murder,
        int deathtype,
        string s1, string s2, string s3,
@@ -167,6 +168,10 @@ void Obituary_SpecialDeath(
                        f1, f2, f3, 0
                );
        }
+       
+       if(deathtype != DEATH_TELEFRAG.m_id) {
+               Give_Medal(attacker, TELEFRAG);
+       }
 }
 
 float Obituary_WeaponDeath(
@@ -287,7 +292,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en
                {
                        if(deathtype == DEATH_TEAMCHANGE.m_id || deathtype == DEATH_AUTOTEAMCHANGE.m_id)
                        {
-                               Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", targ.team, 0, 0);
+                               Obituary_SpecialDeath(targ, NULL, false, deathtype, targ.netname, deathlocation, "", targ.team, 0, 0);
                        }
                        else
                        {
@@ -295,13 +300,13 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en
                                {
                                        case DEATH_MIRRORDAMAGE:
                                        {
-                                               Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0, 0);
+                                               Obituary_SpecialDeath(targ, NULL, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0, 0);
                                                break;
                                        }
 
                                        default:
                                        {
-                                               Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0, 0);
+                                               Obituary_SpecialDeath(targ, NULL, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0, 0);
                                                break;
                                        }
                                }
@@ -441,7 +446,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en
                                f3 = buff_FirstFromFlags(STAT(BUFFS, attacker)).m_id;
 
                        if (!Obituary_WeaponDeath(targ, attacker, true, deathtype, playername(targ.netname, targ.team, true), playername(attacker_name, attacker.team, true), deathlocation, CS(targ).killcount, kill_count_to_attacker))
-                               Obituary_SpecialDeath(targ, true, deathtype, playername(targ.netname, targ.team, true), playername(attacker_name, attacker.team, true), deathlocation, CS(targ).killcount, kill_count_to_attacker, f3);
+                               Obituary_SpecialDeath(targ, attacker, true, deathtype, playername(targ.netname, targ.team, true), playername(attacker_name, attacker.team, true), deathlocation, CS(targ).killcount, kill_count_to_attacker, f3);
                }
        }
 
@@ -457,7 +462,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en
                        // and there will be a REAL DEATH_VOID implementation which mappers will use.
                        case DEATH_HURTTRIGGER:
                        {
-                               Obituary_SpecialDeath(targ, false, deathtype,
+                               Obituary_SpecialDeath(targ, NULL, false, deathtype,
                                        playername(targ.netname, targ.team, true),
                                        inflictor.message,
                                        deathlocation,
@@ -469,7 +474,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en
 
                        case DEATH_CUSTOM:
                        {
-                               Obituary_SpecialDeath(targ, false, deathtype,
+                               Obituary_SpecialDeath(targ, NULL, false, deathtype,
                                        playername(targ.netname, targ.team, true),
                                        ((strstrofs(deathmessage, "%", 0) < 0) ? strcat("%s ", deathmessage) : deathmessage),
                                        deathlocation,
@@ -481,7 +486,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en
 
                        default:
                        {
-                               Obituary_SpecialDeath(targ, false, deathtype, playername(targ.netname, targ.team, true), deathlocation, "", CS(targ).killcount, 0, 0);
+                               Obituary_SpecialDeath(targ, NULL, false, deathtype, playername(targ.netname, targ.team, true), deathlocation, "", CS(targ).killcount, 0, 0);
                                break;
                        }
                }
index 3140748245b864de5f0f2ded278050a6157208ae..848e9773a538e4706c583928ef4d7b91e25be8de 100644 (file)
@@ -90,6 +90,7 @@ void LogDeath(string mode, int deathtype, entity killer, entity killed);
 
 void Obituary_SpecialDeath(
        entity notif_target,
+       entity attacker,
        float murder,
        int deathtype,
        string s1, string s2, string s3,