Point defense blocks

This commit is contained in:
Anuken
2020-06-03 16:22:07 -04:00
parent 3d98de34eb
commit 6fff4ad8a1
20 changed files with 1821 additions and 1759 deletions
+24 -12
View File
@@ -12,13 +12,12 @@ import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.experimental.BlockLauncher.*;
import static arc.graphics.g2d.Draw.rect;
import static arc.graphics.g2d.Draw.*;
import static arc.graphics.g2d.Lines.*;
import static arc.math.Angles.*;
import static mindustry.Vars.*;
import static mindustry.Vars.tilesize;
public class Fx{
public static final Effect
@@ -103,18 +102,21 @@ public class Fx{
Fill.circle(x, y, e.fslope() * 1.5f * size);
}),
blockTransfer = new Effect(25f, e -> {
if(!(e.data instanceof LaunchedBlock)) return;
pointBeam = new Effect(25f, e -> {
if(!(e.data instanceof Position)) return;
LaunchedBlock l = e.data();
Position pos = e.data();
Block block = l.block;
Position to = Tmp.v3.set(l.x * tilesize, l.y * tilesize).add(block.offset(), block.offset());
Draw.color(e.color);
Draw.alpha(e.fout());
Lines.stroke(1.5f);
Lines.line(e.x, e.y, pos.getX(), pos.getY());
}),
Tmp.v1.set(e.x, e.y).interpolate(Tmp.v2.set(to), e.fin(), Interp.linear);
float x = Tmp.v1.x, y = Tmp.v1.y;
Draw.rect(block.icon(Cicon.full), x, y);
pointHit = new Effect(8f, e -> {
color(Color.white, e.color, e.fin());
stroke(e.fout() * 1f + 0.2f);
Lines.circle(e.x, e.y, e.fin() * 6f);
}),
lightning = new Effect(10f, 500f, e -> {
@@ -915,6 +917,16 @@ public class Fx{
}),
sparkShoot = new Effect(12f, e -> {
color(Color.white, e.color, e.fin());
stroke(e.fout() * 1.2f + 0.6f);
randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 3f, (x, y) -> {
lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 5f + 0.5f);
});
}),
lightningShoot = new Effect(12f, e -> {
color(Color.white, Pal.lancerLaser, e.fin());
stroke(e.fout() * 1.2f + 0.5f);