Turrets target blocks / Added core no-build radius
This commit is contained in:
@@ -53,6 +53,9 @@ public class Predict{
|
||||
* See {@link #intercept(float, float, float, float, float, float, float)}.
|
||||
*/
|
||||
public static Vector2 intercept(TargetTrait src, TargetTrait dst, float v){
|
||||
if(vec.set(dst.getVelocity().sub(src.getVelocity())).isZero()){
|
||||
return vresult.set(dst.getX(), dst.getY());
|
||||
}
|
||||
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), dst.getVelocity().x - src.getVelocity().x, dst.getVelocity().x - src.getVelocity().y, v);
|
||||
}
|
||||
|
||||
|
||||
@@ -147,11 +147,14 @@ public class Units{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the closest target enemy. First, units are checked, then tile entities.
|
||||
*/
|
||||
/**Returns the closest target enemy. First, units are checked, then tile entities.*/
|
||||
public static TargetTrait getClosestTarget(Team team, float x, float y, float range){
|
||||
Unit unit = getClosestEnemy(team, x, y, range, u -> true);
|
||||
return getClosestTarget(team, x, y, range, u -> true);
|
||||
}
|
||||
|
||||
/**Returns the closest target enemy. First, units are checked, then tile entities.*/
|
||||
public static TargetTrait getClosestTarget(Team team, float x, float y, float range, Predicate<Unit> unitPred){
|
||||
Unit unit = getClosestEnemy(team, x, y, range, unitPred);
|
||||
if(unit != null){
|
||||
return unit;
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user