-
- All Implemented Interfaces:
public final class AGCUtilsKt
-
-
Field Summary
Fields Modifier and Type Field Description public final static FloatdegToRadpublic final static FloatbignessFrigatepublic final static FloatbignessDestroyerpublic final static FloatbignessCruiserpublic final static FloatbignessCapitalpublic final static FloatbignessFighter
-
Method Summary
Modifier and Type Method Description final static BooleanhasPhaseCloak(ShipAPI $self)final static FloatgetMaxSpreadForNextBurst(WeaponAPI $self)final static Vector2fnormaliseNoThrow(Vector2f $self)final static FloatcomputeWeaponConeExposureRad(Vector2f weaponLoc, Vector2f aimPoint, Float spreadDeg, Vector2f targetLoc, Float collRadius)compute angular width of given entity that lies within given cone final static FloatcomputeWeaponConeExposureRadWithEclipsingEntity(Vector2f weaponLoc, Vector2f aimPoint, Float spreadDeg, Vector2f entityLoc, Float collRadius, Vector2f eclipsingLoc, Float eclipsingRadius)final static FloatcomputeWeaponConeExposureForAllies(Vector2f weaponLoc, Vector2f aimPoint, Float spreadDeg, List<PositionWithRadius> alliedObjects, List<PositionWithRadius> otherObjects)final static Floattimes(Vector2f $self, Vector2f other)final static BooleanisPD(WeaponAPI weapon)final static BooleanisAimable(WeaponAPI weapon)final static BooleanisInvalid(AutofireAIPlugin aiPlugin)final static FloatammoLevel(WeaponAPI weapon)final static BooleanisBig(ShipAPI ship)final static BooleanisSmall(ShipAPI ship)final static Floatbigness(ShipAPI ship)final static BooleanisHostile(CombatEntityAPI entity)final static Vector2fgetNeutralPosition(WeaponAPI weapon)final static BooleanisOpportuneTarget(FiringSolution solution, WeaponAPI weapon)final static FloatcomputeShieldFactor(CombatEntityAPI tgtShip, WeaponAPI weapon, Float ttt)final static FloatcomputeFluxBasedShieldFactor(CombatEntityAPI tgtShip)final static FloatcomputeShieldFacingFactor(CombatEntityAPI tgtShip, WeaponAPI weapon, Float ttt)final static FloatcomputeTimeToTravel(WeaponAPI weapon, Vector2f tgt, Float leadingFactor)final static FloatcomputeRemainingChargeUpTime(WeaponAPI weapon)final static FloatgetAverageArmor(ArmorGridAPI armor)final static FloatcomputeEffectiveCellRadius(ShipAPI ship, Float impactAngleDeg)effective ship radius measured in armor grid cells final static FloatcomputeInnerCellRatio(ShipAPI ship, Float impactAngleDeg)ratio of inner (i.e. final static FloatcomputeOuterLayerArmorInImpactArea(WeaponAPI weapon, CombatEntityAPI ship, Vector2f predictedLocation)final static FloatcomputeWeaponEffectivenessVsArmor(WeaponAPI weapon, Float armor)final static FloatgetMaxArmor(ArmorGridAPI armor)final static Vector2fpredictImpactLocationInTgtCoordinates(CombatEntityAPI target, WeaponAPI firingWeapon, Vector2f predictedLocation)returns the location where the shot is predicted to impact, transformed to be relative to the current target position, under the assumption that the target is approximately circular final static FloatpredictEffectiveArmorAtImpact(CombatEntityAPI target, WeaponAPI firingWeapon, Vector2f predictedLocation)final static FloatcomputeEffectiveArmorAroundIndex(ArmorGridAPI armor, Integer x, Integer y)final static BooleanisValidPDTargetForWeapon(CombatEntityAPI target, WeaponAPI weapon)final static Vector2fvectorFromAngleDeg(Float angle)final static FloatdegFromVector(Vector2f vec)final static StringmapBooleanToSpecificString(Boolean boolValue, String trueString, String falseString)final static ShipAPIdetermineUniversalShipTarget(ShipAPI $self)final static FloatsizeAsFloat(WeaponAPI $self)final static FloatangularDistanceFromWeapon(Vector2f entity, WeaponAPI weapon)final static FloatangularDistanceFromLine(Vector2f entity, Vector2f lineOrigin, Vector2f lineDirection)final static FloatlinearDistanceFromWeapon(Vector2f entity, WeaponAPI weapon)final static BooleandetermineIfShotWillHit(Vector2f predictedEntityPosition, Float collRadius, WeaponAPI weapon, Vector2f aimPoint)final static BooleandetermineIfShotWillHit(CombatEntityAPI entity, Vector2f predictedEntityPosition, Float fallbackCollRadius, WeaponAPI weapon, Vector2f aimPoint)this function is very similar to the other overload of determineIfShotWillHit, but uses exact bounds rather than a collision radius Will fall back to previously mentioned overload if target has no bounds final static BooleandetermineIfShotWillHitBySetting(CombatEntityAPI entity, Vector2f predictedEntityPosition, Float collRadius, WeaponAPI weapon, Vector2f aimPoint, Boolean useBounds)final static FloateffectiveCollRadius(CombatEntityAPI entity)-
-
Method Detail
-
hasPhaseCloak
final static Boolean hasPhaseCloak(ShipAPI $self)
-
getMaxSpreadForNextBurst
final static Float getMaxSpreadForNextBurst(WeaponAPI $self)
-
normaliseNoThrow
final static Vector2f normaliseNoThrow(Vector2f $self)
-
computeWeaponConeExposureRad
final static Float computeWeaponConeExposureRad(Vector2f weaponLoc, Vector2f aimPoint, Float spreadDeg, Vector2f targetLoc, Float collRadius)
compute angular width of given entity that lies within given cone
-
computeWeaponConeExposureRadWithEclipsingEntity
final static Float computeWeaponConeExposureRadWithEclipsingEntity(Vector2f weaponLoc, Vector2f aimPoint, Float spreadDeg, Vector2f entityLoc, Float collRadius, Vector2f eclipsingLoc, Float eclipsingRadius)
-
computeWeaponConeExposureForAllies
final static Float computeWeaponConeExposureForAllies(Vector2f weaponLoc, Vector2f aimPoint, Float spreadDeg, List<PositionWithRadius> alliedObjects, List<PositionWithRadius> otherObjects)
-
getNeutralPosition
final static Vector2f getNeutralPosition(WeaponAPI weapon)
-
isOpportuneTarget
final static Boolean isOpportuneTarget(FiringSolution solution, WeaponAPI weapon)
-
computeShieldFactor
final static Float computeShieldFactor(CombatEntityAPI tgtShip, WeaponAPI weapon, Float ttt)
-
computeFluxBasedShieldFactor
final static Float computeFluxBasedShieldFactor(CombatEntityAPI tgtShip)
-
computeShieldFacingFactor
final static Float computeShieldFacingFactor(CombatEntityAPI tgtShip, WeaponAPI weapon, Float ttt)
-
computeTimeToTravel
final static Float computeTimeToTravel(WeaponAPI weapon, Vector2f tgt, Float leadingFactor)
-
computeRemainingChargeUpTime
final static Float computeRemainingChargeUpTime(WeaponAPI weapon)
-
getAverageArmor
final static Float getAverageArmor(ArmorGridAPI armor)
-
computeEffectiveCellRadius
final static Float computeEffectiveCellRadius(ShipAPI ship, Float impactAngleDeg)
effective ship radius measured in armor grid cells
-
computeInnerCellRatio
final static Float computeInnerCellRatio(ShipAPI ship, Float impactAngleDeg)
ratio of inner (i.e. unreachable) armor grid cells to total cells from given direction
-
computeOuterLayerArmorInImpactArea
final static Float computeOuterLayerArmorInImpactArea(WeaponAPI weapon, CombatEntityAPI ship, Vector2f predictedLocation)
-
computeWeaponEffectivenessVsArmor
final static Float computeWeaponEffectivenessVsArmor(WeaponAPI weapon, Float armor)
-
getMaxArmor
final static Float getMaxArmor(ArmorGridAPI armor)
-
predictImpactLocationInTgtCoordinates
final static Vector2f predictImpactLocationInTgtCoordinates(CombatEntityAPI target, WeaponAPI firingWeapon, Vector2f predictedLocation)
returns the location where the shot is predicted to impact, transformed to be relative to the current target position, under the assumption that the target is approximately circular
- Parameters:
predictedLocation- : location where the target will be at the time the shot is estimated to connect
-
predictEffectiveArmorAtImpact
final static Float predictEffectiveArmorAtImpact(CombatEntityAPI target, WeaponAPI firingWeapon, Vector2f predictedLocation)
-
computeEffectiveArmorAroundIndex
final static Float computeEffectiveArmorAroundIndex(ArmorGridAPI armor, Integer x, Integer y)
-
isValidPDTargetForWeapon
final static Boolean isValidPDTargetForWeapon(CombatEntityAPI target, WeaponAPI weapon)
-
vectorFromAngleDeg
final static Vector2f vectorFromAngleDeg(Float angle)
-
degFromVector
final static Float degFromVector(Vector2f vec)
-
mapBooleanToSpecificString
final static String mapBooleanToSpecificString(Boolean boolValue, String trueString, String falseString)
-
determineUniversalShipTarget
final static ShipAPI determineUniversalShipTarget(ShipAPI $self)
-
sizeAsFloat
final static Float sizeAsFloat(WeaponAPI $self)
-
angularDistanceFromWeapon
final static Float angularDistanceFromWeapon(Vector2f entity, WeaponAPI weapon)
- Parameters:
entity- : Relative coordinates (velocity-compensated)
-
angularDistanceFromLine
final static Float angularDistanceFromLine(Vector2f entity, Vector2f lineOrigin, Vector2f lineDirection)
- Parameters:
lineDirection- : normalized direction vector (use vectorFromAngleDeg)
-
linearDistanceFromWeapon
final static Float linearDistanceFromWeapon(Vector2f entity, WeaponAPI weapon)
-
determineIfShotWillHit
final static Boolean determineIfShotWillHit(Vector2f predictedEntityPosition, Float collRadius, WeaponAPI weapon, Vector2f aimPoint)
- Parameters:
predictedEntityPosition- In time-adjusted relative coordinates (i.e.collRadius- Include any tolerances in hereaimPoint- Point the weapon is aiming at, deduced from current weapon facing if not providedThe calculation is done by finding the minimum point of function f(x)=distSquared(aimPoint * x, entity).
-
determineIfShotWillHit
final static Boolean determineIfShotWillHit(CombatEntityAPI entity, Vector2f predictedEntityPosition, Float fallbackCollRadius, WeaponAPI weapon, Vector2f aimPoint)
this function is very similar to the other overload of determineIfShotWillHit, but uses exact bounds rather than a collision radius Will fall back to previously mentioned overload if target has no bounds
-
determineIfShotWillHitBySetting
final static Boolean determineIfShotWillHitBySetting(CombatEntityAPI entity, Vector2f predictedEntityPosition, Float collRadius, WeaponAPI weapon, Vector2f aimPoint, Boolean useBounds)
-
effectiveCollRadius
final static Float effectiveCollRadius(CombatEntityAPI entity)
-
-
-
-