Wave balancing & AI tweaks

This commit is contained in:
Anuken
2020-10-12 14:33:22 -04:00
parent f10c5c1ca8
commit 876534bd26
5 changed files with 78 additions and 17 deletions

View File

@@ -21,6 +21,7 @@ public class AIController implements UnitController{
protected Unit unit;
protected Interval timer = new Interval(4);
protected AIController fallback;
/** main target that is being faced */
protected Teamc target;
@@ -34,11 +35,27 @@ public class AIController implements UnitController{
@Override
public void updateUnit(){
//use fallback AI when possible
if(useFallback() && (fallback != null || (fallback = fallback()) != null)){
if(fallback.unit != unit) fallback.unit(unit);
fallback.updateUnit();
return;
}
updateVisuals();
updateTargeting();
updateMovement();
}
@Nullable
protected AIController fallback(){
return null;
}
protected boolean useFallback(){
return false;
}
protected UnitCommand command(){
return unit.team.data().command;
}