public class AIUtils extends Object
CombatUtils
.Modifier and Type | Method and Description |
---|---|
static boolean |
canUseSystemThisFrame(ShipAPI ship)
Check if a ship's system can be used/toggled this frame.
|
static List<ShipAPI> |
getAlliesOnMap(CombatEntityAPI entity)
Find all present allies of an entity.
|
static @Nullable Vector2f |
getBestInterceptPoint(Vector2f point,
float speed,
Vector2f targetLoc,
Vector2f targetVel)
Returns the best place to aim to hit a target, given its current location
and velocity.
|
static List<ShipAPI> |
getEnemiesOnMap(CombatEntityAPI entity)
Find all present and visible enemies of an entity.
|
static List<MissileAPI> |
getEnemyMissilesOnMap(CombatEntityAPI entity)
Find all present visible enemy missiles of an entity.
|
static List<ShipAPI> |
getNearbyAllies(CombatEntityAPI entity,
float range)
Finds all allies within a certain range around an entity.
|
static List<ShipAPI> |
getNearbyEnemies(CombatEntityAPI entity,
float range)
Finds all visible enemies within a certain range around an entity.
|
static List<MissileAPI> |
getNearbyEnemyMissiles(CombatEntityAPI entity,
float range)
Finds all visible enemy missiles within a certain range around an entity.
|
static @Nullable ShipAPI |
getNearestAlly(CombatEntityAPI entity)
Find the closest ally of an entity.
|
static @Nullable ShipAPI |
getNearestEnemy(CombatEntityAPI entity)
Find the closest visible enemy of an entity.
|
static @Nullable MissileAPI |
getNearestEnemyMissile(CombatEntityAPI entity)
Find the closest visible enemy missile near an entity.
|
static @Nullable MissileAPI |
getNearestMissile(CombatEntityAPI entity)
Find the closest visible missile near entity.
|
static @Nullable BattleObjectiveAPI |
getNearestObjective(CombatEntityAPI entity)
Find the closest
BattleObjectiveAPI to an entity. |
static @Nullable ShipAPI |
getNearestShip(CombatEntityAPI entity)
Find the closest visible ship near an entity.
|
@Nullable public static @Nullable BattleObjectiveAPI getNearestObjective(CombatEntityAPI entity)
BattleObjectiveAPI
to an entity.entity
- The CombatEntityAPI
to search around.BattleObjectiveAPI
closest to entity
, or null
if none are found.@Nullable public static @Nullable ShipAPI getNearestEnemy(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.entity
who can be seen within the
fog of war, or null
if none are found.@Nullable public static @Nullable ShipAPI getNearestAlly(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.entity
, or null
if none are found.@Nullable public static @Nullable ShipAPI getNearestShip(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.entity
that can be seen within the
fog of war, or null
if none are found.@Nullable public static @Nullable MissileAPI getNearestMissile(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.MissileAPI
closest to entity
that can be seen
within the fog of war, or null
if none are found.public static List<ShipAPI> getEnemiesOnMap(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.entity
on the battle map that can be seen
within the fog of war.public static List<ShipAPI> getNearbyEnemies(CombatEntityAPI entity, float range)
entity
- The entity to search around.range
- How far around entity
to search.List
containing all enemy ships within range that can
be seen within the fog of war.public static List<ShipAPI> getAlliesOnMap(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.entity
on the battle map.public static List<ShipAPI> getNearbyAllies(CombatEntityAPI entity, float range)
entity
- The entity to search around.range
- How far around entity
to search.List
containing all allied ships within range.@Nullable public static @Nullable MissileAPI getNearestEnemyMissile(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.MissileAPI
closest to entity
that can
be seen within the fog of war, or null
if none are found.public static List<MissileAPI> getEnemyMissilesOnMap(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.MissileAPI
s of entity
on the battle
map that can be seen within the fog of war.public static List<MissileAPI> getNearbyEnemyMissiles(CombatEntityAPI entity, float range)
entity
- The entity to search around.range
- How far around entity
to search.List
containing all enemy missiles within range that
can be seen within the fog of war.@Nullable public static @Nullable Vector2f getBestInterceptPoint(Vector2f point, float speed, Vector2f targetLoc, Vector2f targetVel)
point
- The origin point of the object that will attempt to
collide with the target (usually a weapon's projectile
spawn point).speed
- The speed of the object that will attempt to collide
with the target (usually a projectile's travel speed).targetLoc
- The location of the target.targetVel
- The current velocity of the target.target
given current
velocities, or null
if a collision is not possible.public static boolean canUseSystemThisFrame(ShipAPI ship)
ship
- The ship to check the system of.true
if ship
can use its system, false
otherwise.