public void spawnBoss(Mob mob) { while (true) { mob.pos = Random.Int(LENGTH); if (findMob(mob.pos) == null && Level.passable[mob.pos] && !fieldOfView[mob.pos]) { if (Dungeon.level != null) { GameScene.add(mob); } else { mobs.add(mob); } if (mob instanceof Yog) { ((Yog) mob).spawnFists(); } break; } } }
public void spawnMobs() { int mobsToSpawn = Random.Int(5, 10); while (mobsToSpawn > 0) { Mob mob = Bestiary.mob(Dungeon.wave); mob.pos = Random.Int(LENGTH); if (findMob(mob.pos) == null && Level.passable[mob.pos] && !fieldOfView[mob.pos] && Level.distance(mob.pos, entrance) > 1) { mobsToSpawn--; if (Dungeon.level instanceof ArenaLevel) { GameScene.add(mob); } else { mobs.add(mob); } } } }