Amount of variant gladiators follow max wave size
This commit is contained in:
parent
783f402051
commit
7db451108c
@ -84,10 +84,10 @@ public class Arena : MonoBehaviour {
|
||||
soundManager.PlaySound(waveSource, waveSounds, randomPitch: true, createTempSourceIfBusy: true);
|
||||
while (amountSpawned < currWaveSize) {
|
||||
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);
|
||||
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);
|
||||
heavyAmountSpawned++;
|
||||
}else{
|
||||
|
||||
@ -8,6 +8,14 @@ public class ArenaStats : ScriptableObject {
|
||||
[Min(0f)] public int maxWaveSize = 10;
|
||||
[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("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 heavy")] public float heavyRatio = 0.1f;
|
||||
|
||||
private void Awake() {
|
||||
if(regularBeforeHeavy > maxWaveSize)regularBeforeHeavy=maxWaveSize;
|
||||
if(regularBeforeLight > maxWaveSize)regularBeforeLight=maxWaveSize;
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user