diff --git a/core/assets-raw/sprites/units/locus.png b/core/assets-raw/sprites/units/locus.png new file mode 100644 index 0000000000..453eeddadf Binary files /dev/null and b/core/assets-raw/sprites/units/locus.png differ diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index 8e78ccb284..85b12ac1cf 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -94,11 +94,14 @@ public class Pathfinder implements Runnable{ tiles[i] = packTile(tile, 0); } - preloadPath(getField(state.rules.waveTeam, costGround, fieldCore)); + if(state.rules.waveTeam.needsFlowField()){ + preloadPath(getField(state.rules.waveTeam, costGround, fieldCore)); + + //preload water on naval maps + if(spawner.getSpawns().contains(t -> t.floor().isLiquid)){ + preloadPath(getField(state.rules.waveTeam, costNaval, fieldCore)); + } - //preload water on naval maps - if(spawner.getSpawns().contains(t -> t.floor().isLiquid)){ - preloadPath(getField(state.rules.waveTeam, costNaval, fieldCore)); } start(); diff --git a/core/src/mindustry/ai/types/LogicAI.java b/core/src/mindustry/ai/types/LogicAI.java index c74a6edbf4..1bc1710eb7 100644 --- a/core/src/mindustry/ai/types/LogicAI.java +++ b/core/src/mindustry/ai/types/LogicAI.java @@ -3,13 +3,9 @@ package mindustry.ai.types; import arc.math.*; import arc.struct.*; import arc.util.*; -import mindustry.ai.*; import mindustry.entities.units.*; import mindustry.gen.*; import mindustry.logic.*; -import mindustry.world.*; - -import static mindustry.Vars.*; public class LogicAI extends AIController{ /** Minimum delay between item transfers. */ @@ -68,20 +64,6 @@ public class LogicAI extends AIController{ case approach -> { moveTo(Tmp.v1.set(moveX, moveY), moveRad - 7f, 7); } - case pathfind -> { - Building core = unit.closestEnemyCore(); - - if((core == null || !unit.within(core, unit.range() * 0.5f))){ - boolean move = true; - - if(state.rules.waves && unit.team == state.rules.defaultTeam){ - Tile spawner = getClosestSpawner(); - if(spawner != null && unit.within(spawner, state.rules.dropZoneRadius + 120f)) move = false; - } - - if(move) pathfind(Pathfinder.fieldCore); - } - } case stop -> { unit.clearBuilding(); } diff --git a/core/src/mindustry/game/Team.java b/core/src/mindustry/game/Team.java index e39a6cdf24..a3a45485b1 100644 --- a/core/src/mindustry/game/Team.java +++ b/core/src/mindustry/game/Team.java @@ -110,6 +110,11 @@ public class Team implements Comparable{ return (state.rules.waves || state.rules.attackMode) && this == state.rules.waveTeam; } + /** @return whether this team needs a flow field for "dumb" wave pathfinding. */ + public boolean needsFlowField(){ + return isAI() && !rules().rtsAi; + } + public boolean isEnemy(Team other){ return this != other; } diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index 9a8f3242d4..8ea1a7c4fe 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -392,9 +392,6 @@ public class LExecutor{ case within -> { exec.setnum(p4, unit.within(x1, y1, d1) ? 1 : 0); } - case pathfind -> { - ai.control = type; - } case target -> { ai.posTarget.set(x1, y1); ai.aimControl = type; diff --git a/core/src/mindustry/logic/LUnitControl.java b/core/src/mindustry/logic/LUnitControl.java index 26dee47d48..fd7606e104 100644 --- a/core/src/mindustry/logic/LUnitControl.java +++ b/core/src/mindustry/logic/LUnitControl.java @@ -6,7 +6,6 @@ public enum LUnitControl{ move("x", "y"), approach("x", "y", "radius"), boost("enable"), - pathfind, target("x", "y", "shoot"), targetp("unit", "shoot"), itemDrop("to", "amount"), diff --git a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java index 768626e6d7..90c96ebcc0 100644 --- a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java @@ -449,7 +449,7 @@ public class ErekirPlanetGenerator extends PlanetGenerator{ Schematics.placeLaunchLoadout(spawnX, spawnY); //all sectors are wave sectors - state.rules.waves = true; + state.rules.waves = false; state.rules.showSpawns = true; } }