Disabled flow fields for RTS / Removed pathfind command
This commit is contained in:
BIN
core/assets-raw/sprites/units/locus.png
Normal file
BIN
core/assets-raw/sprites/units/locus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 426 B |
@@ -94,11 +94,14 @@ public class Pathfinder implements Runnable{
|
|||||||
tiles[i] = packTile(tile, 0);
|
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();
|
start();
|
||||||
|
|||||||
@@ -3,13 +3,9 @@ package mindustry.ai.types;
|
|||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.ai.*;
|
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.logic.*;
|
import mindustry.logic.*;
|
||||||
import mindustry.world.*;
|
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
|
||||||
|
|
||||||
public class LogicAI extends AIController{
|
public class LogicAI extends AIController{
|
||||||
/** Minimum delay between item transfers. */
|
/** Minimum delay between item transfers. */
|
||||||
@@ -68,20 +64,6 @@ public class LogicAI extends AIController{
|
|||||||
case approach -> {
|
case approach -> {
|
||||||
moveTo(Tmp.v1.set(moveX, moveY), moveRad - 7f, 7);
|
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 -> {
|
case stop -> {
|
||||||
unit.clearBuilding();
|
unit.clearBuilding();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,11 @@ public class Team implements Comparable<Team>{
|
|||||||
return (state.rules.waves || state.rules.attackMode) && this == state.rules.waveTeam;
|
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){
|
public boolean isEnemy(Team other){
|
||||||
return this != other;
|
return this != other;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -392,9 +392,6 @@ public class LExecutor{
|
|||||||
case within -> {
|
case within -> {
|
||||||
exec.setnum(p4, unit.within(x1, y1, d1) ? 1 : 0);
|
exec.setnum(p4, unit.within(x1, y1, d1) ? 1 : 0);
|
||||||
}
|
}
|
||||||
case pathfind -> {
|
|
||||||
ai.control = type;
|
|
||||||
}
|
|
||||||
case target -> {
|
case target -> {
|
||||||
ai.posTarget.set(x1, y1);
|
ai.posTarget.set(x1, y1);
|
||||||
ai.aimControl = type;
|
ai.aimControl = type;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ public enum LUnitControl{
|
|||||||
move("x", "y"),
|
move("x", "y"),
|
||||||
approach("x", "y", "radius"),
|
approach("x", "y", "radius"),
|
||||||
boost("enable"),
|
boost("enable"),
|
||||||
pathfind,
|
|
||||||
target("x", "y", "shoot"),
|
target("x", "y", "shoot"),
|
||||||
targetp("unit", "shoot"),
|
targetp("unit", "shoot"),
|
||||||
itemDrop("to", "amount"),
|
itemDrop("to", "amount"),
|
||||||
|
|||||||
@@ -449,7 +449,7 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
Schematics.placeLaunchLoadout(spawnX, spawnY);
|
Schematics.placeLaunchLoadout(spawnX, spawnY);
|
||||||
|
|
||||||
//all sectors are wave sectors
|
//all sectors are wave sectors
|
||||||
state.rules.waves = true;
|
state.rules.waves = false;
|
||||||
state.rules.showSpawns = true;
|
state.rules.showSpawns = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user