initialWaveSpacing rule

This commit is contained in:
Anuken 2022-01-24 13:34:55 -05:00
parent b99a750655
commit 4a07c95e1c
5 changed files with 8 additions and 1 deletions

View File

@ -1063,6 +1063,7 @@ rules.unitcapvariable = Cores Contribute To Unit Cap
rules.unitcap = Base Unit Cap
rules.enemycorebuildradius = Enemy Core No-Build Radius:[lightgray] (tiles)
rules.wavespacing = Wave Spacing:[lightgray] (sec)
rules.initialwavespacing = Initial Wave Spacing:[lightgray] (sec)
rules.buildcostmultiplier = Build Cost Multiplier
rules.buildspeedmultiplier = Build Speed Multiplier
rules.deconstructrefundmultiplier = Deconstruct Refund Multiplier

Binary file not shown.

View File

@ -168,7 +168,7 @@ public class Logic implements ApplicationListener{
public void play(){
state.set(State.playing);
//grace period of 2x wave time before game starts
state.wavetime = state.rules.waveSpacing * 2;
state.wavetime = state.rules.initialWaveSpacing <= 0 ? state.rules.waveSpacing * 2 : state.rules.initialWaveSpacing;
Events.fire(new PlayEvent());
//add starting items

View File

@ -81,6 +81,8 @@ public class Rules{
public float dropZoneRadius = 300f;
/** Time between waves in ticks. */
public float waveSpacing = 2 * Time.toMinutes;
/** Starting wave spacing; if <0, uses waveSpacing * 2. */
public float initialWaveSpacing = 0f;
/** Wave after which the player 'wins'. Used in sectors. Use a value <= 0 to disable. */
public int winWave = 0;
/** Base unit cap. Can still be increased by blocks. */

View File

@ -141,6 +141,10 @@ public class CustomRulesDialog extends BaseDialog{
check("@rules.wavetimer", b -> rules.waveTimer = b, () -> rules.waveTimer);
check("@rules.waitForWaveToEnd", b -> rules.waitEnemies = b, () -> rules.waitEnemies);
number("@rules.wavespacing", false, f -> rules.waveSpacing = f * 60f, () -> rules.waveSpacing / 60f, () -> true, 1, Float.MAX_VALUE);
//this is experimental, because it's not clear that 0 makes it default.
if(experimental){
number("@rules.initialwavespacing", false, f -> rules.initialWaveSpacing = f * 60f, () -> rules.initialWaveSpacing / 60f, () -> true, 0, Float.MAX_VALUE);
}
number("@rules.dropzoneradius", false, f -> rules.dropZoneRadius = f * tilesize, () -> rules.dropZoneRadius / tilesize, () -> true);
title("@rules.title.resourcesbuilding");