Search in sources :

Example 1 with Blacksmith

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

the class BlacksmithPainter method paint.

public static void paint(Level level, Room room) {
    fill(level, room, Terrain.WALL);
    fill(level, room, 1, Terrain.FIRE_TRAP);
    fill(level, room, 2, Terrain.EMPTY_SP);
    for (int i = 0; i < 2; i++) {
        int pos;
        do {
            pos = room.random();
        } while (level.map[pos] != Terrain.EMPTY_SP);
        level.drop(Generator.random(Random.oneOf(Generator.Category.ARMOR, Generator.Category.WEAPON)), pos);
    }
    for (Room.Door door : room.connected.values()) {
        door.set(Room.Door.Type.UNLOCKED);
        drawInside(level, room, door, 1, Terrain.EMPTY);
    }
    Blacksmith npc = new Blacksmith();
    do {
        npc.pos = room.random(1);
    } while (level.heaps.get(npc.pos) != null);
    level.mobs.add(npc);
    Actor.occupyCell(npc);
}
Also used : Blacksmith(com.watabou.pixeldungeon.actors.mobs.npcs.Blacksmith) Room(com.watabou.pixeldungeon.levels.Room)

Aggregations

Blacksmith (com.watabou.pixeldungeon.actors.mobs.npcs.Blacksmith)1 Room (com.watabou.pixeldungeon.levels.Room)1