Wave send rule
This commit is contained in:
@@ -1145,6 +1145,7 @@ rules.coreincinerates = Core Incinerates Overflow
|
|||||||
rules.disableworldprocessors = Disable World Processors
|
rules.disableworldprocessors = Disable World Processors
|
||||||
rules.schematic = Schematics Allowed
|
rules.schematic = Schematics Allowed
|
||||||
rules.wavetimer = Wave Timer
|
rules.wavetimer = Wave Timer
|
||||||
|
rules.wavesending = Wave Sending
|
||||||
rules.waves = Waves
|
rules.waves = Waves
|
||||||
rules.attack = Attack Mode
|
rules.attack = Attack Mode
|
||||||
rules.rtsai = RTS AI
|
rules.rtsai = RTS AI
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ public class Rules{
|
|||||||
public TeamRules teams = new TeamRules();
|
public TeamRules teams = new TeamRules();
|
||||||
/** Whether the waves come automatically on a timer. If not, waves come when the play button is pressed. */
|
/** Whether the waves come automatically on a timer. If not, waves come when the play button is pressed. */
|
||||||
public boolean waveTimer = true;
|
public boolean waveTimer = true;
|
||||||
|
/** Whether the waves can be manually summoned with the play button. */
|
||||||
|
public boolean waveSending = true;
|
||||||
/** Whether waves are spawnable at all. */
|
/** Whether waves are spawnable at all. */
|
||||||
public boolean waves;
|
public boolean waves;
|
||||||
/** Whether the game objective is PvP. Note that this enables automatic hosting. */
|
/** Whether the game objective is PvP. Note that this enables automatic hosting. */
|
||||||
|
|||||||
@@ -1401,6 +1401,7 @@ public class LExecutor{
|
|||||||
case wave -> state.wave = exec.numi(value);
|
case wave -> state.wave = exec.numi(value);
|
||||||
case currentWaveTime -> state.wavetime = exec.numf(value) * 60f;
|
case currentWaveTime -> state.wavetime = exec.numf(value) * 60f;
|
||||||
case waves -> state.rules.waves = exec.bool(value);
|
case waves -> state.rules.waves = exec.bool(value);
|
||||||
|
case waveSending -> state.rules.waveSending = exec.bool(value);
|
||||||
case attackMode -> state.rules.attackMode = exec.bool(value);
|
case attackMode -> state.rules.attackMode = exec.bool(value);
|
||||||
case waveSpacing -> state.rules.waveSpacing = exec.numf(value) * 60f;
|
case waveSpacing -> state.rules.waveSpacing = exec.numf(value) * 60f;
|
||||||
case enemyCoreBuildRadius -> state.rules.enemyCoreBuildRadius = exec.numf(value) * 8f;
|
case enemyCoreBuildRadius -> state.rules.enemyCoreBuildRadius = exec.numf(value) * 8f;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ public enum LogicRule{
|
|||||||
waves,
|
waves,
|
||||||
wave,
|
wave,
|
||||||
waveSpacing,
|
waveSpacing,
|
||||||
|
waveSending,
|
||||||
attackMode,
|
attackMode,
|
||||||
enemyCoreBuildRadius,
|
enemyCoreBuildRadius,
|
||||||
dropZoneRadius,
|
dropZoneRadius,
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ public class CustomRulesDialog extends BaseDialog{
|
|||||||
title("@rules.title.waves");
|
title("@rules.title.waves");
|
||||||
check("@rules.waves", b -> rules.waves = b, () -> rules.waves);
|
check("@rules.waves", b -> rules.waves = b, () -> rules.waves);
|
||||||
check("@rules.wavetimer", b -> rules.waveTimer = b, () -> rules.waveTimer);
|
check("@rules.wavetimer", b -> rules.waveTimer = b, () -> rules.waveTimer);
|
||||||
|
check("@rules.wavesending", b -> rules.waveSending = b, () -> rules.waveSending);
|
||||||
check("@rules.waitForWaveToEnd", b -> rules.waitEnemies = b, () -> rules.waitEnemies);
|
check("@rules.waitForWaveToEnd", b -> rules.waitEnemies = b, () -> rules.waitEnemies);
|
||||||
number("@rules.wavespacing", false, f -> rules.waveSpacing = f * 60f, () -> rules.waveSpacing / 60f, () -> rules.waveTimer, 1, Float.MAX_VALUE);
|
number("@rules.wavespacing", false, f -> rules.waveSpacing = f * 60f, () -> rules.waveSpacing / 60f, () -> rules.waveTimer, 1, Float.MAX_VALUE);
|
||||||
//this is experimental, because it's not clear that 0 makes it default.
|
//this is experimental, because it's not clear that 0 makes it default.
|
||||||
|
|||||||
@@ -908,7 +908,7 @@ public class HudFragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean canSkipWave(){
|
private boolean canSkipWave(){
|
||||||
return state.rules.waves && ((net.server() || player.admin) || !net.active()) && state.enemies == 0 && !spawner.isSpawning();
|
return state.rules.waves && state.rules.waveSending && ((net.server() || player.admin) || !net.active()) && state.enemies == 0 && !spawner.isSpawning();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user