protected IEnumerator HandleCombatWaves(Dungeon d, RoomHandler newRoom, Chest sourceChest) { DrillWaveDefinition[] wavesToUse = this.D_Quality_Waves; switch (GameManager.Instance.RewardManager.GetQualityFromChest(sourceChest)) { case PickupObject.ItemQuality.C: wavesToUse = this.C_Quality_Waves; break; case PickupObject.ItemQuality.B: wavesToUse = this.B_Quality_Waves; break; case PickupObject.ItemQuality.A: wavesToUse = this.A_Quality_Waves; break; case PickupObject.ItemQuality.S: wavesToUse = this.S_Quality_Waves; break; } foreach (DrillWaveDefinition currentWave in wavesToUse) { int numEnemiesToSpawn = Random.Range(currentWave.MinEnemies, currentWave.MaxEnemies + 1); for (int i = 0; i < numEnemiesToSpawn; i++) { newRoom.AddSpecificEnemyToRoomProcedurally(d.GetWeightedProceduralEnemy().enemyGuid, true, null); } yield return(new WaitForSeconds(3f)); while (newRoom.GetActiveEnemiesCount(RoomHandler.ActiveEnemyType.RoomClear) > 0) { yield return(new WaitForSeconds(1f)); } if (newRoom.GetActiveEnemiesCount(RoomHandler.ActiveEnemyType.All) > 0) { List <AIActor> activeEnemies = newRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All); for (int j = 0; j < activeEnemies.Count; j++) { if (activeEnemies[j].IsNormalEnemy) { activeEnemies[j].EraseFromExistence(false); } } } } yield break; }
public static void EnemySpawner(string[] enemyguid) { RoomHandler currentRoom = GameManager.Instance.PrimaryPlayer.CurrentRoom; currentRoom.AddSpecificEnemyToRoomProcedurally(enemyguid[0]); }