public void dispel(){ detach(); for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])){ if (mob instanceof Wraith){ mob.die(null); } } }
@Override public boolean act() { spawnPower++; int wraiths = 1; //we include the wraith we're trying to spawn for (Mob mob : Dungeon.level.mobs){ if (mob instanceof Wraith){ wraiths++; } } int powerNeeded = Math.min(25, wraiths*wraiths); if (powerNeeded <= spawnPower){ spawnPower -= powerNeeded; int pos = 0; int tries = 20; do{ pos = Random.Int(Dungeon.level.length()); tries --; } while (tries > 0 && (!Dungeon.level.heroFOV[pos] || !Dungeon.level.passable[pos] || Actor.findChar( pos ) != null)); if (tries > 0) { Wraith.spawnAt(pos); Sample.INSTANCE.play(Assets.SND_CURSED); } } spend(TICK); return true; }
@Override public boolean act() { spawnPower++; int wraiths = 1; //we include the wraith we're trying to spawn for (Mob mob : Dungeon.level.mobs){ if (mob instanceof Wraith){ wraiths++; } } int powerNeeded = Math.min(25, wraiths*wraiths); if (powerNeeded <= spawnPower){ spawnPower -= powerNeeded; int pos = 0; int tries = 20; do{ pos = Random.Int(Dungeon.level.length()); tries --; } while (tries > 0 && (!Dungeon.level.heroFOV[pos] || !Dungeon.level.passable[pos] || Actor.findChar( pos ) != null)); if (tries > 0) { Wraith.spawnAt(pos); Sample.INSTANCE.play(Assets.SND_CURSED); } } spend(TICK); return true; }
@Override protected void onDetach() { DustGhostSpawner spawner = Dungeon.hero.buff(DustGhostSpawner.class); if (spawner != null){ spawner.dispel(); } }
@Override protected void onDetach() { DustGhostSpawner spawner = Dungeon.hero.buff(DustGhostSpawner.class); if (spawner != null){ spawner.dispel(); } }
public void dispel(){ detach(); for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])){ if (mob instanceof Wraith){ mob.die(null); } } }