From 0c066595b6855be5bbca0af9ad414e91480e5408 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 8 Oct 2025 14:40:16 -0400 Subject: [PATCH] v3.3.0: rot garden rooms now have a minimum open size --- .../levels/rooms/quest/RotGardenRoom.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/RotGardenRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/RotGardenRoom.java index 1e508d309..c2da91423 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/RotGardenRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/quest/RotGardenRoom.java @@ -58,6 +58,7 @@ public class RotGardenRoom extends SpecialRoom { ArrayList candidates = new ArrayList<>(); boolean[] passable = new boolean[level.length()]; int entryPos = level.pointToCell(entrance()); + int openCells; do { Painter.fill(level, this, 1, Terrain.HIGH_GRASS); for (int i = 0; i < 12; i++) { @@ -78,9 +79,11 @@ public class RotGardenRoom extends SpecialRoom { //place the heart in a slightly random location sufficiently far from the entrance PathFinder.buildDistanceMap(entryPos, passable); candidates.clear(); + openCells = 0; for (Point p : getPoints()) { int i = level.pointToCell(p); if (PathFinder.distance[i] != Integer.MAX_VALUE) { + openCells++; if (PathFinder.distance[i] >= 7) { candidates.add(i); } @@ -102,7 +105,8 @@ public class RotGardenRoom extends SpecialRoom { closestPos++; } - } while (candidates.isEmpty()); + //retry if there are no distanc candidates, or more than ~half the room is closed off + } while (candidates.isEmpty() || openCells < 35); int heartPos = Random.element(candidates); placePlant(level, heartPos, new RotHeart());