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; } } } }
@Override public void activate() { for (Mob mob : Dungeon.level.mobs) { mob.beckon(pos); } if (Dungeon.visible[pos]) { GLog.w("The trap emits a piercing sound that echoes throughout the dungeon!"); CellEmitter.center(pos).start(Speck.factory(Speck.SCREAM), 0.3f, 3); } Sample.INSTANCE.play(Assets.SND_ALERT); for (int i = 0; i < (Dungeon.depth - 5) / 5; i++) { Guardian guardian = new Guardian(); guardian.state = guardian.WANDERING; guardian.pos = Dungeon.level.randomRespawnCell(); GameScene.add(guardian); guardian.beckon(Dungeon.hero.pos); } }
@Override public void activate() { Char ch = Actor.findChar(pos); if (ch != null) { int len = Random.Int(5, 10); Buff.prolong(ch, Blindness.class, len); Buff.prolong(ch, Cripple.class, len); if (ch instanceof Mob) { if (((Mob) ch).state == ((Mob) ch).HUNTING) ((Mob) ch).state = ((Mob) ch).WANDERING; ((Mob) ch).beckon(Dungeon.level.randomDestination()); } } if (Dungeon.visible[pos]) { CellEmitter.get(pos).burst(Speck.factory(Speck.LIGHT), 4); } }