]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/particles.qc
Merge remote-tracking branch 'origin/divVerent/merged-translations'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / particles.qc
index d4a95b7754cddc37b6522ffa80d0930c2081d4f1..00343a432d30d431f8a9f7de4a2acd274b507680 100644 (file)
@@ -57,8 +57,8 @@ void Draw_PointParticles()
                        }
                        if(self.noise != "")
                        {
-                               self.origin = p;
-                               sound(self, CHAN_TRIGGER, self.noise, VOL_BASE * self.volume, self.atten);
+                               setorigin(self, p);
+                               sound(self, CH_AMBIENT, self.noise, VOL_BASE * self.volume, self.atten);
                        }
                        self.just_toggled = 0;
                }
@@ -68,7 +68,7 @@ void Draw_PointParticles()
                        --i;
                }
        }
-       self.origin = o;
+       setorigin(self, o);
 }
 
 void Ent_PointParticles_Remove()
@@ -191,12 +191,12 @@ void Ent_PointParticles()
 .float glow_color; // palette index
 void Draw_Rain()
 {
-    te_particlerain(self.origin + self.mins, self.origin + self.maxs, self.velocity, self.count * drawframetime, self.glow_color);
+    te_particlerain(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color);
 }
 
 void Draw_Snow()
 {
-    te_particlesnow(self.origin + self.mins, self.origin + self.maxs, self.velocity, self.count * drawframetime, self.glow_color);
+    te_particlesnow(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color);
 }
 
 void Ent_RainOrSnow()
@@ -286,14 +286,19 @@ void Net_ReadZCurveParticles()
 void Net_ReadNexgunBeamParticle()
 {
        vector shotorg, endpos;
+       float charge;
        shotorg_x = ReadCoord(); shotorg_y = ReadCoord(); shotorg_z = ReadCoord();
        endpos_x = ReadCoord(); endpos_y = ReadCoord(); endpos_z = ReadCoord();
+       charge = ReadByte() / 255.0;
        
        pointparticles(particleeffectnum("nex_muzzleflash"), shotorg, normalize(endpos - shotorg) * 1000, 1);
        
        //draw either the old v2.3 beam or the new beam
-       if (cvar("cl_particles_oldnexbeam") && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo()))
-               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos);
+       charge = sqrt(charge); // divide evenly among trail spacing and alpha
+       particles_alphamin = particles_alphamax = particles_fade = charge;
+
+       if (autocvar_cl_particles_oldnexbeam && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo()))
+               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
        else
-               WarpZone_TrailParticles(world, particleeffectnum("nex_beam"), shotorg, endpos);
+               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("nex_beam"), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
 }