From: Mario Date: Tue, 31 Mar 2015 12:20:35 +0000 (+1100) Subject: Fix secondary fire taking accuracy off the overkill/instagib primary attacks X-Git-Tag: xonotic-v0.8.1~96^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5cd7b7f613e84152b7992d217e0c4eb777b78966;p=xonotic%2Fxonotic-data.pk3dir.git Fix secondary fire taking accuracy off the overkill/instagib primary attacks --- 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;