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;
}
}
}
}
Aggregations