Made various fields/methods public
This commit is contained in:
@@ -16,9 +16,9 @@ public class BuilderAI extends AIController{
|
||||
public static float buildRadius = 1500, retreatDst = 110f, fleeRange = 370f, retreatDelay = Time.toSeconds * 2f;
|
||||
|
||||
boolean found = false;
|
||||
float retreatTimer;
|
||||
@Nullable Unit following;
|
||||
@Nullable Teamc enemy;
|
||||
float retreatTimer;
|
||||
@Nullable BlockPlan lastPlan;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,12 +21,12 @@ public class DefenderAI extends AIController{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateTargeting(){
|
||||
public void updateTargeting(){
|
||||
if(retarget()) target = findTarget(unit.x, unit.y, unit.range(), true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Teamc findTarget(float x, float y, float range, boolean air, boolean ground){
|
||||
public Teamc findTarget(float x, float y, float range, boolean air, boolean ground){
|
||||
|
||||
//find unit to follow if not in rally mode
|
||||
if(command() != UnitCommand.rally){
|
||||
|
||||
@@ -32,7 +32,7 @@ public class FlyingAI extends AIController{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Teamc findTarget(float x, float y, float range, boolean air, boolean ground){
|
||||
public Teamc findTarget(float x, float y, float range, boolean air, boolean ground){
|
||||
var result = findMainTarget(x, y, range, air, ground);
|
||||
|
||||
//if the main target is in range, use it, otherwise target whatever is closest
|
||||
@@ -40,7 +40,7 @@ public class FlyingAI extends AIController{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Teamc findMainTarget(float x, float y, float range, boolean air, boolean ground){
|
||||
public Teamc findMainTarget(float x, float y, float range, boolean air, boolean ground){
|
||||
var core = targetFlag(x, y, BlockFlag.core, true);
|
||||
|
||||
if(core != null && Mathf.within(x, y, core.getX(), core.getY(), range)){
|
||||
|
||||
@@ -44,7 +44,7 @@ public class LogicAI extends AIController{
|
||||
private ObjectSet<Object> radars = new ObjectSet<>();
|
||||
|
||||
@Override
|
||||
protected void updateMovement(){
|
||||
public void updateMovement(){
|
||||
if(itemTimer >= 0) itemTimer -= Time.delta;
|
||||
if(payTimer >= 0) payTimer -= Time.delta;
|
||||
|
||||
@@ -114,7 +114,7 @@ public class LogicAI extends AIController{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void moveTo(Position target, float circleLength, float smooth){
|
||||
public void moveTo(Position target, float circleLength, float smooth){
|
||||
if(target == null) return;
|
||||
|
||||
vec.set(target).sub(unit);
|
||||
@@ -141,29 +141,29 @@ public class LogicAI extends AIController{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkTarget(Teamc target, float x, float y, float range){
|
||||
public boolean checkTarget(Teamc target, float x, float y, float range){
|
||||
return false;
|
||||
}
|
||||
|
||||
//always retarget
|
||||
@Override
|
||||
protected boolean retarget(){
|
||||
public boolean retarget(){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean invalid(Teamc target){
|
||||
public boolean invalid(Teamc target){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldShoot(){
|
||||
public boolean shouldShoot(){
|
||||
return shoot && !(unit.type.canBoost && boost);
|
||||
}
|
||||
|
||||
//always aim for the main target
|
||||
@Override
|
||||
protected Teamc target(float x, float y, float range, boolean air, boolean ground){
|
||||
public Teamc target(float x, float y, float range, boolean air, boolean ground){
|
||||
return switch(aimControl){
|
||||
case target -> posTarget;
|
||||
case targetp -> mainTarget;
|
||||
|
||||
@@ -14,7 +14,7 @@ public class MinerAI extends AIController{
|
||||
Tile ore;
|
||||
|
||||
@Override
|
||||
protected void updateMovement(){
|
||||
public void updateMovement(){
|
||||
Building core = unit.closestCore();
|
||||
|
||||
if(!(unit.canMine()) || core == null) return;
|
||||
|
||||
@@ -13,7 +13,7 @@ public class RepairAI extends AIController{
|
||||
float retreatTimer;
|
||||
|
||||
@Override
|
||||
protected void updateMovement(){
|
||||
public void updateMovement(){
|
||||
if(target instanceof Building){
|
||||
boolean shoot = false;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RepairAI extends AIController{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateTargeting(){
|
||||
public void updateTargeting(){
|
||||
Building target = Units.findDamagedTile(unit.team, unit.x, unit.y);
|
||||
|
||||
if(target instanceof ConstructBuild) target = null;
|
||||
|
||||
@@ -111,7 +111,7 @@ public class SuicideAI extends GroundAI{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Teamc target(float x, float y, float range, boolean air, boolean ground){
|
||||
public Teamc target(float x, float y, float range, boolean air, boolean ground){
|
||||
return Units.closestTarget(unit.team, x, y, range, u -> u.checkTarget(air, ground), t -> ground &&
|
||||
!(t.block instanceof Conveyor || t.block instanceof Conduit)); //do not target conveyors/conduits
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user