]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Electrobitch and humiliation medals
authorz411 <z411@omaera.org>
Sun, 4 Oct 2020 18:41:41 +0000 (15:41 -0300)
committerz411 <z411@omaera.org>
Sun, 4 Oct 2020 18:41:41 +0000 (15:41 -0300)
qcsrc/common/weapons/weapon/electro.qc
qcsrc/server/damage.qc
qcsrc/server/damage.qh

index 4fc98e8430cca7a45542c93af5bdd34596034686..1100e15812513eafbbfd4e65e6e83fd9ac00c509 100644 (file)
@@ -74,14 +74,15 @@ void W_Electro_ExplodeCombo(entity this)
 
 void W_Electro_Explode(entity this, entity directhitentity)
 {
-       if(directhitentity.takedamage == DAMAGE_AIM)
+       /*if(directhitentity.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(directhitentity))
                        if(DIFF_TEAM(this.realowner, directhitentity))
                                if(!IS_DEAD(directhitentity))
                                        if(IsFlying(directhitentity)) {
                                                Give_Medal(this.realowner, ELECTROBITCH);
                                        }
-
+       */
+       
        this.event_damage = func_null;
        this.takedamage = DAMAGE_NO;
 
index 85f8beb32aee4463e112877e78f52156d3e32390..988d86c3b536674a4f414cf7afc7d87cd8ffc0b9 100644 (file)
@@ -169,6 +169,7 @@ void Obituary_SpecialDeath(
 
 float Obituary_WeaponDeath(
        entity notif_target,
+       entity attacker,
        float murder,
        int deathtype,
        string s1, string s2, string s3,
@@ -201,6 +202,20 @@ float Obituary_WeaponDeath(
                        s1, s2, s3, "",
                        f1, f2, 0, 0
                );
+               
+               // z411 special medals
+               if(attacker) {
+                       switch(death_message) {
+                               case WEAPON_SHOTGUN_MURDER_SLAP:
+                                       if(!autocvar_g_melee_only) { // don't spam humiliation if we're in melee_only mode
+                                               Give_Medal(attacker, HUMILIATION);
+                                       }
+                                       break;
+                               case WEAPON_ELECTRO_MURDER_COMBO:
+                                       Give_Medal(attacker, ELECTROBITCH);
+                                       break;
+                       }
+               }
        }
        else
        {
@@ -290,7 +305,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en
                                }
                        }
                }
-               else if (!Obituary_WeaponDeath(targ, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0))
+               else if (!Obituary_WeaponDeath(targ, NULL, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0))
                {
                        backtrace("SUICIDE: what the hell happened here?\n");
                        return;
@@ -421,7 +436,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en
                        if(deathtype == DEATH_BUFF.m_id)
                                f3 = buff_FirstFromFlags(STAT(BUFFS, attacker)).m_id;
 
-                       if (!Obituary_WeaponDeath(targ, true, deathtype, playername(targ, true), playername(attacker, true), deathlocation, CS(targ).killcount, kill_count_to_attacker))
+                       if (!Obituary_WeaponDeath(targ, attacker, true, deathtype, playername(targ, true), playername(attacker, true), deathlocation, CS(targ).killcount, kill_count_to_attacker))
                                Obituary_SpecialDeath(targ, true, deathtype, playername(targ, true), playername(attacker, true), deathlocation, CS(targ).killcount, kill_count_to_attacker, f3);
                }
        }
index 27473a24cd93f3449652df7f5760304a7d1aca80..c69ee0da43b80fb3563c4c7f9b7f5774655c7932 100644 (file)
@@ -96,6 +96,7 @@ void Obituary_SpecialDeath(
 float w_deathtype;
 float Obituary_WeaponDeath(
        entity notif_target,
+       entity target,
        float murder,
        int deathtype,
        string s1, string s2, string s3,