From 0f818b89a344540159bbd0885b6ebcc7d612a448 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 1 Sep 2015 01:18:56 +1000 Subject: [PATCH] Add options to allow instagib secondary fire to damage or push players --- mutators.cfg | 2 ++ qcsrc/server/autocvars.qh | 2 ++ qcsrc/server/mutators/mutator_instagib.qc | 10 ++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mutators.cfg b/mutators.cfg index 6a8d5c614..3300476bf 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -32,6 +32,8 @@ set g_instagib_ammo_drop 5 "how much ammo you'll get for weapons or cells" set g_instagib_invis_alpha 0.15 set g_instagib_speed_highspeed 1.5 "speed-multiplier that applies while you carry the invincibility powerup" set g_instagib_damagedbycontents 1 "allow damage from lava pits in instagib" +set g_instagib_blaster_keepdamage 0 "allow secondary fire to hurt players" +set g_instagib_blaster_keepforce 0 "allow secondary fire to push players" // ========== diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 412ac1cd7..fcf209fac 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -404,6 +404,8 @@ int autocvar_g_instagib_extralives; float autocvar_g_instagib_speed_highspeed; float autocvar_g_instagib_invis_alpha; bool autocvar_g_instagib_damagedbycontents = true; +bool autocvar_g_instagib_blaster_keepdamage = false; +bool autocvar_g_instagib_blaster_keepforce = false; #define autocvar_g_mirrordamage cvar("g_mirrordamage") #define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual") diff --git a/qcsrc/server/mutators/mutator_instagib.qc b/qcsrc/server/mutators/mutator_instagib.qc index 77b7559e4..2b69551e7 100644 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/server/mutators/mutator_instagib.qc @@ -279,12 +279,14 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage) { if(frag_deathtype & HITTYPE_SECONDARY) { - frag_damage = frag_mirrordamage = 0; + if(!autocvar_g_instagib_blaster_keepdamage) + frag_damage = frag_mirrordamage = 0; if(frag_target != frag_attacker) { - if(frag_target.health > 0) { Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE); } - frag_force = '0 0 0'; + if(frag_damage <= 0 && frag_target.health > 0) { Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE); } + if(!autocvar_g_instagib_blaster_keepforce) + frag_force = '0 0 0'; } } } @@ -298,7 +300,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage) { frag_attacker.armorvalue -= 1; Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_INSTAGIB_LIVES_REMAINING, frag_attacker.armorvalue); - frag_attacker.damage_dealt += 1; + frag_attacker.damage_dealt += frag_mirrordamage; } frag_mirrordamage = 0; } -- 2.39.2