From 4000986784954dbe8a1cacc2f73f2f1f2558282a Mon Sep 17 00:00:00 2001 From: BalaM314 <71201189+BalaM314@users.noreply.github.com> Date: Mon, 18 Dec 2023 18:26:17 +0530 Subject: [PATCH] Highlight blocks that will be blown up by drop zone --- core/src/mindustry/client/Client.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/mindustry/client/Client.kt b/core/src/mindustry/client/Client.kt index 3812a6dda6..fa2ea9092f 100644 --- a/core/src/mindustry/client/Client.kt +++ b/core/src/mindustry/client/Client.kt @@ -168,6 +168,19 @@ object Client { if (bounds.overlaps(b.x - range, b.y - range, range * 2, range * 2)) b.drawSelect() } } + //Enemy spawners + if (state.hasSpawns()) { + val tiles = Seq(); + spawner.getSpawns().forEach { s -> + val intRad = Mathf.floor(state.rules.dropZoneRadius / tilesize) + indexer.eachBlock(player.team(), s.worldx(), s.worldy(), tilesize * intRad.toFloat(), { true }) { + it.tile.getLinkedTiles(tiles) + if (tiles.contains { t -> Mathf.pow(t.x - s.x, 2) + Mathf.pow(t.y - s.y, 2) < intRad * intRad }) { + Drawf.selected(it, Tmp.c1.set(Color.red).a(Mathf.absin(4f, 1f))) + } + }; + } + } // Mass driver config if (showingMassDrivers) {