13 //Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, 0, time * 3, '1 1 1', 0.7, DRAWFLAG_ADDITIVE, view_origin);
14 Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, (self.fx_with/256), 0, '1 1 1', 1, DRAWFLAG_ADDITIVE, view_origin);
17 void b_make(vector s,vector e, string t,float l,float z)
26 b.nextthink = time + l;
29 //b.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
33 void cl_effetcs_lightningarc(vector from, vector to,float seglength,float drifts,float drifte,float branchfactor,float branchfactor_add)
35 vector direction,dirnew, pos, pos_l;
36 float length, steps, steplength, i,drift;
38 length = vlen(from - to);
42 steps = floor(length / seglength);
45 te_lightning1(world,from,to);
49 steplength = length / steps;
50 direction = normalize(to - from);
52 if(length > seglength)
54 for(i = 1; i < steps; i += 1)
56 drift = drifts * (1 - (i / steps)) + drifte * (i / steps);
57 dirnew = normalize(direction * (1 - drift) + randomvec() * drift);
58 pos = pos_l + dirnew * steplength;
59 te_lightning1(world,pos_l,pos);
60 if(random() < branchfactor)
61 cl_effetcs_lightningarc(pos, pos + (dirnew * length * 0.25),seglength,drifts,drifte,min(branchfactor + branchfactor_add,1),branchfactor_add);
65 te_lightning1(world,pos_l,to);
69 te_lightning1(world,from,to);
73 void Net_ReadLightningarc()
77 from_x = ReadCoord(); from_y = ReadCoord(); from_z = ReadCoord();
78 to_x = ReadCoord(); to_y = ReadCoord(); to_z = ReadCoord();
80 if(autocvar_cl_effects_lightningarc_simple)
82 te_lightning1(world,from,to);
86 float seglength, drifts, drifte, branchfactor, branchfactor_add;
88 seglength = autocvar_cl_effects_lightningarc_segmentlength;
89 drifts = autocvar_cl_effects_lightningarc_drift_start;
90 drifte = autocvar_cl_effects_lightningarc_drift_end;
91 branchfactor = autocvar_cl_effects_lightningarc_branchfactor_start;
92 branchfactor_add = autocvar_cl_effects_lightningarc_branchfactor_add;
94 cl_effetcs_lightningarc(from,to,seglength,drifts,drifte,branchfactor,branchfactor_add);
98 void Net_ReadArc() { Net_ReadLightningarc(); }