1 // a laser goes from origin in direction angles
2 // it has color 'colormod'
3 // and stops when something is in the way
4 .float cnt; // end effect
6 .float state; // on-off
12 makevectors(self.angles);
13 traceline(self.origin, self.origin + v_forward * 32768, 0, self);
14 Draw_CylindricLine(self.origin, trace_endpos, 4, "particles/laserbeam", 1, self.colormod, DRAWFLAG_ADDITIVE); // TODO make a texture to make the laser look smoother
15 pointparticles(self.cnt, trace_endpos, trace_plane_normal, 256 * drawframetime);
21 // 30 bytes, or 13 bytes for just moving
25 self.origin_x = ReadCoord();
26 self.origin_y = ReadCoord();
27 self.origin_z = ReadCoord();
28 self.colormod_x = ReadByte() / 255.0;
29 self.colormod_y = ReadByte() / 255.0;
30 self.colormod_z = ReadByte() / 255.0;
31 self.cnt = ReadShort(); // effect number
35 self.angles_x = ReadCoord();
36 self.angles_y = ReadCoord();
39 self.state = ReadByte();
40 self.draw = Draw_Laser;