From: z411 Date: Sun, 4 Oct 2020 18:41:41 +0000 (-0300) Subject: Electrobitch and humiliation medals X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1f787b5de9e87918814872c192a6ae425f63dea0;p=xonotic%2Fxonotic-data.pk3dir.git Electrobitch and humiliation medals --- diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 4fc98e843..1100e1581 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -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; diff --git a/qcsrc/server/damage.qc b/qcsrc/server/damage.qc index 85f8beb32..988d86c3b 100644 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@ -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); } } diff --git a/qcsrc/server/damage.qh b/qcsrc/server/damage.qh index 27473a24c..c69ee0da4 100644 --- a/qcsrc/server/damage.qh +++ b/qcsrc/server/damage.qh @@ -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,