+void CL_BeamParticle (const vec3_t start, const vec3_t end, vec_t radius, float red, float green, float blue, float alpha, float lifetime)
+{
+ int tempcolor2, cr, cg, cb;
+ cr = red * 255;
+ cg = green * 255;
+ cb = blue * 255;
+ tempcolor2 = (bound(0, cr, 255) << 16) | (bound(0, cg, 255) << 8) | bound(0, cb, 255);
+ particle(pt_static, PARTICLE_BEAM, tempcolor2, tempcolor2, tex_beam, false, true, radius, radius, alpha * 255, alpha * 255 / lifetime, 9999, 0, 0, start[0], start[1], start[2], 0, 0, 0, 0, end[0], end[1], end[2], 0, 0);
+}
+
+void CL_Tei_Smoke(const vec3_t org, const vec3_t dir, int count)
+{
+ int k;
+ if (!cl_particles.integer) return;
+
+ // smoke puff
+ if (cl_particles_smoke.integer)
+ {
+ k = count / 4;
+ while(k--)
+ {
+ particle(pt_grow, PARTICLE_BILLBOARD, 0x202020, 0x404040, tex_smoke[rand()&7], true, true, 5, 5, 255, 512, 9999, 0, 0, org[0] + 0.125f * lhrandom(-count, count), org[1] + 0.125f * lhrandom (-count, count), org[2] + 0.125f * lhrandom(-count, count), dir[0] + lhrandom(-count, count) * 0.5f, dir[1] + lhrandom(-count, count) * 0.5f, dir[2] + lhrandom(-count, count) * 0.5f, 15, 0, 0, 0, 0, 0);
+ }
+ }
+}
+
+void CL_Tei_PlasmaHit(const vec3_t org, const vec3_t dir, int count)
+{
+ int k;
+ if (!cl_particles.integer) return;
+
+ if (cl_stainmaps.integer)
+ R_Stain(org, 40, 96, 96, 96, 40, 128, 128, 128, 40);
+
+ // smoke puff
+ if (cl_particles_smoke.integer)
+ {
+ k = count / 4;
+ while(k--)
+ {
+ particle(pt_grow, PARTICLE_BILLBOARD, 0x202020, 0x404040, tex_smoke[rand()&7], true, true, 5, 5, 255, 512, 9999, 0, 0, org[0] + 0.125f * lhrandom(-count, count), org[1] + 0.125f * lhrandom (-count, count), org[2] + 0.125f * lhrandom(-count, count), dir[0] + lhrandom(-count, count), dir[1] + lhrandom(-count, count), dir[2] + lhrandom(-count, count), 15, 0, 0, 0, 0, 0);
+ }
+ }
+
+ if (cl_particles_sparks.integer)
+ {
+ // sparks
+ while(count--)
+ {
+ particle(pt_static, PARTICLE_SPARK, 0x2030FF, 0x80C0FF, tex_particle, false, true, 2.0f, 0.1f, lhrandom(64, 255), 512, 9999, 0, 0, org[0], org[1], org[2], lhrandom(-count, count) * 3.0f + dir[0], lhrandom(-count, count) * 3.0f + dir[1], lhrandom(-count, count) * 3.0f + dir[2], 0, 0, 0, 0, 0, 0);
+ }
+ }
+}