]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/gibs.qc
Registry: use BITS everywhere
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / gibs.qc
index 0302f184150f81525487e63b5ca272c9052be29e..6b27d0a41a0d2349a7f879d78c76ca426c612934 100644 (file)
@@ -1,11 +1,7 @@
 #include "gibs.qh"
-#include "_all.qh"
 
 #include "rubble.qh"
-
-#include "../common/constants.qh"
 #include "../common/movetypes/movetypes.qh"
-#include "../common/util.qh"
 
 .float scale;
 .float alpha;
@@ -65,7 +61,7 @@ void new_te_bloodshower (int ef, vector org, float explosionspeed, int howmany)
        float i, pmod;
        pmod = autocvar_cl_particles_quality;
        for (i = 0; i < 50 * pmod; ++i)
-               pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50);
+               __pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50);
 }
 
 void SUB_RemoveOnNoImpact()
@@ -85,14 +81,14 @@ void Gib_Touch()
        }
 
        if(!self.silent)
-               sound(self, CH_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTEN_NORM);
-       pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
+               sound(self, CH_PAIN, SND_GIB_SPLAT_RANDOM(), VOL_BASE, ATTEN_NORM);
+       __pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
 
        Gib_Delete();
 }
 
-void Gib_Draw()
-{SELFPARAM();
+void Gib_Draw(entity this)
+{
        vector oldorg;
        oldorg = self.origin;
 
@@ -102,9 +98,9 @@ void Gib_Draw()
 
        if(self.touch == Gib_Touch) // don't do this for the "chunk" thingie...
                // TODO somehow make it spray in a direction dependent on self.angles
-               trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg, self.origin);
+               __trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg, self.origin);
        else
-               trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, self.origin);
+               __trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, self.origin);
 
        self.renderflags = 0;
 
@@ -218,7 +214,7 @@ void Ent_GibSplash(bool isNew)
        {
                case 0x01:
                        if(!issilent)
-                               sound (self, CH_PAIN, "misc/gib.wav", VOL_BASE, ATTEN_NORM);
+                               sound (self, CH_PAIN, SND_GIB, VOL_BASE, ATTEN_NORM);
 
                        if(prandom() < amount)
                                TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent);
@@ -255,29 +251,20 @@ void Ent_GibSplash(bool isNew)
                        }
                        break;
                case 0x02:
-                       pointparticles(_particleeffectnum(strcat(specstr, "blood")), org, vel, amount * 16);
+                       __pointparticles(_particleeffectnum(strcat(specstr, "blood")), org, vel, amount * 16);
                        break;
                case 0x03:
                        if(prandom() < amount)
                                TossGib ("models/gibs/chunk.mdl", org, org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent); // TODO maybe adjust to more randomization?
                        break;
                case 0x81:
-                       pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount);
+                       __pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount);
                        break;
                case 0x82:
-                       pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_hit")), org, vel, amount * 16);
+                       __pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_hit")), org, vel, amount * 16);
                        break;
                case 0x83:
                        // no gibs in gentle mode, sorry
                        break;
        }
 }
-
-void GibSplash_Precache()
-{
-       precache_sound ("misc/gib.wav");
-    precache_sound ("misc/gib_splat01.wav");
-    precache_sound ("misc/gib_splat02.wav");
-    precache_sound ("misc/gib_splat03.wav");
-    precache_sound ("misc/gib_splat04.wav");
-}