From 55ea2dbcab8600ddf4ce9b956d1cd30ec1535a2b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 5 Nov 2014 20:05:12 -0500 Subject: [PATCH] v0.2.2a: reverted some changes to study rooms, corrected an error. --- .../levels/painters/StandardPainter.java | 36 ++++++++----------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StandardPainter.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StandardPainter.java index 271c17d56..deac6a45f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StandardPainter.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StandardPainter.java @@ -22,7 +22,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; @@ -150,36 +149,31 @@ public class StandardPainter extends Painter { private static void paintStudy( Level level, Room room ) { fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , Terrain.BOOKSHELF ); fill( level, room.left + 2, room.top + 2, room.width() - 3, room.height() - 3 , Terrain.EMPTY_SP ); - - for (Room.Door door : room.connected.values()) { - if (door.type == Room.Door.Type.LOCKED){ - //sneaky sneaky... - level.addItemToSpawn(new PotionOfLiquidFlame()); - } else { - if (door.x == room.left) { - set(level, door.x + 1, door.y, Terrain.EMPTY); - } else if (door.x == room.right) { - set(level, door.x - 1, door.y, Terrain.EMPTY); - } else if (door.y == room.top) { - set(level, door.x, door.y + 1, Terrain.EMPTY); - } else if (door.y == room.bottom) { - set(level, door.x, door.y - 1, Terrain.EMPTY); - } + + for (Point door : room.connected.values()) { + if (door.x == room.left) { + set( level, door.x + 1, door.y, Terrain.EMPTY ); + } else if (door.x == room.right) { + set( level, door.x - 1, door.y, Terrain.EMPTY ); + } else if (door.y == room.top) { + set( level, door.x, door.y + 1, Terrain.EMPTY ); + } else if (door.y == room.bottom) { + set( level, door.x , door.y - 1, Terrain.EMPTY ); } - } - - set( level, room.center(), Terrain.PEDESTAL ); + } + Point center = room.center(); + set( level, center, Terrain.PEDESTAL ); if (Random.Int(2) != 0){ Item prize = level.findPrizeItem(); if (prize != null) { - level.drop(prize, (room.center().x + room.center().y * level.WIDTH)); + level.drop(prize, (room.center().x + center.y * level.WIDTH)); return; } } level.drop(Generator.random( Random.oneOf( Generator.Category.POTION, - Generator.Category.SCROLL)), (room.center().x + room.center().y * level.WIDTH)); + Generator.Category.SCROLL)), (room.center().x + center.y * level.WIDTH)); } private static void paintBridge( Level level, Room room ) {