Search in sources :

Example 1 with ImpShopkeeper

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

the class ShopPainter method placeShopkeeper.

private static void placeShopkeeper(Level level, Room room) {
    int pos;
    do {
        pos = room.random();
    } while (level.heaps.get(pos) != null);
    Mob shopkeeper = level instanceof LastShopLevel ? new ImpShopkeeper() : new Shopkeeper();
    shopkeeper.pos = pos;
    level.mobs.add(shopkeeper);
    if (level instanceof LastShopLevel) {
        for (int i = 0; i < Level.NEIGHBOURS9.length; i++) {
            int p = shopkeeper.pos + Level.NEIGHBOURS9[i];
            if (level.map[p] == Terrain.EMPTY_SP) {
                level.map[p] = Terrain.WATER;
            }
        }
    }
}
Also used : Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Shopkeeper(com.watabou.pixeldungeon.actors.mobs.npcs.Shopkeeper) ImpShopkeeper(com.watabou.pixeldungeon.actors.mobs.npcs.ImpShopkeeper) ImpShopkeeper(com.watabou.pixeldungeon.actors.mobs.npcs.ImpShopkeeper) LastShopLevel(com.watabou.pixeldungeon.levels.LastShopLevel) Point(com.watabou.utils.Point)

Aggregations

Mob (com.watabou.pixeldungeon.actors.mobs.Mob)1 ImpShopkeeper (com.watabou.pixeldungeon.actors.mobs.npcs.ImpShopkeeper)1 Shopkeeper (com.watabou.pixeldungeon.actors.mobs.npcs.Shopkeeper)1 LastShopLevel (com.watabou.pixeldungeon.levels.LastShopLevel)1 Point (com.watabou.utils.Point)1