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);
\r
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);
\r
17 void b_make(vector s,vector e, string t,float l,float z)
\r
25 b.think = SUB_Remove;
\r
26 b.nextthink = time + l;
\r
29 //b.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
\r
33 void cl_effetcs_lightningarc(vector from, vector to,float seglength,float drifts,float drifte,float branchfactor,float branchfactor_add)
\r
35 vector direction,dirnew, pos, pos_l;
\r
36 float length, steps, steplength, i,drift;
\r
38 length = vlen(from - to);
\r
42 steps = floor(length / seglength);
\r
45 te_lightning1(world,from,to);
\r
49 steplength = length / steps;
\r
50 direction = normalize(to - from);
\r
52 if(length > seglength)
\r
54 for(i = 1; i < steps; i += 1)
\r
56 drift = drifts * (1 - (i / steps)) + drifte * (i / steps);
\r
57 dirnew = normalize(direction * (1 - drift) + randomvec() * drift);
\r
58 pos = pos_l + dirnew * steplength;
\r
59 te_lightning1(world,pos_l,pos);
\r
60 //b_make(pos_l, pos,"particles/lightning2",0.25,64);
\r
61 if(random() < branchfactor)
\r
62 cl_effetcs_lightningarc(pos, pos + (dirnew * length * 0.25),seglength,drifts,drifte,min(branchfactor + branchfactor_add,1),branchfactor_add);
\r
66 te_lightning1(world,pos_l,to);
\r
67 //b_make(pos_l, to,"particles/lightning2",0.25,64);
\r
71 te_lightning1(world,from,to);
\r
72 //b_make(from, to,"particles/lightning2",0.25,64);
\r
76 void Net_ReadLightningarc()
\r
80 from_x = ReadCoord(); from_y = ReadCoord(); from_z = ReadCoord();
\r
81 to_x = ReadCoord(); to_y = ReadCoord(); to_z = ReadCoord();
\r
83 if(cvar("cl_effects_lightningarc_simple"))
\r
85 te_lightning1(world,from,to);
\r
89 float seglength, drifts, drifte, branchfactor, branchfactor_add;
\r
91 seglength = cvar("cl_effects_lightningarc_segmentlength");
\r
92 drifts = cvar("cl_effects_lightningarc_drift_start");
\r
93 drifte = cvar("cl_effects_lightningarc_drift_end");
\r
94 branchfactor = cvar("cl_effects_lightningarc_branchfactor_start");
\r
95 branchfactor = cvar("cl_effects_lightningarc_branchfactor_add");
\r
97 cl_effetcs_lightningarc(from,to,seglength,drifts,drifte,branchfactor,branchfactor_add);
\r