From 5cd7b7f613e84152b7992d217e0c4eb777b78966 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 31 Mar 2015 23:20:35 +1100 Subject: [PATCH] Fix secondary fire taking accuracy off the overkill/instagib primary attacks --- qcsrc/common/weapons/w_vaporizer.qc | 5 ++++- qcsrc/server/mutators/mutator_instagib.qc | 22 +++++++++++++--------- qcsrc/server/mutators/mutator_overkill.qc | 3 +++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/qcsrc/common/weapons/w_vaporizer.qc b/qcsrc/common/weapons/w_vaporizer.qc index 14377edb8..b67056f7e 100644 --- a/qcsrc/common/weapons/w_vaporizer.qc +++ b/qcsrc/common/weapons/w_vaporizer.qc @@ -164,8 +164,10 @@ float W_Vaporizer(float req) W_DecreaseAmmo(WEP_CVAR_SEC(vaporizer, ammo)); // ugly instagib hack to reuse the fire mode of the laser + int oldwep = self.weapon; // we can't avoid this hack + self.weapon = WEP_BLASTER; W_Blaster_Attack( - WEP_VAPORIZER | HITTYPE_SECONDARY, + WEP_BLASTER | HITTYPE_SECONDARY, WEP_CVAR_SEC(vaporizer, shotangle), WEP_CVAR_SEC(vaporizer, damage), WEP_CVAR_SEC(vaporizer, edgedamage), @@ -176,6 +178,7 @@ float W_Vaporizer(float req) WEP_CVAR_SEC(vaporizer, delay), WEP_CVAR_SEC(vaporizer, lifetime) ); + self.weapon = oldwep; // now do normal refire weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready); diff --git a/qcsrc/server/mutators/mutator_instagib.qc b/qcsrc/server/mutators/mutator_instagib.qc index 141172e2f..b3502b0f7 100644 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/server/mutators/mutator_instagib.qc @@ -246,6 +246,18 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage) if(IS_PLAYER(frag_attacker)) if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER)) + { + if(frag_target.armorvalue) + { + frag_target.armorvalue -= 1; + frag_damage = 0; + frag_target.damage_dealt += 1; + frag_attacker.damage_dealt += 1; // TODO: change this to a specific hitsound for armor hit + Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_INSTAGIB_LIVES_REMAINING, frag_target.armorvalue); + } + } + + if(IS_PLAYER(frag_attacker) && DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER)) { if(frag_deathtype & HITTYPE_SECONDARY) { @@ -257,14 +269,6 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage) frag_force = '0 0 0'; } } - else if(frag_target.armorvalue) - { - frag_target.armorvalue -= 1; - frag_damage = 0; - frag_target.damage_dealt += 1; - frag_attacker.damage_dealt += 1; // TODO: change this to a specific hitsound for armor hit - Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_INSTAGIB_LIVES_REMAINING, frag_target.armorvalue); - } } } @@ -281,7 +285,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage) frag_mirrordamage = 0; } - if(frag_target.items & IT_STRENGTH) + if((frag_target.buffs & BUFF_INVISIBLE) || (frag_target.items & IT_STRENGTH)) yoda = 1; return false; diff --git a/qcsrc/server/mutators/mutator_overkill.qc b/qcsrc/server/mutators/mutator_overkill.qc index 6818b4564..78a615106 100644 --- a/qcsrc/server/mutators/mutator_overkill.qc +++ b/qcsrc/server/mutators/mutator_overkill.qc @@ -138,6 +138,8 @@ MUTATOR_HOOKFUNCTION(ok_PlayerPreThink) self.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor(); makevectors(self.v_angle); + int oldwep = self.weapon; + self.weapon = WEP_BLASTER; W_Blaster_Attack( WEP_BLASTER | HITTYPE_SECONDARY, WEP_CVAR_SEC(vaporizer, shotangle), @@ -150,6 +152,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerPreThink) WEP_CVAR_SEC(vaporizer, delay), WEP_CVAR_SEC(vaporizer, lifetime) ); + self.weapon = oldwep; } self.weapon_blocked = false; -- 2.39.2