JSON Unit type requirements cache fix / Better FlyingAI flag targeting

This commit is contained in:
Anuken
2026-01-16 17:31:18 -05:00
parent d6495dda32
commit 4f9ea8b70d
8 changed files with 105 additions and 29 deletions

View File

@@ -264,6 +264,11 @@ public class AIController implements UnitController{
return Geometry.findClosest(x, y, enemy ? indexer.getEnemy(unit.team, flag) : indexer.getFlagged(unit.team, flag));
}
public Teamc targetFlagActive(float x, float y, BlockFlag flag, boolean enemy){
if(unit.team == Team.derelict) return null;
return Geometry.findClosest(x, y, enemy ? indexer.getEnemy(unit.team, flag) : indexer.getFlagged(unit.team, flag), t -> ((t.items != null && t.items.any()) || t.status() != BlockStatus.noInput) && t.block.targetable);
}
public Teamc target(float x, float y, float range, boolean air, boolean ground){
return Units.closestTarget(unit.team, x, y, range, u -> u.checkTarget(air, ground), t -> ground && (unit.type.targetUnderBlocks || !t.block.underBullets));
}