]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Merge branch 'master' into Mario/mutator_minstagib
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 6687f18ebc24064cf023faaa1c9a6b766cdb9396..908f9c34fa5ac6a0cae7617b5243d4b5bd69cf69 100644 (file)
@@ -638,12 +638,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                        if(complainteamdamage > 0 && !g_ca) // FIXME why is g_ca ruled out here? Why not just g_mirrordamage 0 on CA servers?
                                                                mirrordamage = autocvar_g_mirrordamage * complainteamdamage;
                                                        mirrorforce = autocvar_g_mirrordamage * vlen(force);
-                                                       if(g_minstagib)
-                                                       {
-                                                               if(autocvar_g_friendlyfire == 0)
-                                                                       damage = 0;
-                                                       }
-                                                       else if(g_ca)
+                                                       if(g_ca)
                                                                damage = 0;
                                                        else
                                                                damage = autocvar_g_friendlyfire * damage;
@@ -677,44 +672,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        }
                }
 
-               if(targ.classname == "player")
-               if (g_minstagib)
-               {
-                       if ((deathtype == DEATH_FALL)  ||
-                               (deathtype == DEATH_DROWN) ||
-                               (deathtype == DEATH_SLIME) ||
-                               (deathtype == DEATH_LAVA)  ||
-                               (!DEATH_ISWEAPON(deathtype, WEP_LASER) && damage > 0 && damage < 100))
-                       {
-                               self = oldself;
-                               return;
-                       }
-                       if(damage > 0)
-                           damage = 10000;
-                       if (targ.armorvalue && (deathtype == WEP_MINSTANEX) && damage)
-                       {
-                               targ.armorvalue -= 1;
-                               centerprint(targ, strcat("^3Remaining extra lives: ",ftos(targ.armorvalue)));
-                               damage = 0;
-                               targ.hitsound += 1;
-                               attacker.hitsound += 1; // TODO change this to a future specific hitsound for armor hit
-                       }
-                       if (DEATH_ISWEAPON(deathtype, WEP_LASER))
-                       {
-                               damage = 0;
-                               mirrordamage = 0;
-                               complainteamdamage = 0;
-                               if (targ != attacker)
-                               {
-                                       if ((targ.health >= 1) && (targ.classname == "player"))
-                                               centerprint(attacker, "Secondary fire inflicts no damage!");
-                                       force = '0 0 0';
-                                       // keep mirrorforce
-                                       attacker = targ;
-                               }
-                       }
-               }
-
                if not(DEATH_ISSPECIAL(deathtype))
                {
                        damage *= g_weapondamagefactor;
@@ -730,28 +687,33 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                frag_damage = damage;
                frag_force = force;
         frag_deathtype = deathtype;
+               frag_mirrordamage = mirrordamage;
                MUTATOR_CALLHOOK(PlayerDamage_Calculate);
                damage = frag_damage;
+               mirrordamage = frag_mirrordamage;
                force = frag_force;
                
-               // apply strength multiplier
-               if ((attacker.items & IT_STRENGTH) && !g_minstagib)
+               if not(g_minstagib)
                {
-                       if(targ == attacker)
+                       // apply strength multiplier
+                       if (attacker.items & IT_STRENGTH)
                        {
-                               damage = damage * autocvar_g_balance_powerup_strength_selfdamage;
-                               force = force * autocvar_g_balance_powerup_strength_selfforce;
-                       }
-                       else
-                       {
-                               damage = damage * autocvar_g_balance_powerup_strength_damage;
-                               force = force * autocvar_g_balance_powerup_strength_force;
+                               if(targ == attacker)
+                               {
+                                       damage = damage * autocvar_g_balance_powerup_strength_selfdamage;
+                                       force = force * autocvar_g_balance_powerup_strength_selfforce;
+                               }
+                               else
+                               {
+                                       damage = damage * autocvar_g_balance_powerup_strength_damage;
+                                       force = force * autocvar_g_balance_powerup_strength_force;
+                               }
                        }
-               }
 
-               // apply invincibility multiplier
-               if (targ.items & IT_INVINCIBLE && !g_minstagib)
-                       damage = damage * autocvar_g_balance_powerup_invincible_takedamage;
+                       // apply invincibility multiplier
+                       if (targ.items & IT_INVINCIBLE)
+                               damage = damage * autocvar_g_balance_powerup_invincible_takedamage;
+               }
 
                if (targ == attacker)
                {
@@ -793,13 +755,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                if not(DEATH_ISSPECIAL(deathtype))
                                                {
                                                        if(targ.classname == "player") // don't do this for vehicles
-                                                       if(!g_minstagib)
                                                        if(IsFlying(victim))
                                                                yoda = 1;
-
-                                                       if(g_minstagib)
-                                                       if(victim.items & IT_STRENGTH)
-                                                               yoda = 1;
                                                }
                                        }
                                }
@@ -856,18 +813,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
        if(mirrordamage > 0 || mirrorforce > 0)
        {
                attacker = attacker_save;
-               if(g_minstagib)
-               if(mirrordamage > 0)
-               {
-                       // just lose extra LIVES, don't kill the player for mirror damage
-                       if(attacker.armorvalue > 0)
-                       {
-                               attacker.armorvalue = attacker.armorvalue - 1;
-                               centerprint(attacker, strcat("^3Remaining extra lives: ",ftos(attacker.armorvalue)));
-                               attacker.hitsound += 1;
-                       }
-                       mirrordamage = 0;
-               }
 
                force = normalize(attacker.origin + attacker.view_ofs - hitloc) * mirrorforce;
                Damage(attacker, inflictor, attacker, mirrordamage, DEATH_MIRRORDAMAGE, attacker.origin, force);