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;
@ -151,11 +150,7 @@ public class StandardPainter extends Painter {
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){
//sneaky sneaky...
level.addItemToSpawn(new PotionOfLiquidFlame());
} else {
if (door.x == room.left) { if (door.x == room.left) {
set( level, door.x + 1, door.y, Terrain.EMPTY ); set( level, door.x + 1, door.y, Terrain.EMPTY );
} else if (door.x == room.right) { } else if (door.x == room.right) {
@ -166,20 +161,19 @@ public class StandardPainter extends Painter {
set( level, door.x , door.y - 1, Terrain.EMPTY ); set( level, door.x , door.y - 1, Terrain.EMPTY );
} }
} }
} Point center = room.center();
set( level, center, Terrain.PEDESTAL );
set( level, room.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 ) {