Skip to content

Commit

Permalink
Highlight blocks that will be blown up by drop zone
Browse files Browse the repository at this point in the history
  • Loading branch information
BalaM314 committed Dec 18, 2023
1 parent d931f3f commit 4000986
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/src/mindustry/client/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<Tile>();
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) {
Expand Down

0 comments on commit 4000986

Please sign in to comment.