This commit is contained in:
Anuken
2020-03-21 12:08:21 -04:00
parent d831fa7ba3
commit 3563c929af
3 changed files with 2 additions and 8 deletions

View File

@ -27,7 +27,6 @@ public class GroundAI extends AIController{
targetClosest();
}
//attack
Tilec core = unit.closestEnemyCore();
if(core == null) return;

View File

@ -17,11 +17,6 @@ public class AIController implements UnitController{
protected Teamc target;
protected Interval timer = new Interval(4);
@Override
public void update(){
}
protected void targetClosestAllyFlag(BlockFlag flag){
Tile target = Geometry.findClosest(unit.x(), unit.y(), indexer.getAllied(unit.team(), flag));
if(target != null) this.target = target.entity;
@ -37,7 +32,7 @@ public class AIController implements UnitController{
}
protected void targetClosest(){
Teamc newTarget = Units.closestTarget(unit.team(), unit.x(), unit.y(), Math.max(unit.range(), unit.type().range), u -> unit.type().targetAir || !u.isFlying());
Teamc newTarget = Units.closestTarget(unit.team(), unit.x(), unit.y(), Math.max(unit.range(), unit.type().range), u -> (unit.type().targetAir && u.isFlying()) || (unit.type().targetGround && !u.isFlying()));
if(newTarget != null){
target = newTarget;
}

View File

@ -31,7 +31,7 @@ public class UnitType extends UnlockableContent{
public float speed = 1.1f, boostSpeed = 0.75f, rotateSpeed = 6f, baseRotateSpeed = 10f;
public float drag = 0.3f, mass = 1f, accel = 0.9f;
public float health = 200f, range = -1;
public boolean targetAir = false, targetGround = false;
public boolean targetAir = true, targetGround = true;
public boolean faceTarget = true, isCounted = true;
public int itemCapacity = 30;