mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-07 00:38:26 +07:00
Cleanup
This commit is contained in:
@ -27,7 +27,6 @@ public class GroundAI extends AIController{
|
|||||||
targetClosest();
|
targetClosest();
|
||||||
}
|
}
|
||||||
|
|
||||||
//attack
|
|
||||||
Tilec core = unit.closestEnemyCore();
|
Tilec core = unit.closestEnemyCore();
|
||||||
|
|
||||||
if(core == null) return;
|
if(core == null) return;
|
||||||
|
@ -17,11 +17,6 @@ public class AIController implements UnitController{
|
|||||||
protected Teamc target;
|
protected Teamc target;
|
||||||
protected Interval timer = new Interval(4);
|
protected Interval timer = new Interval(4);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void targetClosestAllyFlag(BlockFlag flag){
|
protected void targetClosestAllyFlag(BlockFlag flag){
|
||||||
Tile target = Geometry.findClosest(unit.x(), unit.y(), indexer.getAllied(unit.team(), flag));
|
Tile target = Geometry.findClosest(unit.x(), unit.y(), indexer.getAllied(unit.team(), flag));
|
||||||
if(target != null) this.target = target.entity;
|
if(target != null) this.target = target.entity;
|
||||||
@ -37,7 +32,7 @@ public class AIController implements UnitController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void targetClosest(){
|
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){
|
if(newTarget != null){
|
||||||
target = newTarget;
|
target = newTarget;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
public float speed = 1.1f, boostSpeed = 0.75f, rotateSpeed = 6f, baseRotateSpeed = 10f;
|
public float speed = 1.1f, boostSpeed = 0.75f, rotateSpeed = 6f, baseRotateSpeed = 10f;
|
||||||
public float drag = 0.3f, mass = 1f, accel = 0.9f;
|
public float drag = 0.3f, mass = 1f, accel = 0.9f;
|
||||||
public float health = 200f, range = -1;
|
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 boolean faceTarget = true, isCounted = true;
|
||||||
|
|
||||||
public int itemCapacity = 30;
|
public int itemCapacity = 30;
|
||||||
|
Reference in New Issue
Block a user