]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/particles.qc
Add a quickmenu example file with syntax description
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / particles.qc
1 #include "particles.qh"
2
3 #include "../common/stats.qh"
4
5 #include "../lib/warpzone/common.qh"
6
7 void Net_ReadVortexBeamParticle()
8 {
9         vector shotorg, endpos;
10         float charge;
11         shotorg.x = ReadCoord(); shotorg.y = ReadCoord(); shotorg.z = ReadCoord();
12         endpos.x = ReadCoord(); endpos.y = ReadCoord(); endpos.z = ReadCoord();
13         charge = ReadByte() / 255.0;
14
15         pointparticles(particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH), shotorg, normalize(endpos - shotorg) * 1000, 1);
16
17         //draw either the old v2.3 beam or the new beam
18         charge = sqrt(charge); // divide evenly among trail spacing and alpha
19         particles_alphamin = particles_alphamax = particles_fade = charge;
20
21         if (autocvar_cl_particles_oldvortexbeam && (getstati(STAT_ALLOW_OLDVORTEXBEAM) || isdemo()))
22                 WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
23         else
24                 WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
25 }