This commit is contained in:
sharlottes
2022-04-16 23:41:31 +09:00
parent 21a15db1b9
commit 78f3b2d782

View File

@@ -24,7 +24,6 @@ import mindustry.world.*;
import mindustry.world.blocks.defense.turrets.*; import mindustry.world.blocks.defense.turrets.*;
import mindustry.world.blocks.distribution.*; import mindustry.world.blocks.distribution.*;
import mindustry.world.blocks.payloads.*; import mindustry.world.blocks.payloads.*;
import mindustry.world.blocks.power.*;
import mindustry.world.blocks.storage.*; import mindustry.world.blocks.storage.*;
import mindustry.world.blocks.units.*; import mindustry.world.blocks.units.*;
@@ -39,7 +38,6 @@ public class OverDrawer {
public static Seq<MassDriver.MassDriverBuild> linkedMasses = new Seq<>(); public static Seq<MassDriver.MassDriverBuild> linkedMasses = new Seq<>();
public static Seq<PayloadMassDriver.PayloadDriverBuild> linkedPayloadMasses = new Seq<>(); public static Seq<PayloadMassDriver.PayloadDriverBuild> linkedPayloadMasses = new Seq<>();
public static Seq<Building> linkedNodes = new Seq<>(); public static Seq<Building> linkedNodes = new Seq<>();
public static Seq<Building> linkedBuilds = new Seq<>();
public static Seq<Tile> pathTiles = new Seq<>(); public static Seq<Tile> pathTiles = new Seq<>();
public static FrameBuffer effectBuffer = new FrameBuffer(); public static FrameBuffer effectBuffer = new FrameBuffer();
public static int otherCores; public static int otherCores;
@@ -59,9 +57,7 @@ public class OverDrawer {
Tmp.v1.set(camera.position); Tmp.v1.set(camera.position);
Lines.stroke(1f + sin / 2, Pal.accent); Lines.stroke(1f + sin / 2, Pal.accent);
Lines.circle(Tmp.v1.x, Tmp.v1.y, leng - 4f); Lines.circle(Tmp.v1.x, Tmp.v1.y, leng - 4f);
spawner.getSpawns().each(t -> { spawner.getSpawns().each(t -> Drawf.arrow(Tmp.v1.x, Tmp.v1.y, t.worldx(), t.worldy(), leng, (Math.min(200 * 8f, Mathf.dst(Tmp.v1.x, Tmp.v1.y, t.worldx(), t.worldy())) / (200 * 8f)) * (5f + sin)));
Drawf.arrow(Tmp.v1.x, Tmp.v1.y, t.worldx(), t.worldy(), leng, (Math.min(200 * 8f, Mathf.dst(Tmp.v1.x, Tmp.v1.y, t.worldx(), t.worldy())) / (200 * 8f)) * (5f + sin));
});
} }
if(settings.getBool("select")) { if(settings.getBool("select")) {
@@ -321,18 +317,19 @@ public class OverDrawer {
if(node.power == null) return; if(node.power == null) return;
if(!linkedNodes.contains(node)) { if(!linkedNodes.contains(node)) {
linkedNodes.add(node); linkedNodes.add(node);
getPowerLinkedBuilds(node).each(i -> { int[] builds = getPowerLinkedBuilds(node).items;
for(int i : builds) {
Building other = world.build(i); Building other = world.build(i);
if(other.power == null) return; if(other == null || other.power == null) return;
float angle1 = Angles.angle(node.x, node.y, other.x, other.y), float angle1 = Angles.angle(node.x, node.y, other.x, other.y),
vx = Mathf.cosDeg(angle1), vy = Mathf.sinDeg(angle1), vx = Mathf.cosDeg(angle1), vy = Mathf.sinDeg(angle1),
len1 = node.block.size * tilesize / 2f - 1.5f, len2 = other.block.size * tilesize / 2f - 1.5f; len1 = node.block.size * tilesize / 2f - 1.5f, len2 = other.block.size * tilesize / 2f - 1.5f;
Draw.color(Color.white, Color.valueOf("98ff98"), (1f - node.power.graph.getSatisfaction()) * 0.86f + Mathf.absin(3f, 0.1f)); Draw.color(Color.white, Color.valueOf("98ff98"), (1f - node.power.graph.getSatisfaction()) * 0.86f + Mathf.absin(3f, 0.1f));
Draw.alpha(Renderer.laserOpacity); Draw.alpha(Renderer.laserOpacity);
Drawf.laser(node.team, atlas.find("unitinfo-Slaser"), atlas.find("unitinfo-Slaser-end"), node.x + vx * len1, node.y + vy * len1, other.x - vx * len2, other.y - vy * len2, 0.25f); Drawf.laser(node.team, atlas.find("unitinfo-Slaser"), atlas.find("unitinfo-Slaser-end"), node.x + vx * len1, node.y + vy * len1, other.x - vx * len2, other.y - vy * len2, 0.25f);
drawNodeLink(other); drawNodeLink(other);
}); }
} }
} }
} }