1- class ClientShockBeam extends Effects ;
2-
3- // Settings
4- var int Team ;
5- var float Size ;
6- var float Curve ;
7- var float Duration ;
8- var vector MoveAmount ;
9- var int NumPuffs ;
10- var bool bBeamEnableLight ;
11-
12- //
13- var float TimeLeft ;
14-
15- var ClientShockBeam Next ;
16- var ClientShockBeam Free ;
17-
18- simulated function Tick (float DeltaTime ) {
19- if (Level .NetMode != NM_DedicatedServer ) {
20- ScaleGlow = (TimeLeft / Duration ) ** Curve ;
21-
22- AmbientGlow = ScaleGlow * 210 ;
23- if (Team >= 0 )
24- LightBrightness = ScaleGlow * 128 ;
25-
26- TimeLeft -= DeltaTime ;
27- if (TimeLeft <= 0.0 ) {
28- FreeBeam (self );
29- }
30- }
31- }
32-
33- simulated function SetProperties (int pTeam , float pSize , float pCurve , float pDuration , vector pMoveAmount , int pNumPuffs , bool pbBeamEnableLight ) {
34- Team = pTeam ;
35- Size = pSize ;
36- Duration = pDuration ;
37- Curve = pCurve ;
38- MoveAmount = pMoveAmount ;
39- NumPuffs = pNumPuffs ;
40- bBeamEnableLight = pbBeamEnableLight ;
41-
42- if (Team >= 0 ) {
43- Mesh = LodMesh 'Botpack.Shockbm' ;
44- if (bBeamEnableLight && Level .bHighDetailMode )
45- LightType = LT_Steady ;
46- else
47- LightType = LT_None ;
48- LightEffect = LE_NonIncidence ;
49- LightBrightness = 192 ;
50- LightSaturation = 64 ;
51- LightRadius = 6 ;
52- }
53-
54- switch (Team ) {
55- case -1 :
56- // Dont
57- break ;
58-
59- case 0 :
60- Texture = Texture 'BotPack.Translocator.Tranglow' ;
61- LightHue = 0 ;
62- breaK ;
63-
64- case 1 :
65- Texture = Texture 'BotPack.Translocator.Tranglowb' ;
66- LightHue = 150 ;
67- LightBrightness = 224 ;
68- break ;
69-
70- case 2 :
71- Texture = Texture 'BotPack.Translocator.Tranglowg' ;
72- LightHue = 75 ;
73- break ;
74-
75- case 3 :
76- Texture = Texture 'BotPack.Translocator.Tranglowy' ;
77- LightHue = 40 ;
78- break ;
79- }
80- DrawScale = 0.44 * Size ;
81- TimeLeft = Duration ;
82-
83- if (Level .NetMode != NM_DedicatedServer )
84- SetTimer (0.05 , false );
85- }
86-
87- simulated function Timer () {
88- local ClientShockBeam r ;
89-
90- if (NumPuffs > 0 ) {
91- r = AllocBeam (PlayerPawn (Owner ));
92- r .SetLocation (Location + MoveAmount );
93- r .SetRotation (Rotation );
94- r .SetProperties (Team ,Size ,Curve ,Duration ,MoveAmount , NumPuffs - 1 , bBeamEnableLight );
95- }
96- }
97-
98- static final function ResetBeam (ClientShockBeam Beam ) {
99- Beam .Texture = default .Texture ;
100- Beam .Mesh = default .Mesh ;
101- Beam .LightType = default .LightType ;
102- Beam .LightEffect = default .LightEffect ;
103- Beam .LightBrightness = default .LightBrightness ;
104- Beam .LightSaturation = default .LightSaturation ;
105- Beam .LightRadius = default .LightRadius ;
106- Beam .LightHue = default .LightHue ;
107- }
108-
109- static final function ClientShockBeam AllocBeam (PlayerPawn P ) {
110- local ClientShockBeam Beam ;
111-
112- if (default .Free != none ) {
113- Beam = default .Free ;
114- default .Free = Beam .Next ;
115- Beam .Next = none ;
116-
117- Beam .bHidden = false ;
118- Beam .Enable ('Tick' );
119- } else {
120- Beam = P .Spawn (class 'ClientShockBeam' , P );
121- }
122-
123- ResetBeam (Beam );
124- return Beam ;
125- }
126-
127- static final function FreeBeam (ClientShockBeam Beam ) {
128- Beam .bHidden = true ;
129- Beam .LightType = LT_None ;
130- Beam .Disable ('Tick' );
131-
132- Beam .Next = default .Free ;
133- default .Free = Beam ;
134- }
135-
136- static final function Cleanup () {
137- default .Free = none ;
138- }
139-
140- defaultproperties
141- {
142- Physics =PHYS_Rotating
143- RemoteRole =ROLE_None
144- LifeSpan =0.000000
145- Rotation =(Roll =20000 )
146- DrawType =DT_Mesh
147- Style =STY_Translucent
148- Texture =Texture 'Botpack.Effects.jenergy2'
149- Mesh =LodMesh 'Botpack.Shockbm'
150- DrawScale =0.440000
151- bUnlit =True
152- bParticles =True
153- bFixedRotationDir =True
154- RotationRate =(Roll =1000000 )
155- DesiredRotation =(Roll =20000 )
1+ class ClientShockBeam extends Effects ;
2+
3+ // Settings
4+ var int Team ;
5+ var float Size ;
6+ var float Curve ;
7+ var float Duration ;
8+ var vector MoveAmount ;
9+ var int NumPuffs ;
10+ var bool bBeamEnableLight ;
11+
12+ //
13+ var float TimeLeft ;
14+
15+ var ClientShockBeam Next ;
16+ var ClientShockBeam Free ;
17+
18+ simulated function Tick (float DeltaTime ) {
19+ if (Level .NetMode != NM_DedicatedServer ) {
20+ ScaleGlow = (TimeLeft / Duration ) ** Curve ;
21+
22+ AmbientGlow = ScaleGlow * 210 ;
23+ if (Team >= 0 )
24+ LightBrightness = ScaleGlow * 128 ;
25+
26+ TimeLeft -= DeltaTime ;
27+ if (TimeLeft <= 0.0 ) {
28+ FreeBeam (self );
29+ }
30+ }
31+ }
32+
33+ simulated function SetProperties (int pTeam , float pSize , float pCurve , float pDuration , vector pMoveAmount , int pNumPuffs , bool pbBeamEnableLight ) {
34+ Team = pTeam ;
35+ Size = pSize ;
36+ Duration = pDuration ;
37+ Curve = pCurve ;
38+ MoveAmount = pMoveAmount ;
39+ NumPuffs = pNumPuffs ;
40+ bBeamEnableLight = pbBeamEnableLight ;
41+
42+ if (Team >= 0 ) {
43+ Mesh = LodMesh 'Botpack.Shockbm' ;
44+ if (bBeamEnableLight && Level .bHighDetailMode )
45+ LightType = LT_Steady ;
46+ else
47+ LightType = LT_None ;
48+ LightEffect = LE_NonIncidence ;
49+ LightBrightness = 192 ;
50+ LightSaturation = 64 ;
51+ LightRadius = 6 ;
52+ }
53+
54+ switch (Team ) {
55+ case -1 :
56+ // Dont
57+ break ;
58+
59+ case 0 :
60+ Texture = Texture 'BotPack.Translocator.Tranglow' ;
61+ LightHue = 0 ;
62+ break ;
63+
64+ case 1 :
65+ Texture = Texture 'BotPack.Translocator.Tranglowb' ;
66+ LightHue = 150 ;
67+ LightBrightness = 224 ;
68+ break ;
69+
70+ case 2 :
71+ Texture = Texture 'BotPack.Translocator.Tranglowg' ;
72+ LightHue = 75 ;
73+ break ;
74+
75+ case 3 :
76+ Texture = Texture 'BotPack.Translocator.Tranglowy' ;
77+ LightHue = 40 ;
78+ break ;
79+ }
80+ DrawScale = 0.44 * Size ;
81+ TimeLeft = Duration ;
82+
83+ if (Level .NetMode != NM_DedicatedServer )
84+ SetTimer (0.05 , false );
85+ }
86+
87+ simulated function Timer () {
88+ local ClientShockBeam r ;
89+
90+ if (NumPuffs > 0 ) {
91+ r = AllocBeam (PlayerPawn (Owner ));
92+ r .SetLocation (Location + MoveAmount );
93+ r .SetRotation (Rotation );
94+ r .SetProperties (Team ,Size ,Curve ,Duration ,MoveAmount , NumPuffs - 1 , bBeamEnableLight );
95+ }
96+ }
97+
98+ static final function ResetBeam (ClientShockBeam Beam ) {
99+ Beam .Texture = default .Texture ;
100+ Beam .Mesh = default .Mesh ;
101+ Beam .LightType = default .LightType ;
102+ Beam .LightEffect = default .LightEffect ;
103+ Beam .LightBrightness = default .LightBrightness ;
104+ Beam .LightSaturation = default .LightSaturation ;
105+ Beam .LightRadius = default .LightRadius ;
106+ Beam .LightHue = default .LightHue ;
107+ }
108+
109+ static final function ClientShockBeam AllocBeam (PlayerPawn P ) {
110+ local ClientShockBeam Beam ;
111+
112+ if (default .Free != none ) {
113+ Beam = default .Free ;
114+ default .Free = Beam .Next ;
115+ Beam .Next = none ;
116+
117+ Beam .bHidden = false ;
118+ Beam .Enable ('Tick' );
119+ } else {
120+ Beam = P .Spawn (class 'ClientShockBeam' , P );
121+ }
122+
123+ ResetBeam (Beam );
124+ return Beam ;
125+ }
126+
127+ static final function FreeBeam (ClientShockBeam Beam ) {
128+ Beam .bHidden = true ;
129+ Beam .LightType = LT_None ;
130+ Beam .Disable ('Tick' );
131+
132+ Beam .Next = default .Free ;
133+ default .Free = Beam ;
134+ }
135+
136+ static final function Cleanup () {
137+ default .Free = none ;
138+ }
139+
140+
141+ defaultproperties
142+ {
143+ Team =0
144+ Size =0.0000000
145+ Curve =0.0000000
146+ duration =0.0000000
147+ MoveAmount =(X =0.0000000 ,Y =0.0000000 ,Z =0.0000000 )
148+ NumPuffs =0
149+ bBeamEnableLight =false
150+ TimeLeft =0.0000000
151+ Next =none
152+ Free =none
153+ Physics =5
154+ RemoteRole =0
155+ Rotation =(Pitch =0 ,Yaw =0 ,Roll =20000 )
156+ DrawType =2
157+ Style =3
158+ Texture =Texture 'Botpack.Effects.jenergy2'
159+ Mesh =LodMesh 'Botpack.Shockbm'
160+ DrawScale =0.4400000
161+ bUnlit =true
162+ bParticles =true
163+ bFixedRotationDir =true
164+ RotationRate =(Pitch =0 ,Yaw =0 ,Roll =1000000 )
165+ DesiredRotation =(Pitch =0 ,Yaw =0 ,Roll =20000 )
156166}
0 commit comments