From f67a2e561f30f64fe2b78a21c4b24ba4f8a8ac86 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 12 Sep 2017 00:22:35 -0400 Subject: [PATCH] v0.6.2: adjusted weak floor room logic to prevent well visual clipping --- .../levels/rooms/special/WeakFloorRoom.java | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/WeakFloorRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/WeakFloorRoom.java index b563b4381..3a7f55c5d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/WeakFloorRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/WeakFloorRoom.java @@ -41,34 +41,30 @@ public class WeakFloorRoom extends SpecialRoom { Door door = entrance(); door.set( Door.Type.REGULAR ); - if (door.x == left) { - for (int i=top + 1; i < bottom; i++) { - Painter.drawInside( level, this, new Point( left, i ), Random.IntRange( 1, width() - 3 ), Terrain.EMPTY_SP ); - } - } else if (door.x == right) { - for (int i=top + 1; i < bottom; i++) { - Painter.drawInside( level, this, new Point( right, i ), Random.IntRange( 1, width() - 3 ), Terrain.EMPTY_SP ); - } - } else if (door.y == top) { - for (int i=left + 1; i < right; i++) { - Painter.drawInside( level, this, new Point( i, top ), Random.IntRange( 1, height() - 3 ), Terrain.EMPTY_SP ); - } - } else if (door.y == bottom) { - for (int i=left + 1; i < right; i++) { - Painter.drawInside( level, this, new Point( i, bottom ), Random.IntRange( 1, height() - 3 ), Terrain.EMPTY_SP ); - } - } - Point well = null; + if (door.x == left) { + for (int i=top + 1; i < bottom; i++) { + Painter.drawInside( level, this, new Point( left, i ), Random.IntRange( 1, width() - 4 ), Terrain.EMPTY_SP ); + } well = new Point( right-1, Random.Int( 2 ) == 0 ? top + 2 : bottom - 1 ); } else if (door.x == right) { + for (int i=top + 1; i < bottom; i++) { + Painter.drawInside( level, this, new Point( right, i ), Random.IntRange( 1, width() - 4 ), Terrain.EMPTY_SP ); + } well = new Point( left+1, Random.Int( 2 ) == 0 ? top + 2 : bottom - 1 ); } else if (door.y == top) { + for (int i=left + 1; i < right; i++) { + Painter.drawInside( level, this, new Point( i, top ), Random.IntRange( 1, height() - 4 ), Terrain.EMPTY_SP ); + } well = new Point( Random.Int( 2 ) == 0 ? left + 1 : right - 1, bottom-1 ); } else if (door.y == bottom) { + for (int i=left + 1; i < right; i++) { + Painter.drawInside( level, this, new Point( i, bottom ), Random.IntRange( 1, height() - 4 ), Terrain.EMPTY_SP ); + } well = new Point( Random.Int( 2 ) == 0 ? left + 1 : right - 1, top+2 ); } + Painter.set(level, well, Terrain.CHASM); CustomTiledVisual vis = new HiddenWell(); vis.pos(well.x, well.y);