From 368c44c22f0725dde270b93f2abbab11b888ac4b Mon Sep 17 00:00:00 2001 From: EggleEgg <125359838+EggleEgg@users.noreply.github.com> Date: Fri, 25 Apr 2025 18:02:43 +0200 Subject: [PATCH] why? because people want it (#10719) --- core/src/mindustry/ai/types/MinerAI.java | 3 +++ core/src/mindustry/type/UnitType.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/core/src/mindustry/ai/types/MinerAI.java b/core/src/mindustry/ai/types/MinerAI.java index 822af9d5d7..ff66ab6116 100644 --- a/core/src/mindustry/ai/types/MinerAI.java +++ b/core/src/mindustry/ai/types/MinerAI.java @@ -71,5 +71,8 @@ public class MinerAI extends AIController{ circle(core, unit.type.range / 1.8f); } + if(!unit.type.flying){ + unit.updateBoosting(unit.type.boostWhenMining || unit.floorOn().isDuct || unit.floorOn().damageTaken > 0f || unit.floorOn().isDeep()); + } } } \ No newline at end of file diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index c99fa2090d..fd189bfc7f 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -169,6 +169,8 @@ public class UnitType extends UnlockableContent implements Senseable{ canBoost = false, /** if true, this unit will always boost when using builder AI */ boostWhenBuilding = true, + /** if true, this unit will always boost when using miner AI */ + boostWhenMining = true, /** if false, logic processors cannot control this unit */ logicControllable = true, /** if false, players cannot control this unit */ @@ -974,6 +976,9 @@ public class UnitType extends UnlockableContent implements Senseable{ if(buildSpeed > 0f){ commands.add(UnitCommand.rebuildCommand, UnitCommand.assistCommand); } + if(mineTier > 0){ + commands.add(UnitCommand.mineCommand); + } } //healing, mining and building is only supported for flying units; pathfinding to ambiguously reachable locations is hard.