New custom games and custom rules screen (#464)

* New waves and limited respawning option.

Added ability to manipulate number of respawns per wave. Added option to hold counting for next wave until all enemies are destroyed

* Critical bug fixed

Fixed frozen wave timer when rules.waitForWaveToEnd was enabled

* Requested changes

* Missed Import

* New custom game and custom rules screen

RulePreset is now a Gamemode (because each of them has a different goal).
New button under Gamemode selection which opens a dialog to modify rules of gamemode.
Now without any mutually exclusive options

* Requested changes

* Applied some text sugestions

* Wrong waveInProgress message displaying fixed

* Unwanted text

* Text changes

* I broke git

* Fixed chrash

* More fixes

New rule : manyCores; needed for sanbox mode

* Visual fix

* Requested changes #1 : small oversights

* Moved respawning logic to Player

and another imports cleanup

* manyCores in now attackMode

* UI changes

* Given back waves to sandbox and integer input in custom rules

* Renamed functions in CustomRulesScreen

* SPACES... Actually one space...
This commit is contained in:
Franciszek Zaranowicz
2019-04-20 14:19:17 -04:00
committed by Anuken
parent 52cd4a77dd
commit af91979d4c
10 changed files with 161 additions and 70 deletions
@@ -4,7 +4,7 @@ import io.anuke.arc.Core;
import io.anuke.arc.function.Supplier;
/** Defines preset rule sets.. */
public enum RulePreset{
public enum Gamemode{
survival(() -> new Rules(){{
waveTimer = true;
waves = true;
@@ -16,11 +16,12 @@ public enum RulePreset{
waves = true;
waveTimer = false;
respawnTime = 0f;
spawns = DefaultWaves.get();
}}),
attack(() -> new Rules(){{
enemyCheat = true;
unitDrops = true;
waves = false;
attackMode = true;
}}),
pvp(() -> new Rules(){{
pvp = true;
@@ -32,11 +33,12 @@ public enum RulePreset{
playerHealthMultiplier = 0.8f;
unitBuildSpeedMultiplier = 3f;
unitHealthMultiplier = 2f;
attackMode = true;
}});
private final Supplier<Rules> rules;
RulePreset(Supplier<Rules> rules){
Gamemode(Supplier<Rules> rules){
this.rules = rules;
}
@@ -45,4 +45,12 @@ public class Rules{
public byte zone = -1;
/** Spawn layout. Since only zones modify this, it should be assigned on save load. */
public transient Array<SpawnGroup> spawns = DefaultWaves.get();
/** Determines if there should be limited respawns. */
public boolean limitedRespawns = false;
/** How many times player can respawn during one wave. */
public int respawns = 5;
/** Hold wave timer until all enemies are destroyed. */
public boolean waitForWaveToEnd = false;
/** Determinates if gamemode is attack mode */
public boolean attackMode = false;
}