10
10
import progressed .graphics .renders .*;
11
11
12
12
import static arc .graphics .g2d .Draw .*;
13
- import static arc .graphics .g2d .Lines .line ;
14
13
import static arc .graphics .g2d .Lines .*;
15
14
import static arc .math .Angles .*;
16
15
import static arc .util .Tmp .*;
17
- import static mindustry .graphics .Drawf .*;
18
16
19
17
public class EnergyFx {
20
18
public static Effect
@@ -58,34 +56,18 @@ public class EnergyFx{
58
56
}
59
57
}),
60
58
61
- kugelblitzCharge = new Effect (80f , e -> {
62
- float in = 6f ,
63
- out = 160f ;
64
- PMRenders .blackHole (e .x , e .y , in * e . fin (), ( in + ( out - in ) * 0.33f ) * e . fin () , e .color );
59
+ kugelblitzGrow = new Effect (80f , e -> {
60
+ float in = 6f ;
61
+ float fin = e . fin ( Interp . sineOut ) ;
62
+ PMRenders .blackHole (e .x , e .y , in * fin , in * 6f * fin , e .color );
65
63
}),
66
64
67
65
blackHoleSwirl = makeSwirlEffect (90f , 8 , 3f , 90f , 720f , true ).layer (Layer .effect + 0.005f ),
68
66
69
- blackHoleDespawn = new Effect (24f , e -> {
70
- color (Color .darkGray , Color .black , e .fin ());
71
-
72
- e .scaled (12f , s -> {
73
- stroke (2f * e .fout ());
74
- Lines .circle (e .x , e .y , s .fin () * 10f );
75
- });
76
-
77
- stroke (2f * e .fout ());
78
- randLenVectors (e .id , 4 , e .fin () * 15f , (x , y ) -> {
79
- float ang = angle (x , y );
80
- lineAngle (e .x + x , e .y + y , ang , e .fout () * 3 + 1f );
81
- });
82
-
83
- color (e .color );
84
- randLenVectors (e .id * 2L , 4 , e .fin () * 15f , (x , y ) -> {
85
- float ang = angle (x , y );
86
- lineAngle (e .x + x , e .y + y , ang , e .fout () * 3 + 1f );
87
- });
88
- }).layer (Layer .effect + 0.005f ),
67
+ blackHoleDespawn = new Effect (40f , e -> {
68
+ Lines .stroke (2f * e .fout (), Color .black );
69
+ Lines .circle (e .x , e .y , 18f * e .fin (Interp .pow3Out ));
70
+ }).layer (Layer .effect + 0.03f ),
89
71
90
72
blackHoleAbsorb = new Effect (20f , e -> {
91
73
color (Color .black );
@@ -132,57 +114,7 @@ public class EnergyFx{
132
114
}
133
115
134
116
Drawf .light (e .x , e .y , circleRad * 1.6f , Pal .heal , e .fout ());
135
- }),
136
-
137
- harbingerCharge = new Effect (150f , 1600f , e -> {
138
- Color [] colors = {Color .valueOf ("D99F6B55" ), Color .valueOf ("E8D174aa" ), Color .valueOf ("F3E979" ), Color .valueOf ("ffffff" )};
139
- float [] tscales = {1f , 0.7f , 0.5f , 0.2f };
140
- float [] strokes = {2f , 1.5f , 1 , 0.3f };
141
- float [] lenscales = {1 , 1.12f , 1.15f , 1.17f };
142
-
143
- float lightOpacity = 0.4f + (e .finpow () * 0.4f );
144
-
145
- Draw .color (colors [0 ], colors [2 ], 0.5f + e .finpow () * 0.5f );
146
- Lines .stroke (Mathf .lerp (0f , 28f , e .finpow ()));
147
- Lines .circle (e .x , e .y , 384f * (1f - e .finpow ()));
148
-
149
- for (int i = 0 ; i < 36 ; i ++){
150
- v1 .trns (i * 10f , 384f * (1 - e .finpow ()));
151
- v2 .trns (i * 10f + 10f , 384f * (1f - e .finpow ()));
152
- light (e .x + v1 .x , e .y + v1 .y , e .x + v2 .x , e .y + v2 .y , 14f / 2f + 60f * e .finpow (), Draw .getColor (), lightOpacity + (0.2f * e .finpow ()));
153
- }
154
-
155
- float fade = 1f - Mathf .curve (e .time , e .lifetime - 30f , e .lifetime );
156
- float grow = Mathf .curve (e .time , 0f , e .lifetime - 30f );
157
-
158
- for (int i = 0 ; i < 4 ; i ++){
159
- float baseLen = (900f + (Mathf .absin (Time .time / ((i + 1f ) * 2f ) + Mathf .randomSeed (e .id ), 0.8f , 1.5f ) * (900f / 1.5f ))) * 0.75f * fade ;
160
- Draw .color (Tmp .c1 .set (colors [i ]).mul (1f + Mathf .absin (Time .time / 3f + Mathf .randomSeed (e .id ), 1.0f , 0.3f ) / 3f ));
161
- for (int j = 0 ; j < 2 ; j ++){
162
- int dir = Mathf .signs [j ];
163
- for (int k = 0 ; k < 10 ; k ++){
164
- float side = k * (360f / 10f );
165
- for (int l = 0 ; l < 4 ; l ++){
166
- Lines .stroke ((16f * 0.75f + Mathf .absin (Time .time , 0.5f , 1f )) * grow * strokes [i ] * tscales [l ]);
167
- Lines .lineAngle (e .x , e .y , (e .rotation + 360f * e .finpow () + side ) * dir , baseLen * lenscales [l ], false );
168
- }
169
-
170
- v1 .trns ((e .rotation + 360f * e .finpow () + side ) * dir , baseLen * 1.1f );
171
-
172
- light (e .x , e .y , e .x + v1 .x , e .y + v1 .y , ((16f * 0.75f + Mathf .absin (Time .time , 0.5f , 1f )) * grow * strokes [i ] * tscales [j ]) / 2f + 60f * e .finpow (), colors [2 ], lightOpacity );
173
- }
174
- }
175
- Draw .reset ();
176
- }
177
- }),
178
-
179
- //[circle radius, distance]
180
- everythingGunSwirl = new Effect (120f , 1600f , e -> {
181
- float [] data = (float [])e .data ;
182
- v1 .trns (Mathf .randomSeed (e .id , 360f ) + e .rotation * e .fin (), (16f + data [1 ]) * e .fin ());
183
- color (e .color , Color .black , 0.25f + e .fin () * 0.75f );
184
- Fill .circle (e .x + v1 .x , e .y + v1 .y , data [0 ] * e .fout ());
185
- }).layer (Layer .bullet - 0.00999f );
117
+ });
186
118
187
119
public static Effect makeSwirlEffect (Color color , float eLifetime , int length , float maxWidth , float minRot , float maxRot , float minDst , float maxDst , boolean lerp ){
188
120
return new Effect (eLifetime , 400f , e -> {
@@ -191,7 +123,7 @@ public static Effect makeSwirlEffect(Color color, float eLifetime, int length, f
191
123
float lifetime = e .lifetime - length ;
192
124
float dst ;
193
125
if (minDst < 0 || maxDst < 0 ){
194
- dst = Math .abs (e .rotation );;
126
+ dst = Math .abs (e .rotation );
195
127
}else {
196
128
dst = Mathf .randomSeed (e .id , minDst , maxDst );
197
129
}
0 commit comments