This commit is contained in:
Anuken
2024-02-04 19:09:36 -05:00
parent f0d37281d4
commit 602bb93f1e
2 changed files with 8 additions and 1 deletions

View File

@@ -2,6 +2,8 @@ package mindustry.ai.types;
import arc.math.*;
import arc.util.*;
import mindustry.*;
import mindustry.entities.*;
import mindustry.entities.units.*;
import mindustry.gen.*;
@@ -29,6 +31,11 @@ public class MissileAI extends AIController{
}
}
@Override
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 && (!t.block.underBullets || (shooter != null && t == Vars.world.buildWorld(shooter.aimX, shooter.aimY))));
}
@Override
public boolean retarget(){
//more frequent retarget due to high speed. TODO won't this lag?