From d2b8bc5dab96a4e01fafd433ae9933c7093ea652 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 21 Aug 2023 14:48:18 -0400 Subject: [PATCH] v2.2.0: the DM-300 fight now have a guaranteed safe path to each pylon --- .../shatteredpixeldungeon/levels/CavesBossLevel.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java index dbc1cf4cd..27540e5bd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java @@ -168,6 +168,17 @@ public class CavesBossLevel extends Level { customVisuals.setRect(0, 12, width(), 27); customTiles.add(customVisuals); + //ensures that all pylons can be reached without stepping over water or wires + boolean[] pass = new boolean[length]; + for (int i = 0; i < length; i++){ + pass[i] = map[i] == Terrain.EMPTY || map[i] == Terrain.EMPTY_SP || map[i] == Terrain.EMPTY_DECO; + } + PathFinder.buildDistanceMap(16 + 25*width(), pass); + for (int i : pylonPositions){ + if (PathFinder.distance[i] == Integer.MAX_VALUE){ + return false; + } + } return true; }