|
14 | 14 | import static arc.graphics.g2d.Lines.*;
|
15 | 15 | import static arc.math.Angles.*;
|
16 | 16 | import static arc.util.Tmp.*;
|
17 |
| -import static mindustry.Vars.tilesize; |
| 17 | +import static mindustry.Vars.*; |
18 | 18 | import static mindustry.graphics.Drawf.*;
|
19 |
| -import static progressed.util.PMUtls.*; |
20 | 19 |
|
21 | 20 | public class MissileFx{
|
| 21 | + public static final Rand rand = new Rand(); |
| 22 | + |
22 | 23 | public static Effect
|
23 | 24 |
|
24 | 25 | shootSmokeDownpour = new Effect(70f, e -> {
|
@@ -62,9 +63,10 @@ public class MissileFx{
|
62 | 63 | float amount = 40;
|
63 | 64 | float fin = e.fin(Interp.pow5Out);
|
64 | 65 | Draw.alpha(e.fout(Interp.pow3Out));
|
| 66 | + rand.setSeed(e.id); |
65 | 67 | for(int i = 0; i < amount; i++){
|
66 |
| - int frame = (int)Mathf.mod(e.time * ((float)Fire.duration / Fire.frames) + Mathf.randomSeed(e.id + i * 2L, Fire.frames), Fire.frames); |
67 |
| - v1.trns(i * (360f / amount) + Mathf.randomSeedRange(e.id, 180f), 88f * fin); |
| 68 | + int frame = (int)Mathf.mod(e.time * ((float)Fire.duration / Fire.frames) + rand.random(Fire.frames), Fire.frames); |
| 69 | + v1.trns(i * (360f / amount) + rand.range(180f), 88f * fin); |
68 | 70 | Draw.rect(Fire.regions[frame], e.x + v1.x, e.y + v1.y);
|
69 | 71 | }
|
70 | 72 | Draw.color();
|
@@ -188,14 +190,24 @@ public class MissileFx{
|
188 | 190 |
|
189 | 191 | bigBlackHoleSwirl = new SwirlEffect(90f, 16, 8f, 120f, 480f, true).layer(Layer.effect + 0.005f),
|
190 | 192 |
|
191 |
| - blackHoleNukeExplode = new Effect(180f, e -> { |
192 |
| - float rad = 32f * tilesize; |
| 193 | + blackHoleNukeParticle = new Effect(300f, e -> { |
| 194 | + rand.setSeed(e.id); |
| 195 | + float rad = rand.random(1f, 4f) * tilesize * (1f - Interp.pow3Out.apply(Mathf.curve(e.time, 120f, 300f))); |
| 196 | + float ang = rand.random(360f); |
| 197 | + float dst = rand.random(8f, 24f) * tilesize * e.fin(Interp.pow5Out); |
| 198 | + |
| 199 | + Draw.color(Color.black); |
| 200 | + Fill.circle(e.x + Angles.trnsx(ang, dst), e.y + Angles.trnsy(ang, dst), rad); |
| 201 | + }).layer(Layer.effect + 0.02f), |
| 202 | + |
| 203 | + blackHoleNukeWaves = new Effect(180f, e -> { |
| 204 | + float rad = 12f * tilesize; |
193 | 205 | e.scaled(150f, s -> {
|
194 |
| - Lines.stroke(9f * tilesize * s.fout(), e.color); |
| 206 | + Lines.stroke(3f * tilesize * s.fout(), e.color); |
195 | 207 | Lines.circle(e.x, e.y, 1.5f * rad * s.fin(Interp.pow3Out));
|
196 | 208 | });
|
197 | 209 |
|
198 |
| - Lines.stroke(4f * tilesize * e.fout(), Color.black); |
| 210 | + Lines.stroke(2f * tilesize * e.fout(), Color.black); |
199 | 211 | Lines.circle(e.x, e.y, rad * e.fin(Interp.pow3Out));
|
200 |
| - }).layer(Layer.effect + 0.02f); |
| 212 | + }).layer(Layer.effect + 0.03f); |
201 | 213 | }
|
0 commit comments