From: Mario Date: Mon, 31 Aug 2015 15:18:56 +0000 (+1000) Subject: Add options to allow instagib secondary fire to damage or push players X-Git-Tag: xonotic-v0.8.2~1938 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0f818b89a344540159bbd0885b6ebcc7d612a448;p=xonotic%2Fxonotic-data.pk3dir.git Add options to allow instagib secondary fire to damage or push players --- 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; }