Amount of variant gladiators follow max wave size

This commit is contained in:
Soulaha Balde 2022-04-04 15:27:21 -04:00
parent 783f402051
commit 7db451108c
2 changed files with 10 additions and 2 deletions

View File

@ -84,10 +84,10 @@ public class Arena : MonoBehaviour {
soundManager.PlaySound(waveSource, waveSounds, randomPitch: true, createTempSourceIfBusy: true); soundManager.PlaySound(waveSource, waveSounds, randomPitch: true, createTempSourceIfBusy: true);
while (amountSpawned < currWaveSize) { while (amountSpawned < currWaveSize) {
currentSpawner = Random.Range(0, spawners.Length); currentSpawner = Random.Range(0, spawners.Length);
if(currWaveSize >= .5*stats.maxWaveSize && lightAmountSpawned <= stats.maxWaveSize * stats.lightRatio){ if(currWaveSize >= stats.regularBeforeLight && lightAmountSpawned <= stats.maxWaveSize * stats.lightRatio){
SpawnEnemy(currentSpawner, lightGladiator); SpawnEnemy(currentSpawner, lightGladiator);
lightAmountSpawned++; lightAmountSpawned++;
}else if(currWaveSize >= .8*stats.maxWaveSize && heavyAmountSpawned <= stats.maxWaveSize * stats.heavyRatio){ }else if(currWaveSize >= stats.regularBeforeHeavy && heavyAmountSpawned <= stats.maxWaveSize * stats.heavyRatio){
SpawnEnemy(currentSpawner, heavyGladiator); SpawnEnemy(currentSpawner, heavyGladiator);
heavyAmountSpawned++; heavyAmountSpawned++;
}else{ }else{

View File

@ -8,6 +8,14 @@ public class ArenaStats : ScriptableObject {
[Min(0f)] public int maxWaveSize = 10; [Min(0f)] public int maxWaveSize = 10;
[Min(0f), Tooltip("The amount of gladiator to add to wave")] public int waveIncrease = 1; [Min(0f), Tooltip("The amount of gladiator to add to wave")] public int waveIncrease = 1;
[Min(0f), Tooltip("How many waves before we increase by WaveIncrease")] public int increaseWaveStep = 3; [Min(0f), Tooltip("How many waves before we increase by WaveIncrease")] public int increaseWaveStep = 3;
[Min(0f), Tooltip("Amount of regular before light start spawning")] public int regularBeforeLight = 5;
[Min(0f), Tooltip("Amount of regular before heavy start spawning")] public int regularBeforeHeavy = 8;
[Range(0f, 1f), Tooltip("Percentage of gladiator who are light")] public float lightRatio = 0.25f; [Range(0f, 1f), Tooltip("Percentage of gladiator who are light")] public float lightRatio = 0.25f;
[Range(0f, 1f), Tooltip("Percentage of gladiator who are heavy")] public float heavyRatio = 0.1f; [Range(0f, 1f), Tooltip("Percentage of gladiator who are heavy")] public float heavyRatio = 0.1f;
private void Awake() {
if(regularBeforeHeavy > maxWaveSize)regularBeforeHeavy=maxWaveSize;
if(regularBeforeLight > maxWaveSize)regularBeforeLight=maxWaveSize;
}
} }