v0.2.2a: reverted some changes to study rooms, corrected an error.

This commit is contained in:
Evan Debenham 2014-11-05 20:05:12 -05:00
parent b68db3bb73
commit 55ea2dbcab

View File

@ -22,7 +22,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.Room;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
@ -150,36 +149,31 @@ public class StandardPainter extends Painter {
private static void paintStudy( Level level, Room room ) { 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 + 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 ); fill( level, room.left + 2, room.top + 2, room.width() - 3, room.height() - 3 , Terrain.EMPTY_SP );
for (Room.Door door : room.connected.values()) { for (Point door : room.connected.values()) {
if (door.type == Room.Door.Type.LOCKED){ if (door.x == room.left) {
//sneaky sneaky... set( level, door.x + 1, door.y, Terrain.EMPTY );
level.addItemToSpawn(new PotionOfLiquidFlame()); } else if (door.x == room.right) {
} else { set( level, door.x - 1, door.y, Terrain.EMPTY );
if (door.x == room.left) { } else if (door.y == room.top) {
set(level, door.x + 1, door.y, Terrain.EMPTY); set( level, door.x, door.y + 1, Terrain.EMPTY );
} else if (door.x == room.right) { } else if (door.y == room.bottom) {
set(level, door.x - 1, door.y, Terrain.EMPTY); set( level, door.x , door.y - 1, 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);
}
} }
} }
Point center = room.center();
set( level, room.center(), Terrain.PEDESTAL ); set( level, center, Terrain.PEDESTAL );
if (Random.Int(2) != 0){ if (Random.Int(2) != 0){
Item prize = level.findPrizeItem(); Item prize = level.findPrizeItem();
if (prize != null) { 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; return;
} }
} }
level.drop(Generator.random( Random.oneOf( level.drop(Generator.random( Random.oneOf(
Generator.Category.POTION, 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 ) { private static void paintBridge( Level level, Room room ) {