Disabled flow fields for RTS / Removed pathfind command
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -110,6 +110,11 @@ public class Team implements Comparable<Team>{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user