Search in sources :

Example 1 with RatKing

use of com.watabou.pixeldungeon.actors.mobs.npcs.RatKing in project pixel-dungeon by watabou.

the class RatKingPainter method paint.

public static void paint(Level level, Room room) {
    fill(level, room, Terrain.WALL);
    fill(level, room, 1, Terrain.EMPTY_SP);
    Room.Door entrance = room.entrance();
    entrance.set(Room.Door.Type.HIDDEN);
    int door = entrance.x + entrance.y * Level.WIDTH;
    for (int i = room.left + 1; i < room.right; i++) {
        addChest(level, (room.top + 1) * Level.WIDTH + i, door);
        addChest(level, (room.bottom - 1) * Level.WIDTH + i, door);
    }
    for (int i = room.top + 2; i < room.bottom - 1; i++) {
        addChest(level, i * Level.WIDTH + room.left + 1, door);
        addChest(level, i * Level.WIDTH + room.right - 1, door);
    }
    while (true) {
        Heap chest = level.heaps.get(room.random());
        if (chest != null) {
            chest.type = Heap.Type.MIMIC;
            break;
        }
    }
    RatKing king = new RatKing();
    king.pos = room.random(1);
    level.mobs.add(king);
}
Also used : RatKing(com.watabou.pixeldungeon.actors.mobs.npcs.RatKing) Room(com.watabou.pixeldungeon.levels.Room) Heap(com.watabou.pixeldungeon.items.Heap)

Aggregations

RatKing (com.watabou.pixeldungeon.actors.mobs.npcs.RatKing)1 Heap (com.watabou.pixeldungeon.items.Heap)1 Room (com.watabou.pixeldungeon.levels.Room)1