Add options to allow instagib secondary fire to damage or push players
authorMario <zacjardine@y7mail.com>
Mon, 31 Aug 2015 15:18:56 +0000 (01:18 +1000)
committerMario <zacjardine@y7mail.com>
Mon, 31 Aug 2015 15:18:56 +0000 (01:18 +1000)
mutators.cfg
qcsrc/server/autocvars.qh
qcsrc/server/mutators/mutator_instagib.qc

index 6a8d5c6..3300476 100644 (file)
@@ -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"
 
 
 // ==========
index 412ac1c..fcf209f 100644 (file)
@@ -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")
 
index 77b7559..2b69551 100644 (file)
@@ -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;
        }