Misc minor fixes & cost balance

This commit is contained in:
Anuken
2022-10-21 17:24:10 -04:00
parent a137a9a1da
commit 52b1372324
3 changed files with 14 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ public class CommandAI extends AIController{
/** All encountered unreachable buildings of this AI. Why a sequence? Because contains() is very rarely called on it. */
public IntSeq unreachableBuildings = new IntSeq(8);
protected boolean stopAtTarget;
protected boolean stopAtTarget, stopWhenInRange;
protected Vec2 lastTargetPos;
protected int pathId = -1;
protected Seq<Unit> local = new Seq<>(false);
@@ -194,6 +194,11 @@ public class CommandAI extends AIController{
}
}
if(stopWhenInRange && targetPos != null && unit.within(targetPos, engageRange - 1f)){
targetPos = null;
stopWhenInRange = false;
}
}else if(target != null){
faceTarget();
}
@@ -240,10 +245,15 @@ public class CommandAI extends AIController{
}
public void commandPosition(Vec2 pos){
commandPosition(pos, false);
}
public void commandPosition(Vec2 pos, boolean stopWhenInRange){
targetPos = pos;
lastTargetPos = pos;
attackTarget = null;
pathId = Vars.controlPath.nextTargetId();
this.stopWhenInRange = stopWhenInRange;
}
public void commandTarget(Teamc moveTo){