Skip to content

Commit 0335aaa

Browse files
committed
....then explode
Survive or be destroyed, there is no other choice.
1 parent 1308df9 commit 0335aaa

File tree

3 files changed

+27
-57
lines changed

3 files changed

+27
-57
lines changed

src/progressed/content/bullets/PayloadBullets.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import progressed.entities.bullet.energy.*;
1717
import progressed.entities.bullet.pseudo3d.*;
1818
import progressed.entities.bullet.unit.*;
19+
import progressed.entities.effect.*;
1920
import progressed.graphics.*;
2021
import progressed.type.unit.*;
2122
import progressed.type.weapons.*;
@@ -427,13 +428,17 @@ public static void load(){
427428
buildingDamageMultiplier = 0.5f;
428429

429430
despawnSound = PMSounds.nuclearExplosion;
430-
despawnEffect = MissileFx.blackHoleNukeExplode;
431+
despawnEffect = new MultiEffect(
432+
MissileFx.blackHoleNukeWaves,
433+
new RepeatEffect(MissileFx.blackHoleNukeParticle, 1f, 60)
434+
);
431435
hitEffect = Fx.none;
432436
starIn = Color.white;
433437
starWidth = 8f * tilesize;
434438
starHeight = 3f * tilesize;
435439
slashOffsetStart = 8f;
436440
slashOffsetEnd = 32f;
441+
slashWidthTo = 0.25f * tilesize;
437442
}};
438443
}};
439444

src/progressed/content/effects/MissileFx.java

+21-9
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
import static arc.graphics.g2d.Lines.*;
1515
import static arc.math.Angles.*;
1616
import static arc.util.Tmp.*;
17-
import static mindustry.Vars.tilesize;
17+
import static mindustry.Vars.*;
1818
import static mindustry.graphics.Drawf.*;
19-
import static progressed.util.PMUtls.*;
2019

2120
public class MissileFx{
21+
public static final Rand rand = new Rand();
22+
2223
public static Effect
2324

2425
shootSmokeDownpour = new Effect(70f, e -> {
@@ -62,9 +63,10 @@ public class MissileFx{
6263
float amount = 40;
6364
float fin = e.fin(Interp.pow5Out);
6465
Draw.alpha(e.fout(Interp.pow3Out));
66+
rand.setSeed(e.id);
6567
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);
6870
Draw.rect(Fire.regions[frame], e.x + v1.x, e.y + v1.y);
6971
}
7072
Draw.color();
@@ -188,14 +190,24 @@ public class MissileFx{
188190

189191
bigBlackHoleSwirl = new SwirlEffect(90f, 16, 8f, 120f, 480f, true).layer(Layer.effect + 0.005f),
190192

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;
193205
e.scaled(150f, s -> {
194-
Lines.stroke(9f * tilesize * s.fout(), e.color);
206+
Lines.stroke(3f * tilesize * s.fout(), e.color);
195207
Lines.circle(e.x, e.y, 1.5f * rad * s.fin(Interp.pow3Out));
196208
});
197209

198-
Lines.stroke(4f * tilesize * e.fout(), Color.black);
210+
Lines.stroke(2f * tilesize * e.fout(), Color.black);
199211
Lines.circle(e.x, e.y, rad * e.fin(Interp.pow3Out));
200-
}).layer(Layer.effect + 0.02f);
212+
}).layer(Layer.effect + 0.03f);
201213
}

src/progressed/type/unit/DummyUnitType.java

-47
This file was deleted.

0 commit comments

Comments
 (0)