From 3563c929af102ab036c7675909e66bfd0e033e74 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 21 Mar 2020 12:08:21 -0400 Subject: [PATCH] Cleanup --- core/src/mindustry/ai/types/GroundAI.java | 1 - core/src/mindustry/entities/units/AIController.java | 7 +------ core/src/mindustry/type/UnitType.java | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/core/src/mindustry/ai/types/GroundAI.java b/core/src/mindustry/ai/types/GroundAI.java index 7a9e97ae12..2e295bd68b 100644 --- a/core/src/mindustry/ai/types/GroundAI.java +++ b/core/src/mindustry/ai/types/GroundAI.java @@ -27,7 +27,6 @@ public class GroundAI extends AIController{ targetClosest(); } - //attack Tilec core = unit.closestEnemyCore(); if(core == null) return; diff --git a/core/src/mindustry/entities/units/AIController.java b/core/src/mindustry/entities/units/AIController.java index 1b2c6b8ccb..d5acecb965 100644 --- a/core/src/mindustry/entities/units/AIController.java +++ b/core/src/mindustry/entities/units/AIController.java @@ -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; } diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 7a41c1d4c0..f3c5dcf50b 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -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;