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_usevieworigin;
378 .float beam_initialized;
379 .float beam_maxangle;
381 .float beam_returnspeed;
382 .float beam_tightness;
383 .vector beam_shotorigin;
386 entity Draw_ArcBeam_callback_entity;
387 vector Draw_ArcBeam_callback_new_dir;
388 float Draw_ArcBeam_callback_segmentdist;
389 float Draw_ArcBeam_callback_last_thickness;
390 vector Draw_ArcBeam_callback_last_top;
391 vector Draw_ArcBeam_callback_last_bottom;
393 void Draw_ArcBeam_callback(vector start, vector hit, vector end)
395 entity beam = Draw_ArcBeam_callback_entity;
396 vector transformed_view_org;
397 transformed_view_org = WarpZone_TransformOrigin(WarpZone_trace_transform, view_origin);
399 vector thickdir = normalize(cross(normalize(start - hit), transformed_view_org - start));
405 if(trace_fraction != 1)
407 // calculate our own hit origin as trace_endpos tends to jump around annoyingly (to player origin?)
408 hitorigin = start + (Draw_ArcBeam_callback_new_dir * Draw_ArcBeam_callback_segmentdist * trace_fraction);
409 hitorigin = WarpZone_TransformOrigin(WarpZone_trace_transform, hitorigin);
419 // decide upon thickness
420 float thickness = beam.beam_thickness;
422 // draw primary beam render
423 vector top = hitorigin + (thickdir * thickness);
424 vector bottom = hitorigin - (thickdir * thickness);
425 vector last_top = start + (thickdir * Draw_ArcBeam_callback_last_thickness);
426 vector last_bottom = start - (thickdir * Draw_ArcBeam_callback_last_thickness);
428 R_BeginPolygon(beam.beam_image, DRAWFLAG_NORMAL); // DRAWFLAG_ADDITIVE
431 '0 0.5 0' + ('0 0.5 0' * (thickness / beam.beam_thickness)),
437 '0 0.5 0' + ('0 0.5 0' * (Draw_ArcBeam_callback_last_thickness / beam.beam_thickness)),
443 '0 0.5 0' * (1 - (Draw_ArcBeam_callback_last_thickness / beam.beam_thickness)),
449 '0 0.5 0' * (1 - (thickness / beam.beam_thickness)),
455 // draw trailing particles
457 // - Don't use spammy particle counts here, use a FEW small particles around the beam
458 // - We're not using WarpZone_TrailParticles here because we will handle warpzones ourselves.
459 if(beam.beam_traileffect)
461 trailparticles(beam, beam.beam_traileffect, start, hitorigin);
464 // set up for the next
465 Draw_ArcBeam_callback_last_thickness = thickness;
466 Draw_ArcBeam_callback_last_top = top;
467 Draw_ArcBeam_callback_last_bottom = bottom;
472 if(!self.beam_usevieworigin)
474 InterpolateOrigin_Do();
477 // origin = beam starting origin
478 // v_angle = wanted/aim direction
479 // angles = current direction of beam
482 vector wantdir; //= view_forward;
483 vector beamdir; //= self.beam_dir;
486 if(self.beam_usevieworigin)
489 // Currently we have to replicate nearly the same method of figuring
490 // out the shotdir that the server does... Ideally in the future we
491 // should be able to acquire this from a generalized function built
492 // into a weapon system for client code.
494 // find where we are aiming
495 makevectors(view_angles);
497 // decide upon start position
498 if(self.beam_usevieworigin == 2)
499 { start_pos = view_origin; }
501 { start_pos = self.origin; }
503 // trace forward with an estimation
504 WarpZone_TraceLine(start_pos, start_pos + view_forward * self.beam_range, MOVE_NOMONSTERS, self);
506 // untransform in case our trace went through a warpzone
511 vector shothitpos = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); // warpzone support
516 // un-adjust trueaim if shotend is too close
517 if(vlen(shothitpos - view_origin) < g_trueaim_minrange)
518 shothitpos = view_origin + (view_forward * g_trueaim_minrange);
520 // move shot origin to the actual gun muzzle origin
521 vector origin_offset = view_forward * self.beam_shotorigin_x + view_right * -self.beam_shotorigin_y + view_up * self.beam_shotorigin_z;
522 start_pos = start_pos + origin_offset;
524 // calculate the aim direction now
525 wantdir = normalize(shothitpos - start_pos);
527 if(!self.beam_initialized)
529 self.beam_dir = wantdir;
530 self.beam_initialized = TRUE;
533 // WEAPONTODO: Calculate segments dyanmically similarly to the server code
535 if(self.beam_dir != wantdir)
537 float angle = ceil(vlen(wantdir - self.beam_dir) * RAD2DEG);
539 if(angle && (angle > self.beam_maxangle))
541 // if the angle is greater than maxangle, force the blendfactor to make this the maximum factor
542 anglelimit = min(self.beam_maxangle / angle, 1);
546 // the radius is not too far yet, no worries :D
550 // calculate how much we're going to move the end of the beam to the want position
551 float blendfactor = bound(0, anglelimit * (1 - (self.beam_returnspeed * frametime)), 1);
552 self.beam_dir = normalize((wantdir * (1 - blendfactor)) + (self.beam_dir * blendfactor));
554 // WEAPONTODO (server and client):
555 // blendfactor never actually becomes 0 in this situation, which is a problem
556 // regarding precision... this means that self.beam_dir and w_shotdir approach
557 // eachother, however they never actually become the same value with this method.
559 // Perhaps we should do some form of rounding/snapping?
561 // printf("blendfactor = %f\n", blendfactor);
564 // calculate how many segments are needed
565 float max_allowed_segments;
567 if(WEP_CVAR(arc, beam_distancepersegment))
568 max_allowed_segments = min(ARC_MAX_SEGMENTS, 1 + (vlen(w_shotdir / WEP_CVAR(arc, beam_distancepersegment))));
570 max_allowed_segments = ARC_MAX_SEGMENTS;
572 if(WEP_CVAR(arc, beam_degreespersegment))
574 segments = min( max(1, ( min(angle, WEP_CVAR(arc, beam_maxangle)) / WEP_CVAR(arc, beam_degreespersegment) ) ), max_allowed_segments );
589 // set the beam direction which the rest of the code will refer to
590 beamdir = self.beam_dir;
592 // finally, set self.angles to the proper direction so that muzzle attachment points in proper direction
593 self.angles = fixedvectoangles2(view_forward, view_up);
597 // set the values from the provided info from the networked entity
598 start_pos = self.origin;
599 wantdir = self.v_angle;
600 beamdir = self.angles;
602 // WEAPONTODO: Calculate segments dyanmically similarly to the server code
605 if(beamdir != wantdir)
607 // calculate how many segments are needed
608 float max_allowed_segments;
610 if(WEP_CVAR(arc, beam_distancepersegment))
611 max_allowed_segments = min(ARC_MAX_SEGMENTS, 1 + (vlen(w_shotdir / WEP_CVAR(arc, beam_distancepersegment))));
613 max_allowed_segments = ARC_MAX_SEGMENTS;
615 if(WEP_CVAR(arc, beam_degreespersegment))
617 segments = min( max(1, ( min(angle, WEP_CVAR(arc, beam_maxangle)) / WEP_CVAR(arc, beam_degreespersegment) ) ), max_allowed_segments );
631 setorigin(self, start_pos);
632 self.beam_muzzleentity.angles_z = random() * 360; // WEAPONTODO: use avelocity instead?
634 vector beam_endpos_estimate = (start_pos + (beamdir * self.beam_range));
636 Draw_ArcBeam_callback_entity = self;
637 Draw_ArcBeam_callback_last_thickness = 0;
638 Draw_ArcBeam_callback_last_top = start_pos;
639 Draw_ArcBeam_callback_last_bottom = start_pos;
641 vector last_origin = start_pos;
642 //vector hitorigin = start_pos;
645 for(i = 1; i <= segments; ++i)
647 // WEAPONTODO (server and client):
648 // Segment blend and distance should probably really be calculated in a better way,
649 // however I am not sure how to do it properly. There are a few things I have tried,
650 // but most of them do not work properly due to my lack of understanding regarding
651 // the mathematics behind them.
653 // Ideally, we should calculate the positions along a perfect curve
654 // between wantdir and self.beam_dir with an option for depth of arc
656 // Another issue is that (on the client code) we must separate the
657 // curve into multiple rendered curves when handling warpzones.
659 // I can handle this by detecting it for each segment, however that
660 // is a fairly inefficient method in comparison to having a curved line
661 // drawing function similar to Draw_CylindricLine that accepts
662 // top and bottom origins as input, this way there would be no
663 // overlapping edges when connecting the curved pieces.
665 // WEAPONTODO (client):
666 // In order to do nice fading and pointing on the starting segment, we must always
667 // have that drawn as a separate triangle... However, that is difficult to do when
668 // keeping in mind the above problems and also optimizing the amount of segments
669 // drawn on screen at any given time. (Automatic beam quality scaling, essentially)
671 // calculate this on every segment to ensure that we always reach the full length of the attack
672 float segmentblend = bound(0, (i/segments) + self.beam_tightness, 1);
673 float segmentdist = vlen(beam_endpos_estimate - last_origin) * (i/segments);
675 vector new_dir = normalize( (wantdir * (1 - segmentblend)) + (normalize(beam_endpos_estimate - last_origin) * segmentblend) );
676 vector new_origin = last_origin + (new_dir * segmentdist);
678 Draw_ArcBeam_callback_segmentdist = segmentdist;
679 Draw_ArcBeam_callback_new_dir = new_dir;
681 WarpZone_TraceBox_ThroughZone(
689 Draw_ArcBeam_callback
693 // Figure out some way to detect a collision with geometry with callback...
694 // That way we can know when we are done drawing the beam and skip
695 // the rest of the segments without breaking warpzone support.
697 last_origin = WarpZone_TransformOrigin(WarpZone_trace_transform, new_origin);
698 beam_endpos_estimate = WarpZone_TransformOrigin(WarpZone_trace_transform, beam_endpos_estimate);
701 if(self.beam_hiteffect)
703 pointparticles(self.beam_hiteffect, last_origin, beamdir * -1, frametime * 2);
705 if(self.beam_hitlight[0])
707 adddynamiclight(last_origin, self.beam_hitlight[0], vec3(self.beam_hitlight[1], self.beam_hitlight[2], self.beam_hitlight[3]));
709 if(self.beam_muzzleeffect)
711 pointparticles(self.beam_muzzleeffect, start_pos + wantdir * 20, wantdir * 1000, frametime * 0.1);
713 if(self.beam_muzzlelight[0])
715 adddynamiclight(start_pos + wantdir * 20, self.beam_muzzlelight[0], vec3(self.beam_muzzlelight[1], self.beam_muzzlelight[2], self.beam_muzzlelight[3]));
719 Draw_ArcBeam_callback_entity = world;
720 Draw_ArcBeam_callback_new_dir = '0 0 0';
721 Draw_ArcBeam_callback_segmentdist = 0;
722 Draw_ArcBeam_callback_last_thickness = 0;
723 Draw_ArcBeam_callback_last_top = '0 0 0';
724 Draw_ArcBeam_callback_last_bottom = '0 0 0';
727 void Remove_ArcBeam(void)
729 remove(self.beam_muzzleentity);
730 sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
733 void Ent_ReadArcBeam(float isnew)
735 float sf = ReadByte();
740 // calculate shot origin offset from gun alignment
741 float gunalign = autocvar_cl_gunalign;
742 if(gunalign != 1 && gunalign != 2 && gunalign != 4)
743 gunalign = 3; // default value
746 self.beam_shotorigin = arc_shotorigin[gunalign];
748 // set other main attributes of the beam
749 self.draw = Draw_ArcBeam;
750 self.entremove = Remove_ArcBeam;
751 sound(self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTEN_NORM);
755 flash.effects = EF_ADDITIVE | EF_FULLBRIGHT;
756 flash.drawmask = MASK_NORMAL;
757 flash.solid = SOLID_NOT;
758 setattachment(flash, self, "");
759 setorigin(flash, '0 0 0');
761 self.beam_muzzleentity = flash;
765 flash = self.beam_muzzleentity;
768 if(sf & 1) // settings information
770 self.beam_maxangle = ReadShort();
771 self.beam_range = ReadCoord();
772 self.beam_returnspeed = ReadShort();
773 self.beam_tightness = (ReadByte() / 10);
777 if(autocvar_chase_active)
778 { self.beam_usevieworigin = 1; }
779 else // use view origin
780 { self.beam_usevieworigin = 2; }
784 self.beam_usevieworigin = 0;
788 if(!self.beam_usevieworigin)
790 // self.iflags = IFLAG_ORIGIN | IFLAG_ANGLES | IFLAG_V_ANGLE; // why doesn't this work?
791 self.iflags = IFLAG_ORIGIN;
793 InterpolateOrigin_Undo();
796 if(sf & 2) // starting location
798 self.origin_x = ReadCoord();
799 self.origin_y = ReadCoord();
800 self.origin_z = ReadCoord();
802 else if(self.beam_usevieworigin) // infer the location from player location
804 if(self.beam_usevieworigin == 2)
807 self.origin = view_origin;
811 // use player origin so that third person display still works
812 self.origin = getplayerorigin(player_localnum) + ('0 0 1' * getstati(STAT_VIEWHEIGHT));
816 setorigin(self, self.origin);
818 if(sf & 4) // want/aim direction
820 self.v_angle_x = ReadCoord();
821 self.v_angle_y = ReadCoord();
822 self.v_angle_z = ReadCoord();
825 if(sf & 8) // beam direction
827 self.angles_x = ReadCoord();
828 self.angles_y = ReadCoord();
829 self.angles_z = ReadCoord();
832 if(sf & 16) // beam type
834 self.beam_type = ReadByte();
835 switch(self.beam_type)
839 self.beam_color = '-1 -1 1';
840 self.beam_alpha = 0.5;
841 self.beam_thickness = 8;
842 self.beam_traileffect = FALSE;
843 self.beam_hiteffect = particleeffectnum("electro_lightning");
844 self.beam_hitlight[0] = 0;
845 self.beam_hitlight[1] = 1;
846 self.beam_hitlight[2] = 1;
847 self.beam_hitlight[3] = 1;
848 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
849 self.beam_muzzlelight[0] = 0;
850 self.beam_muzzlelight[1] = 1;
851 self.beam_muzzlelight[2] = 1;
852 self.beam_muzzlelight[3] = 1;
853 self.beam_image = "particles/lgbeam";
854 setmodel(flash, "models/flash.md3");
855 flash.alpha = self.beam_alpha;
856 flash.colormod = self.beam_color;
860 case ARC_BT_WALL: // grenadelauncher_muzzleflash healray_muzzleflash
862 self.beam_color = '0.5 0.5 1';
863 self.beam_alpha = 0.5;
864 self.beam_thickness = 8;
865 self.beam_traileffect = FALSE;
866 self.beam_hiteffect = particleeffectnum("electro_lightning");
867 self.beam_hitlight[0] = 0;
868 self.beam_hitlight[1] = 1;
869 self.beam_hitlight[2] = 1;
870 self.beam_hitlight[3] = 1;
871 self.beam_muzzleeffect = FALSE; // particleeffectnum("grenadelauncher_muzzleflash");
872 self.beam_muzzlelight[0] = 0;
873 self.beam_muzzlelight[1] = 1;
874 self.beam_muzzlelight[2] = 1;
875 self.beam_muzzlelight[3] = 1;
876 self.beam_image = "particles/lgbeam";
877 setmodel(flash, "models/flash.md3");
878 flash.alpha = self.beam_alpha;
879 flash.colormod = self.beam_color;
885 self.beam_color = '0 1 0';
886 self.beam_alpha = 0.5;
887 self.beam_thickness = 8;
888 self.beam_traileffect = FALSE;
889 self.beam_hiteffect = particleeffectnum("healray_impact");
890 self.beam_hitlight[0] = 0;
891 self.beam_hitlight[1] = 1;
892 self.beam_hitlight[2] = 1;
893 self.beam_hitlight[3] = 1;
894 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
895 self.beam_muzzlelight[0] = 0;
896 self.beam_muzzlelight[1] = 1;
897 self.beam_muzzlelight[2] = 1;
898 self.beam_muzzlelight[3] = 1;
899 self.beam_image = "particles/lgbeam";
900 setmodel(flash, "models/flash.md3");
901 flash.alpha = self.beam_alpha;
902 flash.colormod = self.beam_color;
908 self.beam_color = '1 0 1';
909 self.beam_alpha = 0.5;
910 self.beam_thickness = 8;
911 self.beam_traileffect = particleeffectnum("nex_beam");
912 self.beam_hiteffect = particleeffectnum("electro_lightning");
913 self.beam_hitlight[0] = 20;
914 self.beam_hitlight[1] = 1;
915 self.beam_hitlight[2] = 0;
916 self.beam_hitlight[3] = 0;
917 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
918 self.beam_muzzlelight[0] = 50;
919 self.beam_muzzlelight[1] = 1;
920 self.beam_muzzlelight[2] = 0;
921 self.beam_muzzlelight[3] = 0;
922 self.beam_image = "particles/lgbeam";
923 setmodel(flash, "models/flash.md3");
924 flash.alpha = self.beam_alpha;
925 flash.colormod = self.beam_color;
929 case ARC_BT_BURST_MISS:
931 self.beam_color = '-1 -1 1';
932 self.beam_alpha = 0.5;
933 self.beam_thickness = 14;
934 self.beam_traileffect = FALSE;
935 self.beam_hiteffect = particleeffectnum("electro_lightning");
936 self.beam_hitlight[0] = 0;
937 self.beam_hitlight[1] = 1;
938 self.beam_hitlight[2] = 1;
939 self.beam_hitlight[3] = 1;
940 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
941 self.beam_muzzlelight[0] = 0;
942 self.beam_muzzlelight[1] = 1;
943 self.beam_muzzlelight[2] = 1;
944 self.beam_muzzlelight[3] = 1;
945 self.beam_image = "particles/lgbeam";
946 setmodel(flash, "models/flash.md3");
947 flash.alpha = self.beam_alpha;
948 flash.colormod = self.beam_color;
952 case ARC_BT_BURST_WALL:
954 self.beam_color = '0.5 0.5 1';
955 self.beam_alpha = 0.5;
956 self.beam_thickness = 14;
957 self.beam_traileffect = FALSE;
958 self.beam_hiteffect = particleeffectnum("electro_lightning");
959 self.beam_hitlight[0] = 0;
960 self.beam_hitlight[1] = 1;
961 self.beam_hitlight[2] = 1;
962 self.beam_hitlight[3] = 1;
963 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
964 self.beam_muzzlelight[0] = 0;
965 self.beam_muzzlelight[1] = 1;
966 self.beam_muzzlelight[2] = 1;
967 self.beam_muzzlelight[3] = 1;
968 self.beam_image = "particles/lgbeam";
969 setmodel(flash, "models/flash.md3");
970 flash.alpha = self.beam_alpha;
971 flash.colormod = self.beam_color;
975 case ARC_BT_BURST_HEAL:
977 self.beam_color = '0 1 0';
978 self.beam_alpha = 0.5;
979 self.beam_thickness = 14;
980 self.beam_traileffect = FALSE;
981 self.beam_hiteffect = particleeffectnum("electro_lightning");
982 self.beam_hitlight[0] = 0;
983 self.beam_hitlight[1] = 1;
984 self.beam_hitlight[2] = 1;
985 self.beam_hitlight[3] = 1;
986 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
987 self.beam_muzzlelight[0] = 0;
988 self.beam_muzzlelight[1] = 1;
989 self.beam_muzzlelight[2] = 1;
990 self.beam_muzzlelight[3] = 1;
991 self.beam_image = "particles/lgbeam";
992 setmodel(flash, "models/flash.md3");
993 flash.alpha = self.beam_alpha;
994 flash.colormod = self.beam_color;
998 case ARC_BT_BURST_HIT:
1000 self.beam_color = '1 0 1';
1001 self.beam_alpha = 0.5;
1002 self.beam_thickness = 14;
1003 self.beam_traileffect = FALSE;
1004 self.beam_hiteffect = particleeffectnum("electro_lightning");
1005 self.beam_hitlight[0] = 0;
1006 self.beam_hitlight[1] = 1;
1007 self.beam_hitlight[2] = 1;
1008 self.beam_hitlight[3] = 1;
1009 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
1010 self.beam_muzzlelight[0] = 0;
1011 self.beam_muzzlelight[1] = 1;
1012 self.beam_muzzlelight[2] = 1;
1013 self.beam_muzzlelight[3] = 1;
1014 self.beam_image = "particles/lgbeam";
1015 setmodel(flash, "models/flash.md3");
1016 flash.alpha = self.beam_alpha;
1017 flash.colormod = self.beam_color;
1022 // shouldn't be possible, but lets make it colorful if it does :D
1025 self.beam_color = randomvec();
1026 self.beam_alpha = 1;
1027 self.beam_thickness = 8;
1028 self.beam_traileffect = FALSE;
1029 self.beam_hiteffect = FALSE;
1030 self.beam_hitlight[0] = 0;
1031 self.beam_hitlight[1] = 1;
1032 self.beam_hitlight[2] = 1;
1033 self.beam_hitlight[3] = 1;
1034 self.beam_muzzleeffect = FALSE; //particleeffectnum("nex_muzzleflash");
1035 self.beam_muzzlelight[0] = 0;
1036 self.beam_muzzlelight[1] = 1;
1037 self.beam_muzzlelight[2] = 1;
1038 self.beam_muzzlelight[3] = 1;
1039 self.beam_image = "particles/lgbeam";
1040 setmodel(flash, "models/flash.md3");
1041 flash.alpha = self.beam_alpha;
1042 flash.colormod = self.beam_color;
1049 if(!self.beam_usevieworigin)
1051 InterpolateOrigin_Note();