]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/damage.qc
Merge branch 'master' into Mario/turrets
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / damage.qc
index 3bab63b9395bc2eba5f7e12e6d93ed67ae607e8c..bb4fda924ef43e373cdb30fb9a4b684fb94931a8 100644 (file)
@@ -85,7 +85,7 @@ void DamageEffect(vector hitorg, float dmg, float type, float specnum)
        e = get_weaponinfo(type);
 
        effectname = strcat("damage_", e.netname);
-       
+
        // if damage was dealt with a bullet weapon, our effect is blood
        // since blood is species dependent, include the species tag
        if(type == WEP_SHOTGUN || type == WEP_UZI || type == WEP_RIFLE)
@@ -133,7 +133,7 @@ void Ent_DamageInfo(float isNew)
        force = decompressShortVector(ReadShort());
        species = ReadByte();
 
-       if not(isNew)
+       if (!isNew)
                return;
 
        if(rad < 0)
@@ -143,7 +143,7 @@ void Ent_DamageInfo(float isNew)
        }
        else
                forcemul = 1;
-       
+
        for(self = findradius(w_org, rad + MAX_DAMAGEEXTRARADIUS); self; self = self.chain)
        {
                // attached ents suck
@@ -198,7 +198,7 @@ void Ent_DamageInfo(float isNew)
        }
 
        self = oldself;
-       
+
        if(DEATH_ISVEHICLE(w_deathtype))
        {
                traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
@@ -206,14 +206,14 @@ void Ent_DamageInfo(float isNew)
                        w_backoff = trace_plane_normal;
                else
                        w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16));
-               
+
                setorigin(self, w_org + w_backoff * 2); // for sound() calls
-               
+
                switch(w_deathtype)
                {
                        case DEATH_VH_CRUSH:
                                break;
-                               
+
                        // spiderbot
                        case DEATH_VH_SPID_MINIGUN:
                                string _snd;
@@ -229,7 +229,7 @@ void Ent_DamageInfo(float isNew)
                                sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
                                break;
-            
+
                        case DEATH_VH_WAKI_GUN:
                                sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1);
@@ -242,7 +242,7 @@ void Ent_DamageInfo(float isNew)
                                sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
                                break;
-                               
+
                        case DEATH_VH_RAPT_CANNON:
                                sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1);
@@ -273,8 +273,8 @@ void Ent_DamageInfo(float isNew)
                                break;
                }
        }
-       
-       
+
+
        if(DEATH_ISTURRET(w_deathtype))
        {
                string _snd;
@@ -283,22 +283,22 @@ void Ent_DamageInfo(float isNew)
                        w_backoff = trace_plane_normal;
                else
                        w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16));
-               
+
                setorigin(self, w_org + w_backoff * 2); // for sound() calls
-               
+
                switch(w_deathtype)
-               {   
+               {
                         case DEATH_TURRET_EWHEEL:
                                sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("laser_impact"), self.origin, w_backoff * 1000, 1);
                                break;
-                        
+
                         case DEATH_TURRET_FLAC:
                                pointparticles(particleeffectnum("hagar_explode"), w_org, '0 0 0', 1);
                                _snd = strcat("weapons/hagexp", ftos(1 + rint(random() * 2)), ".waw");
                                sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
                                break;
-                               
+
                         case DEATH_TURRET_MLRS:
                         case DEATH_TURRET_HK:
                         case DEATH_TURRET_WALK_ROCKET:
@@ -306,19 +306,19 @@ void Ent_DamageInfo(float isNew)
                                sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("rocket_explode"), self.origin, w_backoff * 1000, 1);
                                break;
-                        
+
                         case DEATH_TURRET_MACHINEGUN:
                         case DEATH_TURRET_WALK_GUN:
                                _snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
                                sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1);
                                break;
-                                                 
+
                         case DEATH_TURRET_PLASMA:
                                sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1);
                                break;
-                                                 
+
                         case DEATH_TURRET_WALK_MELEE:
                                sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1);
@@ -326,17 +326,17 @@ void Ent_DamageInfo(float isNew)
 
                         case DEATH_TURRET_PHASER:
                                break;
-                               
+
                         case DEATH_TURRET_TESLA:
                                te_smallflash(self.origin);
                                break;
 
                }
        }
-       
+
        // TODO spawn particle effects and sounds based on w_deathtype
        if(!DEATH_ISSPECIAL(w_deathtype))
-       if not(hitplayer && !rad) // don't show ground impacts for hitscan weapons if a player was hit
+       if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit
        {
                float hitwep;