Search in sources :

Example 16 with Room

use of com.watabou.pixeldungeon.levels.Room in project pixel-dungeon by watabou.

the class CryptPainter method paint.

public static void paint(Level level, Room room) {
    fill(level, room, Terrain.WALL);
    fill(level, room, 1, Terrain.EMPTY);
    Point c = room.center();
    int cx = c.x;
    int cy = c.y;
    Room.Door entrance = room.entrance();
    entrance.set(Room.Door.Type.LOCKED);
    level.addItemToSpawn(new IronKey());
    if (entrance.x == room.left) {
        set(level, new Point(room.right - 1, room.top + 1), Terrain.STATUE);
        set(level, new Point(room.right - 1, room.bottom - 1), Terrain.STATUE);
        cx = room.right - 2;
    } else if (entrance.x == room.right) {
        set(level, new Point(room.left + 1, room.top + 1), Terrain.STATUE);
        set(level, new Point(room.left + 1, room.bottom - 1), Terrain.STATUE);
        cx = room.left + 2;
    } else if (entrance.y == room.top) {
        set(level, new Point(room.left + 1, room.bottom - 1), Terrain.STATUE);
        set(level, new Point(room.right - 1, room.bottom - 1), Terrain.STATUE);
        cy = room.bottom - 2;
    } else if (entrance.y == room.bottom) {
        set(level, new Point(room.left + 1, room.top + 1), Terrain.STATUE);
        set(level, new Point(room.right - 1, room.top + 1), Terrain.STATUE);
        cy = room.top + 2;
    }
    level.drop(prize(level), cx + cy * Level.WIDTH).type = Type.TOMB;
}
Also used : IronKey(com.watabou.pixeldungeon.items.keys.IronKey) Point(com.watabou.utils.Point) Room(com.watabou.pixeldungeon.levels.Room) Point(com.watabou.utils.Point)

Aggregations

Room (com.watabou.pixeldungeon.levels.Room)16 Point (com.watabou.utils.Point)11 IronKey (com.watabou.pixeldungeon.items.keys.IronKey)6 Alchemy (com.watabou.pixeldungeon.actors.blobs.Alchemy)1 SacrificialFire (com.watabou.pixeldungeon.actors.blobs.SacrificialFire)1 Piranha (com.watabou.pixeldungeon.actors.mobs.Piranha)1 Statue (com.watabou.pixeldungeon.actors.mobs.Statue)1 Blacksmith (com.watabou.pixeldungeon.actors.mobs.npcs.Blacksmith)1 RatKing (com.watabou.pixeldungeon.actors.mobs.npcs.RatKing)1 Heap (com.watabou.pixeldungeon.items.Heap)1 Item (com.watabou.pixeldungeon.items.Item)1 PotionOfInvisibility (com.watabou.pixeldungeon.items.potions.PotionOfInvisibility)1 PotionOfLevitation (com.watabou.pixeldungeon.items.potions.PotionOfLevitation)1 RegularLevel (com.watabou.pixeldungeon.levels.RegularLevel)1 ArrayList (java.util.ArrayList)1