From e66cbaccb505b9256669fbe5044967acaa465499 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 15 Sep 2023 13:55:21 -0400 Subject: [PATCH] v2.2.0: fixed rot heart rarely having no space to spread gas --- .../levels/rooms/quest/RotGardenRoom.java | 16 +++++++++++++++- 1 file changed, 15 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 f017b674a..6f707947f 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 @@ -119,7 +119,21 @@ public class RotGardenRoom extends SpecialRoom { placePlant(level, pos, new RotLasher()); } - //if almost every open cell next to the heart has a lasher threatening it, try to clear one lasher + //If the only open cells next to the heart are a diagonal, open one additional adjacent cell + //This is important so that the heart can spread gas + boolean openCardinal = false; + for (int i = 1; i < PathFinder.CIRCLE8.length; i+=2){ + if (level.map[heartPos + PathFinder.CIRCLE8[i]] != Terrain.WALL) openCardinal = true; + } + if (!openCardinal){ + for (int i = 0; i < PathFinder.CIRCLE8.length; i+=2){ + if (level.map[heartPos + PathFinder.CIRCLE8[i]] != Terrain.WALL){ + Painter.set(level, heartPos + PathFinder.CIRCLE8[i+1], Terrain.HIGH_GRASS); + } + } + } + + //if almost every open cell next to the heart has a lasher threatening it, clear one lasher int safeHeartcells = 0; HashSet adjacentLashers = new HashSet<>(); for (int i : PathFinder.NEIGHBOURS8){