From 3e3c88bd2628dc9582348cacce2255f8c0ad0987 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 9 Apr 2022 14:03:17 -0400 Subject: [PATCH] Bugfixes --- core/src/mindustry/content/Planets.java | 1 + core/src/mindustry/content/UnitTypes.java | 3 +++ core/src/mindustry/core/Control.java | 10 ++++++---- core/src/mindustry/input/DesktopInput.java | 2 ++ core/src/mindustry/type/Planet.java | 2 ++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/content/Planets.java b/core/src/mindustry/content/Planets.java index e990268384..4a0be575d3 100644 --- a/core/src/mindustry/content/Planets.java +++ b/core/src/mindustry/content/Planets.java @@ -113,6 +113,7 @@ public class Planets{ new HexSkyMesh(this, 1, 0.6f, 0.16f, 5, Color.white.cpy().lerp(Pal.spore, 0.55f).a(0.75f), 2, 0.45f, 1f, 0.41f) ); + allowWaves = true; allowWaveSimulation = true; allowSectorInvasion = true; allowLaunchSchematics = true; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index c37f939f66..79ea0b9daa 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2456,6 +2456,7 @@ public class UnitTypes{ rotateSpeed = 3.5f; health = 800; armor = 5f; + itemCapacity = 0; treadRects = new Rect[]{new Rect(12, 7, 14, 51)}; researchCostMultiplier = 0f; @@ -2496,6 +2497,7 @@ public class UnitTypes{ rotateSpeed = 2.6f; health = 2000; armor = 8f; + itemCapacity = 0; treadRects = new Rect[]{new Rect(17, 10, 19, 76)}; researchCostMultiplier = 0f; @@ -2582,6 +2584,7 @@ public class UnitTypes{ speed = 0.63f; health = 9000; armor = 20f; + itemCapacity = 0; crushDamage = 13f / 5f; treadRects = new Rect[]{new Rect(22, 16, 28, 130)}; diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index 5bde4d11ec..4b8a2f0b2e 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -382,11 +382,13 @@ public class Control implements ApplicationListener, Loadable{ state.wavetime = state.rules.initialWaveSpacing <= 0f ? (state.rules.waveSpacing * (sector.preset == null ? 2f : sector.preset.startWaveTimeMultiplier)) : state.rules.initialWaveSpacing; //reset captured state sector.info.wasCaptured = false; - //re-enable waves - state.rules.waves = true; - //reset win wave?? - state.rules.winWave = state.rules.attackMode ? -1 : sector.preset != null && sector.preset.captureWave > 0 ? sector.preset.captureWave : state.rules.winWave > state.wave ? state.rules.winWave : 30; + if(state.rules.sector.planet.allowWaves){ + //re-enable waves + state.rules.waves = true; + //reset win wave?? + state.rules.winWave = state.rules.attackMode ? -1 : sector.preset != null && sector.preset.captureWave > 0 ? sector.preset.captureWave : state.rules.winWave > state.wave ? state.rules.winWave : 30; + } //if there's still an enemy base left, fix it if(state.rules.attackMode){ diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 9deec40430..cb7dd4bc96 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -751,6 +751,8 @@ public class DesktopInput extends InputHandler{ @Override public boolean touchDown(float x, float y, int pointer, KeyCode button){ + if(scene.hasMouse() || !commandMode) return false; + if(button == KeyCode.mouseRight){ //right click: move to position diff --git a/core/src/mindustry/type/Planet.java b/core/src/mindustry/type/Planet.java index 3537fe6012..0099de5872 100644 --- a/core/src/mindustry/type/Planet.java +++ b/core/src/mindustry/type/Planet.java @@ -93,6 +93,8 @@ public class Planet extends UnlockableContent{ public boolean allowSectorInvasion = false; /** If true, sectors saves are cleared when lost. */ public boolean clearSectorOnLose = false; + /** If true, waves are created on sector loss. TODO remove. */ + public boolean allowWaves = false; /** Sets up rules on game load for any sector on this planet. */ public Cons ruleSetter = r -> {}; /** Parent body that this planet orbits around. If null, this planet is considered to be in the middle of the solar system.*/