]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 6a8d5c6141a0e9bf2a1751132263c5a53e7de307..3300476bfc9dfaa99738d9d9c37599ff87a585a8 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 412ac1cd72da4c0c53309042bb398fd4a9a3f99c..fcf209faca6ddbdb2e7e7ea44c4ee407dea503af 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 77b7559e49ef418f242d946085ed10fd07f0d67c..2b69551e7152c98fc85921b16b99c405d6ed22bb 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;
        }