1 .float dphitcontentsmask;
3 .float cnt; // effect number
4 .vector velocity; // particle velocity
5 .float waterlevel; // direction jitter
6 .float count; // count multiplier
7 .float impulse; // density
8 .string noise; // sound
11 .float absolute; // 1 = count per second is absolute, 2 = only spawn at toggle
12 .vector movedir; // trace direction
14 void Draw_PointParticles()
21 sz = self.maxs - self.mins;
23 if(self.absolute == 2)
26 n = self.just_toggled ? self.impulse : 0;
28 n = self.impulse * drawframetime;
32 n *= self.impulse * drawframetime;
40 for(i = random(); i <= n && fail <= 64*n; ++i)
43 p_x += random() * sz_x;
44 p_y += random() * sz_y;
45 p_z += random() * sz_z;
46 if(WarpZoneLib_BoxTouchesBrush(p, p, self, world))
48 if(self.movedir != '0 0 0')
50 traceline(p, p + normalize(self.movedir) * 4096, 0, world);
52 pointparticles(self.cnt, p, trace_plane_normal * vlen(self.movedir) + self.velocity + randomvec() * self.waterlevel, self.count);
56 pointparticles(self.cnt, p, self.velocity + randomvec() * self.waterlevel, self.count);
61 sound(self, CH_AMBIENT, self.noise, VOL_BASE * self.volume, self.atten);
63 self.just_toggled = 0;
65 else if(self.absolute)
74 void Ent_PointParticles_Remove()
77 strunzone(self.noise);
78 self.noise = string_null;
80 strunzone(self.bgmscript);
81 self.bgmscript = string_null;
84 void Ent_PointParticles()
91 i = ReadCoord(); // density (<0: point, >0: volume)
92 if(i && !self.impulse && self.cnt) // self.cnt check is so it only happens if the ent already existed
93 self.just_toggled = 1;
98 self.origin_x = ReadCoord();
99 self.origin_y = ReadCoord();
100 self.origin_z = ReadCoord();
104 self.modelindex = ReadShort();
109 self.mins_x = ReadCoord();
110 self.mins_y = ReadCoord();
111 self.mins_z = ReadCoord();
112 self.maxs_x = ReadCoord();
113 self.maxs_y = ReadCoord();
114 self.maxs_z = ReadCoord();
119 self.maxs_x = ReadCoord();
120 self.maxs_y = ReadCoord();
121 self.maxs_z = ReadCoord();
126 self.mins = self.maxs = '0 0 0';
129 self.cnt = ReadShort(); // effect number
133 self.velocity = decompressShortVector(ReadShort());
134 self.movedir = decompressShortVector(ReadShort());
138 self.velocity = self.movedir = '0 0 0';
142 self.waterlevel = ReadShort() / 16.0;
143 self.count = ReadByte() / 16.0;
151 strunzone(self.noise);
153 strunzone(self.bgmscript);
154 self.noise = strzone(ReadString());
157 self.atten = ReadByte() / 64.0;
158 self.volume = ReadByte() / 255.0;
160 self.bgmscript = strzone(ReadString());
161 if(self.bgmscript != "")
163 self.bgmscriptattack = ReadByte() / 64.0;
164 self.bgmscriptdecay = ReadByte() / 64.0;
165 self.bgmscriptsustain = ReadByte() / 255.0;
166 self.bgmscriptrelease = ReadByte() / 64.0;
168 BGMScript_InitEntity(self);
173 self.absolute = (self.impulse >= 0);
176 v = self.maxs - self.mins;
177 self.impulse *= -v_x * v_y * v_z / 262144; // relative: particles per 64^3 cube
184 setorigin(self, self.origin);
185 setsize(self, self.mins, self.maxs);
186 self.solid = SOLID_NOT;
187 self.draw = Draw_PointParticles;
188 self.entremove = Ent_PointParticles_Remove;
191 .float glow_color; // palette index
194 te_particlerain(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color);
199 te_particlesnow(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color);
202 void Ent_RainOrSnow()
204 self.impulse = ReadByte(); // Rain, Snow, or Whatever
205 self.origin_x = ReadCoord();
206 self.origin_y = ReadCoord();
207 self.origin_z = ReadCoord();
208 self.maxs_x = ReadCoord();
209 self.maxs_y = ReadCoord();
210 self.maxs_z = ReadCoord();
211 self.velocity = decompressShortVector(ReadShort());
212 self.count = ReadShort() * 10;
213 self.glow_color = ReadByte(); // color
215 self.mins = -0.5 * self.maxs;
216 self.maxs = 0.5 * self.maxs;
217 self.origin = self.origin - self.mins;
219 setorigin(self, self.origin);
220 setsize(self, self.mins, self.maxs);
221 self.solid = SOLID_NOT;
223 self.draw = Draw_Rain;
225 self.draw = Draw_Snow;
228 void Net_ReadVortexBeamParticle()
230 vector shotorg, endpos;
232 shotorg_x = ReadCoord(); shotorg_y = ReadCoord(); shotorg_z = ReadCoord();
233 endpos_x = ReadCoord(); endpos_y = ReadCoord(); endpos_z = ReadCoord();
234 charge = ReadByte() / 255.0;
236 pointparticles(particleeffectnum("nex_muzzleflash"), shotorg, normalize(endpos - shotorg) * 1000, 1);
238 //draw either the old v2.3 beam or the new beam
239 charge = sqrt(charge); // divide evenly among trail spacing and alpha
240 particles_alphamin = particles_alphamax = particles_fade = charge;
242 if (autocvar_cl_particles_oldnexbeam && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo()))
243 WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
245 WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("nex_beam"), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
250 .float sw_spread_max;
251 .float sw_spread_min;
254 void Draw_Shockwave()
256 float a = bound(0, (0.5 - ((time - self.sw_time) / 0.4)), 0.5);
258 if(!a) { remove(self); }
260 vector deviation, angle;
262 vector sw_color = getcsqcplayercolor(self.sv_entnum); // GetTeamRGB(GetPlayerColor(self.sv_entnum));
264 vector first_min_end = '0 0 0', prev_min_end = '0 0 0', new_min_end = '0 0 0';
265 vector first_max_end = '0 0 0', prev_max_end = '0 0 0', new_max_end = '0 0 0';
267 float new_max_dist, new_min_dist;
269 vector shotdir = normalize(self.sw_endpos - self.sw_shotorg);
270 vectorvectors(shotdir);
271 vector right = v_right;
274 float counter, dist_before_normal = 200, shots = 20;
276 vector min_end = ((self.sw_shotorg + (shotdir * dist_before_normal)) + (up * self.sw_spread_min));
277 vector max_end = (self.sw_endpos + (up * self.sw_spread_max));
279 float spread_to_min = vlen(normalize(min_end - self.sw_shotorg) - shotdir);
280 float spread_to_max = vlen(normalize(max_end - min_end) - shotdir);
282 for(counter = 0; counter < shots; ++counter)
284 // perfect circle effect lines
286 makevectors('0 360 0' * (0.75 + (counter - 0.5) / shots));
287 angle_y = v_forward_x;
288 angle_z = v_forward_y;
290 // first do the spread_to_min effect
291 deviation = angle * spread_to_min;
292 deviation = ((shotdir + (right * deviation_y) + (up * deviation_z)));
293 new_min_dist = dist_before_normal;
294 new_min_end = (self.sw_shotorg + (deviation * new_min_dist));
295 //te_lightning2(world, new_min_end, self.sw_shotorg);
297 // then calculate spread_to_max effect
298 deviation = angle * spread_to_max;
299 deviation = ((shotdir + (right * deviation_y) + (up * deviation_z)));
300 new_max_dist = vlen(new_min_end - self.sw_endpos);
301 new_max_end = (new_min_end + (deviation * new_max_dist));
302 //te_lightning2(world, new_end, prev_min_end);
307 first_min_end = new_min_end;
308 first_max_end = new_max_end;
313 R_BeginPolygon("", DRAWFLAG_NORMAL);
314 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
315 R_PolygonVertex(new_min_end, '0 0 0', sw_color, a);
316 R_PolygonVertex(self.sw_shotorg, '0 0 0', sw_color, a);
319 R_BeginPolygon("", DRAWFLAG_NORMAL);
320 R_PolygonVertex(new_min_end, '0 0 0', sw_color, a);
321 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
322 R_PolygonVertex(prev_max_end, '0 0 0', sw_color, a);
323 R_PolygonVertex(new_max_end, '0 0 0', sw_color, a);
327 prev_min_end = new_min_end;
328 prev_max_end = new_max_end;
330 if((counter + 1) == shots)
332 R_BeginPolygon("", DRAWFLAG_NORMAL);
333 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
334 R_PolygonVertex(first_min_end, '0 0 0', sw_color, a);
335 R_PolygonVertex(self.sw_shotorg, '0 0 0', sw_color, a);
338 R_BeginPolygon("", DRAWFLAG_NORMAL);
339 R_PolygonVertex(first_min_end, '0 0 0', sw_color, a);
340 R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
341 R_PolygonVertex(prev_max_end, '0 0 0', sw_color, a);
342 R_PolygonVertex(first_max_end, '0 0 0', sw_color, a);
348 void Net_ReadShockwaveParticle()
352 shockwave.draw = Draw_Shockwave;
354 shockwave.sw_shotorg_x = ReadCoord(); shockwave.sw_shotorg_y = ReadCoord(); shockwave.sw_shotorg_z = ReadCoord();
355 shockwave.sw_endpos_x = ReadCoord(); shockwave.sw_endpos_y = ReadCoord(); shockwave.sw_endpos_z = ReadCoord();
357 shockwave.sw_spread_max = ReadByte();
358 shockwave.sw_spread_min = ReadByte();
360 shockwave.sv_entnum = ReadByte();
362 shockwave.sw_time = time;
367 .float beam_thickness;
368 .float beam_traileffect;
369 .float beam_hiteffect;
370 .float beam_hitlight[4]; // 0: radius, 123: rgb
371 .float beam_muzzleeffect;
372 .float beam_muzzlelight[4]; // 0: radius, 123: rgb
375 .entity beam_muzzleentity;
377 .float beam_degreespersegment;
378 .float beam_distancepersegment;
379 .float beam_usevieworigin;
380 .float beam_initialized;
381 .float beam_maxangle;
383 .float beam_returnspeed;
384 .float beam_tightness;
385 .vector beam_shotorigin;
388 entity Draw_ArcBeam_callback_entity;
389 vector Draw_ArcBeam_callback_new_dir;
390 float Draw_ArcBeam_callback_segmentdist;
391 float Draw_ArcBeam_callback_last_thickness;
392 vector Draw_ArcBeam_callback_last_top;
393 vector Draw_ArcBeam_callback_last_bottom;
395 void Draw_ArcBeam_callback(vector start, vector hit, vector end)
397 entity beam = Draw_ArcBeam_callback_entity;
398 vector transformed_view_org;
399 transformed_view_org = WarpZone_TransformOrigin(WarpZone_trace_transform, view_origin);
401 vector thickdir = normalize(cross(normalize(start - hit), transformed_view_org - start));
407 if(trace_fraction != 1)
409 // calculate our own hit origin as trace_endpos tends to jump around annoyingly (to player origin?)
410 hitorigin = start + (Draw_ArcBeam_callback_new_dir * Draw_ArcBeam_callback_segmentdist * trace_fraction);
411 hitorigin = WarpZone_TransformOrigin(WarpZone_trace_transform, hitorigin);
421 // decide upon thickness
422 float thickness = beam.beam_thickness;
424 // draw primary beam render
425 vector top = hitorigin + (thickdir * thickness);
426 vector bottom = hitorigin - (thickdir * thickness);
427 //vector last_top = start + (thickdir * Draw_ArcBeam_callback_last_thickness);
428 //vector last_bottom = start - (thickdir * Draw_ArcBeam_callback_last_thickness);
430 R_BeginPolygon(beam.beam_image, DRAWFLAG_NORMAL); // DRAWFLAG_ADDITIVE
433 '0 0.5 0' + ('0 0.5 0' * (thickness / beam.beam_thickness)),
438 Draw_ArcBeam_callback_last_top,
439 '0 0.5 0' + ('0 0.5 0' * (Draw_ArcBeam_callback_last_thickness / beam.beam_thickness)),
444 Draw_ArcBeam_callback_last_bottom,
445 '0 0.5 0' * (1 - (Draw_ArcBeam_callback_last_thickness / beam.beam_thickness)),
451 '0 0.5 0' * (1 - (thickness / beam.beam_thickness)),
457 // draw trailing particles
459 // - Don't use spammy particle counts here, use a FEW small particles around the beam
460 // - We're not using WarpZone_TrailParticles here because we will handle warpzones ourselves.
461 if(beam.beam_traileffect)
463 trailparticles(beam, beam.beam_traileffect, start, hitorigin);
466 // set up for the next
467 Draw_ArcBeam_callback_last_thickness = thickness;
468 Draw_ArcBeam_callback_last_top = top;
469 Draw_ArcBeam_callback_last_bottom = bottom;
474 if(!self.beam_usevieworigin)
476 InterpolateOrigin_Do();
479 // origin = beam starting origin
480 // v_angle = wanted/aim direction
481 // angles = current direction of beam
484 vector wantdir; //= view_forward;
485 vector beamdir; //= self.beam_dir;
488 if(self.beam_usevieworigin)
491 // Currently we have to replicate nearly the same method of figuring
492 // out the shotdir that the server does... Ideally in the future we
493 // should be able to acquire this from a generalized function built
494 // into a weapon system for client code.
496 // find where we are aiming
497 makevectors(view_angles);
499 // decide upon start position
500 if(self.beam_usevieworigin == 2)
501 { start_pos = view_origin; }
503 { start_pos = self.origin; }
505 // trace forward with an estimation
508 start_pos + view_forward * self.beam_range,
513 // untransform in case our trace went through a warpzone
518 vector shothitpos = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); // warpzone support
523 // un-adjust trueaim if shotend is too close
524 if(vlen(shothitpos - view_origin) < g_trueaim_minrange)
525 shothitpos = view_origin + (view_forward * g_trueaim_minrange);
527 // move shot origin to the actual gun muzzle origin
528 vector origin_offset =
529 view_forward * self.beam_shotorigin_x
530 + view_right * -self.beam_shotorigin_y
531 + view_up * self.beam_shotorigin_z;
533 start_pos = start_pos + origin_offset;
535 // calculate the aim direction now
536 wantdir = normalize(shothitpos - start_pos);
538 if(!self.beam_initialized)
540 self.beam_dir = wantdir;
541 self.beam_initialized = TRUE;
544 if(self.beam_dir != wantdir)
546 // calculate how much we're going to move the end of the beam to the want position
547 // WEAPONTODO (server and client):
548 // blendfactor never actually becomes 0 in this situation, which is a problem
549 // regarding precision... this means that self.beam_dir and w_shotdir approach
550 // eachother, however they never actually become the same value with this method.
551 // Perhaps we should do some form of rounding/snapping?
552 float angle = vlen(wantdir - self.beam_dir) * RAD2DEG;
553 if(angle && (angle > self.beam_maxangle))
555 // if the angle is greater than maxangle, force the blendfactor to make this the maximum factor
556 float blendfactor = bound(
558 (1 - (self.beam_returnspeed * frametime)),
559 min(self.beam_maxangle / angle, 1)
561 self.beam_dir = normalize((wantdir * (1 - blendfactor)) + (self.beam_dir * blendfactor));
565 // the radius is not too far yet, no worries :D
566 float blendfactor = bound(
568 (1 - (self.beam_returnspeed * frametime)),
571 self.beam_dir = normalize((wantdir * (1 - blendfactor)) + (self.beam_dir * blendfactor));
574 // calculate how many segments are needed
575 float max_allowed_segments;
577 if(self.beam_distancepersegment)
579 max_allowed_segments = min(
581 1 + (vlen(wantdir / self.beam_distancepersegment))
584 else { max_allowed_segments = ARC_MAX_SEGMENTS; }
586 if(self.beam_degreespersegment)
596 self.beam_degreespersegment
601 else { segments = 1; }
603 else { segments = 1; }
605 // set the beam direction which the rest of the code will refer to
606 beamdir = self.beam_dir;
608 // finally, set self.angles to the proper direction so that muzzle attachment points in proper direction
609 self.angles = fixedvectoangles2(view_forward, view_up);
613 // set the values from the provided info from the networked entity
614 start_pos = self.origin;
615 wantdir = self.v_angle;
616 beamdir = self.angles;
618 if(beamdir != wantdir)
620 float angle = vlen(wantdir - beamdir) * RAD2DEG;
622 // calculate how many segments are needed
623 float max_allowed_segments;
625 if(self.beam_distancepersegment)
627 max_allowed_segments = min(
629 1 + (vlen(wantdir / self.beam_distancepersegment))
632 else { max_allowed_segments = ARC_MAX_SEGMENTS; }
634 if(self.beam_degreespersegment)
644 self.beam_degreespersegment
649 else { segments = 1; }
651 else { segments = 1; }
654 setorigin(self, start_pos);
655 self.beam_muzzleentity.angles_z = random() * 360; // WEAPONTODO: use avelocity instead?
657 vector beam_endpos_estimate = (start_pos + (beamdir * self.beam_range));
659 Draw_ArcBeam_callback_entity = self;
660 Draw_ArcBeam_callback_last_thickness = 0;
661 Draw_ArcBeam_callback_last_top = start_pos;
662 Draw_ArcBeam_callback_last_bottom = start_pos;
664 vector last_origin = start_pos;
667 for(i = 1; i <= segments; ++i)
669 // WEAPONTODO (server and client):
670 // Segment blend and distance should probably really be calculated in a better way,
671 // however I am not sure how to do it properly. There are a few things I have tried,
672 // but most of them do not work properly due to my lack of understanding regarding
673 // the mathematics behind them.
675 // Ideally, we should calculate the positions along a perfect curve
676 // between wantdir and self.beam_dir with an option for depth of arc
678 // Another issue is that (on the client code) we must separate the
679 // curve into multiple rendered curves when handling warpzones.
681 // I can handle this by detecting it for each segment, however that
682 // is a fairly inefficient method in comparison to having a curved line
683 // drawing function similar to Draw_CylindricLine that accepts
684 // top and bottom origins as input, this way there would be no
685 // overlapping edges when connecting the curved pieces.
687 // WEAPONTODO (client):
688 // In order to do nice fading and pointing on the starting segment, we must always
689 // have that drawn as a separate triangle... However, that is difficult to do when
690 // keeping in mind the above problems and also optimizing the amount of segments
691 // drawn on screen at any given time. (Automatic beam quality scaling, essentially)
693 // calculate this on every segment to ensure that we always reach the full length of the attack
694 float segmentblend = bound(0, (i/segments) + self.beam_tightness, 1);
695 float segmentdist = vlen(beam_endpos_estimate - last_origin) * (i/segments);
697 // WEAPONTODO: Apparently, normalize is not the correct function to use here...
698 // Figure out how this actually should work.
699 vector new_dir = normalize(
700 (wantdir * (1 - segmentblend))
702 (normalize(beam_endpos_estimate - last_origin) * segmentblend)
704 vector new_origin = last_origin + (new_dir * segmentdist);
706 Draw_ArcBeam_callback_segmentdist = segmentdist;
707 Draw_ArcBeam_callback_new_dir = new_dir;
709 WarpZone_TraceBox_ThroughZone(
717 Draw_ArcBeam_callback
720 //printf("segment: %d, warpzone transform: %d\n", i, (WarpZone_trace_transform != world));
723 // Figure out some way to detect a collision with geometry with callback...
724 // That way we can know when we are done drawing the beam and skip
725 // the rest of the segments without breaking warpzone support.
727 last_origin = WarpZone_TransformOrigin(WarpZone_trace_transform, new_origin);
728 beam_endpos_estimate = WarpZone_TransformOrigin(WarpZone_trace_transform, beam_endpos_estimate);
731 // startpoint and endpoint drawn visual effects
732 if(self.beam_hiteffect)
741 if(self.beam_hitlight[0])
745 self.beam_hitlight[0],
747 self.beam_hitlight[1],
748 self.beam_hitlight[2],
749 self.beam_hitlight[3]
753 if(self.beam_muzzleeffect)
756 self.beam_muzzleeffect,
757 start_pos + wantdir * 20,
762 if(self.beam_muzzlelight[0])
765 start_pos + wantdir * 20,
766 self.beam_muzzlelight[0],
768 self.beam_muzzlelight[1],
769 self.beam_muzzlelight[2],
770 self.beam_muzzlelight[3]
776 Draw_ArcBeam_callback_entity = world;
777 Draw_ArcBeam_callback_new_dir = '0 0 0';
778 Draw_ArcBeam_callback_segmentdist = 0;
779 Draw_ArcBeam_callback_last_thickness = 0;
780 Draw_ArcBeam_callback_last_top = '0 0 0';
781 Draw_ArcBeam_callback_last_bottom = '0 0 0';
784 void Remove_ArcBeam(void)
786 remove(self.beam_muzzleentity);
787 sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
790 void Ent_ReadArcBeam(float isnew)
792 float sf = ReadByte();
797 // calculate shot origin offset from gun alignment
798 float gunalign = autocvar_cl_gunalign;
799 if(gunalign != 1 && gunalign != 2 && gunalign != 4)
800 gunalign = 3; // default value
803 self.beam_shotorigin = arc_shotorigin[gunalign];
805 // set other main attributes of the beam
806 self.draw = Draw_ArcBeam;
807 self.entremove = Remove_ArcBeam;
808 sound(self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTEN_NORM);
812 flash.effects = EF_ADDITIVE | EF_FULLBRIGHT;
813 flash.drawmask = MASK_NORMAL;
814 flash.solid = SOLID_NOT;
815 setattachment(flash, self, "");
816 setorigin(flash, '0 0 0');
818 self.beam_muzzleentity = flash;
822 flash = self.beam_muzzleentity;
825 if(sf & 1) // settings information
827 self.beam_degreespersegment = ReadShort();
828 self.beam_distancepersegment = ReadShort();
829 self.beam_maxangle = ReadShort();
830 self.beam_range = ReadCoord();
831 self.beam_returnspeed = ReadShort();
832 self.beam_tightness = (ReadByte() / 10);
836 if(autocvar_chase_active)
837 { self.beam_usevieworigin = 1; }
838 else // use view origin
839 { self.beam_usevieworigin = 2; }
843 self.beam_usevieworigin = 0;
847 if(!self.beam_usevieworigin)
849 // self.iflags = IFLAG_ORIGIN | IFLAG_ANGLES | IFLAG_V_ANGLE; // why doesn't this work?
850 self.iflags = IFLAG_ORIGIN;
852 InterpolateOrigin_Undo();
855 if(sf & 2) // starting location
857 self.origin_x = ReadCoord();
858 self.origin_y = ReadCoord();
859 self.origin_z = ReadCoord();
861 else if(self.beam_usevieworigin) // infer the location from player location
863 if(self.beam_usevieworigin == 2)
866 self.origin = view_origin;
870 // use player origin so that third person display still works
871 self.origin = getplayerorigin(player_localnum) + ('0 0 1' * getstati(STAT_VIEWHEIGHT));
875 setorigin(self, self.origin);
877 if(sf & 4) // want/aim direction
879 self.v_angle_x = ReadCoord();
880 self.v_angle_y = ReadCoord();
881 self.v_angle_z = ReadCoord();
884 if(sf & 8) // beam direction
886 self.angles_x = ReadCoord();
887 self.angles_y = ReadCoord();
888 self.angles_z = ReadCoord();
891 if(sf & 16) // beam type
893 self.beam_type = ReadByte();
894 switch(self.beam_type)
898 self.beam_color = '-1 -1 1';
899 self.beam_alpha = 0.5;
900 self.beam_thickness = 8;
901 self.beam_traileffect = FALSE;
902 self.beam_hiteffect = particleeffectnum("electro_lightning");
903 self.beam_hitlight[0] = 0;
904 self.beam_hitlight[1] = 1;
905 self.beam_hitlight[2] = 1;
906 self.beam_hitlight[3] = 1;
907 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
908 self.beam_muzzlelight[0] = 0;
909 self.beam_muzzlelight[1] = 1;
910 self.beam_muzzlelight[2] = 1;
911 self.beam_muzzlelight[3] = 1;
912 self.beam_image = "particles/lgbeam";
913 setmodel(flash, "models/flash.md3");
914 flash.alpha = self.beam_alpha;
915 flash.colormod = self.beam_color;
919 case ARC_BT_WALL: // grenadelauncher_muzzleflash healray_muzzleflash
921 self.beam_color = '0.5 0.5 1';
922 self.beam_alpha = 0.5;
923 self.beam_thickness = 8;
924 self.beam_traileffect = FALSE;
925 self.beam_hiteffect = particleeffectnum("electro_lightning");
926 self.beam_hitlight[0] = 0;
927 self.beam_hitlight[1] = 1;
928 self.beam_hitlight[2] = 1;
929 self.beam_hitlight[3] = 1;
930 self.beam_muzzleeffect = FALSE; // particleeffectnum("grenadelauncher_muzzleflash");
931 self.beam_muzzlelight[0] = 0;
932 self.beam_muzzlelight[1] = 1;
933 self.beam_muzzlelight[2] = 1;
934 self.beam_muzzlelight[3] = 1;
935 self.beam_image = "particles/lgbeam";
936 setmodel(flash, "models/flash.md3");
937 flash.alpha = self.beam_alpha;
938 flash.colormod = self.beam_color;
944 self.beam_color = '0 1 0';
945 self.beam_alpha = 0.5;
946 self.beam_thickness = 8;
947 self.beam_traileffect = FALSE;
948 self.beam_hiteffect = particleeffectnum("healray_impact");
949 self.beam_hitlight[0] = 0;
950 self.beam_hitlight[1] = 1;
951 self.beam_hitlight[2] = 1;
952 self.beam_hitlight[3] = 1;
953 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
954 self.beam_muzzlelight[0] = 0;
955 self.beam_muzzlelight[1] = 1;
956 self.beam_muzzlelight[2] = 1;
957 self.beam_muzzlelight[3] = 1;
958 self.beam_image = "particles/lgbeam";
959 setmodel(flash, "models/flash.md3");
960 flash.alpha = self.beam_alpha;
961 flash.colormod = self.beam_color;
967 self.beam_color = '1 0 1';
968 self.beam_alpha = 0.5;
969 self.beam_thickness = 8;
970 self.beam_traileffect = particleeffectnum("nex_beam");
971 self.beam_hiteffect = particleeffectnum("electro_lightning");
972 self.beam_hitlight[0] = 20;
973 self.beam_hitlight[1] = 1;
974 self.beam_hitlight[2] = 0;
975 self.beam_hitlight[3] = 0;
976 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
977 self.beam_muzzlelight[0] = 50;
978 self.beam_muzzlelight[1] = 1;
979 self.beam_muzzlelight[2] = 0;
980 self.beam_muzzlelight[3] = 0;
981 self.beam_image = "particles/lgbeam";
982 setmodel(flash, "models/flash.md3");
983 flash.alpha = self.beam_alpha;
984 flash.colormod = self.beam_color;
988 case ARC_BT_BURST_MISS:
990 self.beam_color = '-1 -1 1';
991 self.beam_alpha = 0.5;
992 self.beam_thickness = 14;
993 self.beam_traileffect = FALSE;
994 self.beam_hiteffect = particleeffectnum("electro_lightning");
995 self.beam_hitlight[0] = 0;
996 self.beam_hitlight[1] = 1;
997 self.beam_hitlight[2] = 1;
998 self.beam_hitlight[3] = 1;
999 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
1000 self.beam_muzzlelight[0] = 0;
1001 self.beam_muzzlelight[1] = 1;
1002 self.beam_muzzlelight[2] = 1;
1003 self.beam_muzzlelight[3] = 1;
1004 self.beam_image = "particles/lgbeam";
1005 setmodel(flash, "models/flash.md3");
1006 flash.alpha = self.beam_alpha;
1007 flash.colormod = self.beam_color;
1011 case ARC_BT_BURST_WALL:
1013 self.beam_color = '0.5 0.5 1';
1014 self.beam_alpha = 0.5;
1015 self.beam_thickness = 14;
1016 self.beam_traileffect = FALSE;
1017 self.beam_hiteffect = particleeffectnum("electro_lightning");
1018 self.beam_hitlight[0] = 0;
1019 self.beam_hitlight[1] = 1;
1020 self.beam_hitlight[2] = 1;
1021 self.beam_hitlight[3] = 1;
1022 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
1023 self.beam_muzzlelight[0] = 0;
1024 self.beam_muzzlelight[1] = 1;
1025 self.beam_muzzlelight[2] = 1;
1026 self.beam_muzzlelight[3] = 1;
1027 self.beam_image = "particles/lgbeam";
1028 setmodel(flash, "models/flash.md3");
1029 flash.alpha = self.beam_alpha;
1030 flash.colormod = self.beam_color;
1034 case ARC_BT_BURST_HEAL:
1036 self.beam_color = '0 1 0';
1037 self.beam_alpha = 0.5;
1038 self.beam_thickness = 14;
1039 self.beam_traileffect = FALSE;
1040 self.beam_hiteffect = particleeffectnum("electro_lightning");
1041 self.beam_hitlight[0] = 0;
1042 self.beam_hitlight[1] = 1;
1043 self.beam_hitlight[2] = 1;
1044 self.beam_hitlight[3] = 1;
1045 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
1046 self.beam_muzzlelight[0] = 0;
1047 self.beam_muzzlelight[1] = 1;
1048 self.beam_muzzlelight[2] = 1;
1049 self.beam_muzzlelight[3] = 1;
1050 self.beam_image = "particles/lgbeam";
1051 setmodel(flash, "models/flash.md3");
1052 flash.alpha = self.beam_alpha;
1053 flash.colormod = self.beam_color;
1057 case ARC_BT_BURST_HIT:
1059 self.beam_color = '1 0 1';
1060 self.beam_alpha = 0.5;
1061 self.beam_thickness = 14;
1062 self.beam_traileffect = FALSE;
1063 self.beam_hiteffect = particleeffectnum("electro_lightning");
1064 self.beam_hitlight[0] = 0;
1065 self.beam_hitlight[1] = 1;
1066 self.beam_hitlight[2] = 1;
1067 self.beam_hitlight[3] = 1;
1068 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
1069 self.beam_muzzlelight[0] = 0;
1070 self.beam_muzzlelight[1] = 1;
1071 self.beam_muzzlelight[2] = 1;
1072 self.beam_muzzlelight[3] = 1;
1073 self.beam_image = "particles/lgbeam";
1074 setmodel(flash, "models/flash.md3");
1075 flash.alpha = self.beam_alpha;
1076 flash.colormod = self.beam_color;
1081 // shouldn't be possible, but lets make it colorful if it does :D
1084 self.beam_color = randomvec();
1085 self.beam_alpha = 1;
1086 self.beam_thickness = 8;
1087 self.beam_traileffect = FALSE;
1088 self.beam_hiteffect = FALSE;
1089 self.beam_hitlight[0] = 0;
1090 self.beam_hitlight[1] = 1;
1091 self.beam_hitlight[2] = 1;
1092 self.beam_hitlight[3] = 1;
1093 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
1094 self.beam_muzzlelight[0] = 0;
1095 self.beam_muzzlelight[1] = 1;
1096 self.beam_muzzlelight[2] = 1;
1097 self.beam_muzzlelight[3] = 1;
1098 self.beam_image = "particles/lgbeam";
1099 setmodel(flash, "models/flash.md3");
1100 flash.alpha = self.beam_alpha;
1101 flash.colormod = self.beam_color;
1108 if(!self.beam_usevieworigin)
1110 InterpolateOrigin_Note();