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