From 95f0ae5800aa7f2290d6d4e7974b08e72e9709d5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 27 Apr 2017 14:11:22 -0400 Subject: [PATCH] v0.6.0: refactored library rooms slightly --- .../levels/rooms/special/LibraryRoom.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LibraryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LibraryRoom.java index 3bd4ac5c9..5ef744c58 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LibraryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LibraryRoom.java @@ -31,7 +31,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurs import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; -import com.watabou.utils.Point; import com.watabou.utils.Random; public class LibraryRoom extends SpecialRoom { @@ -42,12 +41,16 @@ public class LibraryRoom extends SpecialRoom { Painter.fill( level, this, 1, Terrain.EMPTY_SP ); Door entrance = entrance(); - Point a = null; - Point b = null; Painter.fill( level, left + 1, top+1, width() - 2, 1 , Terrain.BOOKSHELF ); if (entrance.y == top){ Painter.set( level, entrance.x, entrance.y + 1, Terrain.EMPTY_SP ); + } else if (entrance.y == top + 1){ + if (entrance.x == left){ + Painter.set(level, entrance.x+1, entrance.y, Terrain.EMPTY_SP); + } else { + Painter.set(level, entrance.x+1, entrance.y, Terrain.EMPTY_SP); + } } int n = Random.IntRange( 2, 3 ); @@ -66,14 +69,6 @@ public class LibraryRoom extends SpecialRoom { entrance.set( Door.Type.LOCKED ); - if (entrance.y == top + 1){ - if (entrance.x == left){ - Painter.set(level, entrance.x+1, entrance.y, Terrain.EMPTY_SP); - } else { - Painter.set(level, entrance.x-1, entrance.y, Terrain.EMPTY_SP); - } - } - level.addItemToSpawn( new IronKey( Dungeon.depth ) ); }