New flying unit targeting system

This commit is contained in:
Anuken
2021-07-24 21:10:39 -04:00
parent 373d004752
commit f77c32cbb2
5 changed files with 36 additions and 15 deletions

View File

@@ -79,7 +79,6 @@ public class AIController implements UnitController{
return Units.invalidateTarget(target, unit.team, unit.x, unit.y);
}
protected void pathfind(int pathTarget){
int costType = unit.pathType();
@@ -97,7 +96,7 @@ public class AIController implements UnitController{
boolean ret = retarget();
if(ret){
target = findTarget(unit.x, unit.y, unit.range(), unit.type.targetAir, unit.type.targetGround);
target = findMainTarget(unit.x, unit.y, unit.range(), unit.type.targetAir, unit.type.targetGround);
}
if(invalid(target)){
@@ -167,6 +166,10 @@ public class AIController implements UnitController{
return timer.get(timerTarget, target == null ? 40 : 90);
}
protected Teamc findMainTarget(float x, float y, float range, boolean air, boolean ground){
return findTarget(x, y, range, air, ground);
}
protected Teamc findTarget(float x, float y, float range, boolean air, boolean ground){
return target(x, y, range, air, ground);
}