initialWaveSpacing rule
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user