Slightly more reasonable waves
This commit is contained in:
@@ -36,8 +36,8 @@ public class Vars implements Loadable{
|
|||||||
public static boolean loadLocales = true;
|
public static boolean loadLocales = true;
|
||||||
/** Whether the logger is loaded. */
|
/** Whether the logger is loaded. */
|
||||||
public static boolean loadedLogger = false, loadedFileLogger = false;
|
public static boolean loadedLogger = false, loadedFileLogger = false;
|
||||||
/** Whether to show the cliff button in the editor*/
|
/** Whether to enable various experimental features (e.g. cliffs) */
|
||||||
public static boolean addCliffButton = false;
|
public static boolean experimental = false;
|
||||||
/** Maximum extra padding around deployment schematics. */
|
/** Maximum extra padding around deployment schematics. */
|
||||||
public static final int maxLoadoutSchematicPad = 5;
|
public static final int maxLoadoutSchematicPad = 5;
|
||||||
/** Maximum schematic size.*/
|
/** Maximum schematic size.*/
|
||||||
|
|||||||
@@ -570,7 +570,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
}).growX().top();
|
}).growX().top();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(addCliffButton){
|
if(experimental){
|
||||||
mid.row();
|
mid.row();
|
||||||
|
|
||||||
mid.table(t -> {
|
mid.table(t -> {
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
super("@waves.title");
|
super("@waves.title");
|
||||||
|
|
||||||
shown(this::setup);
|
shown(this::setup);
|
||||||
hidden(() -> {
|
hidden(() -> state.rules.spawns = groups);
|
||||||
state.rules.spawns = groups;
|
|
||||||
});
|
|
||||||
|
|
||||||
addCloseListener();
|
addCloseListener();
|
||||||
|
|
||||||
@@ -96,6 +94,14 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
view(1);
|
view(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(experimental){
|
||||||
|
buttons.button("Random", Icon.refresh, () -> {
|
||||||
|
groups.clear();
|
||||||
|
groups = DefaultWaves.generate(1f / 10f);
|
||||||
|
updateWaves();
|
||||||
|
}).width(200f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void view(int amount){
|
void view(int amount){
|
||||||
|
|||||||
@@ -262,9 +262,7 @@ public class DefaultWaves{
|
|||||||
{dagger, mace, fortress, scepter, reign},
|
{dagger, mace, fortress, scepter, reign},
|
||||||
{nova, pulsar, quasar, vela, corvus},
|
{nova, pulsar, quasar, vela, corvus},
|
||||||
{crawler, atrax, spiroct, arkyid, toxopid},
|
{crawler, atrax, spiroct, arkyid, toxopid},
|
||||||
//{risso, minke, bryde, sei, omura}, //questionable choices
|
{flare, horizon, rand.chance(0.2) && difficulty > 0.5 ? poly : zenith, rand.chance(0.5) ? quad : antumbra, rand.chance(0.1) ? quad : eclipse}
|
||||||
{flare, horizon, difficulty > 0.5 ? poly : zenith, quad, quad},
|
|
||||||
{flare, horizon, zenith, antumbra, eclipse}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//required progression:
|
//required progression:
|
||||||
@@ -276,6 +274,7 @@ public class DefaultWaves{
|
|||||||
int cap = 150;
|
int cap = 150;
|
||||||
|
|
||||||
float shieldStart = 30, shieldsPerWave = 20 + difficulty*30f;
|
float shieldStart = 30, shieldsPerWave = 20 + difficulty*30f;
|
||||||
|
float[] scaling = {1, 1, 1.5f, 3f, 4f};
|
||||||
|
|
||||||
Intc createProgression = start -> {
|
Intc createProgression = start -> {
|
||||||
//main sequence
|
//main sequence
|
||||||
@@ -284,18 +283,19 @@ public class DefaultWaves{
|
|||||||
|
|
||||||
for(int i = start; i < cap;){
|
for(int i = start; i < cap;){
|
||||||
int f = i;
|
int f = i;
|
||||||
int next = rand.random(8, 16);
|
int next = rand.random(8, 16) + curTier * 4;
|
||||||
|
|
||||||
float shieldAmount = Math.max((i - shieldStart) * shieldsPerWave, 0);
|
float shieldAmount = Math.max((i - shieldStart) * shieldsPerWave, 0);
|
||||||
int space = start == 0 ? 1 : rand.random(1, 2);
|
int space = start == 0 ? 1 : rand.random(1, 2);
|
||||||
|
int ctier = curTier;
|
||||||
|
|
||||||
//main progression
|
//main progression
|
||||||
out.add(new SpawnGroup(curSpecies[Math.min(curTier, curSpecies.length - 1)]){{
|
out.add(new SpawnGroup(curSpecies[Math.min(curTier, curSpecies.length - 1)]){{
|
||||||
unitAmount = f == 0 ? 1 : 10;
|
unitAmount = f == start ? 1 : 6 / (int)scaling[ctier];
|
||||||
begin = f;
|
begin = f;
|
||||||
end = f + next >= cap ? never : f + next;
|
end = f + next >= cap ? never : f + next;
|
||||||
max = 14;
|
max = 14;
|
||||||
unitScaling = rand.random(1f, 3f);
|
unitScaling = (difficulty < 0.4f ? rand.random(2f, 4f) : rand.random(1f, 3f)) * scaling[ctier];
|
||||||
shields = shieldAmount;
|
shields = shieldAmount;
|
||||||
shieldScaling = shieldsPerWave;
|
shieldScaling = shieldsPerWave;
|
||||||
spacing = space;
|
spacing = space;
|
||||||
@@ -303,18 +303,18 @@ public class DefaultWaves{
|
|||||||
|
|
||||||
//extra progression that tails out, blends in
|
//extra progression that tails out, blends in
|
||||||
out.add(new SpawnGroup(curSpecies[Math.min(curTier, curSpecies.length - 1)]){{
|
out.add(new SpawnGroup(curSpecies[Math.min(curTier, curSpecies.length - 1)]){{
|
||||||
unitAmount = 6;
|
unitAmount = 3 / (int)scaling[ctier];
|
||||||
begin = f + next;
|
begin = f + next - 1;
|
||||||
end = f + next + rand.random(8, 12);
|
end = f + next + rand.random(6, 10);
|
||||||
max = 11;
|
max = 6;
|
||||||
unitScaling = rand.random(2f);
|
unitScaling = rand.random(1f, 2f);
|
||||||
spacing = rand.random(2, 3);
|
spacing = rand.random(2, 4);
|
||||||
shields = shieldAmount;
|
shields = shieldAmount/2f;
|
||||||
shieldScaling = shieldsPerWave;
|
shieldScaling = shieldsPerWave;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
i += next;
|
i += next + 1;
|
||||||
if(curTier < 3 || rand.chance(0.2)){
|
if(curTier < 3 || rand.chance(0.05)){
|
||||||
curTier ++;
|
curTier ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,11 +330,11 @@ public class DefaultWaves{
|
|||||||
|
|
||||||
createProgression.get(0);
|
createProgression.get(0);
|
||||||
|
|
||||||
int step = 5 + rand.random(3);
|
int step = 5 + rand.random(5);
|
||||||
|
|
||||||
while(step <= cap){
|
while(step <= cap){
|
||||||
createProgression.get(step);
|
createProgression.get(step);
|
||||||
step += (int)(rand.random(13, 25) * Mathf.lerp(1f, 0.5f, difficulty));
|
step += (int)(rand.random(15, 30) * Mathf.lerp(1f, 0.5f, difficulty));
|
||||||
}
|
}
|
||||||
|
|
||||||
int bossWave = (int)(rand.random(30, 60) * Mathf.lerp(1f, 0.7f, difficulty));
|
int bossWave = (int)(rand.random(30, 60) * Mathf.lerp(1f, 0.7f, difficulty));
|
||||||
|
|||||||
Reference in New Issue
Block a user