|
LazyLib | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lazywizard.lazylib.combat.WeaponUtils
public class WeaponUtils
Contains methods that deal with weapons and weapon arcs.
Method Summary | |
---|---|
static void |
aimTowardsPoint(com.fs.starfarer.api.combat.WeaponAPI weapon,
org.lwjgl.util.vector.Vector2f point,
float time)
Manually adjusts a weapon's aim towards a point. |
static float |
calculateActualDamage(float baseDamage,
com.fs.starfarer.api.combat.WeaponAPI weapon)
Calculates the damage done by a weapon after MutableShipStats are applied. |
static float |
calculateDamagePerBurst(com.fs.starfarer.api.combat.WeaponAPI weapon)
Calculates the damage done per burst by a weapon after MutableShipStats are applied. |
static float |
calculateDamagePerSecond(com.fs.starfarer.api.combat.WeaponAPI weapon)
Calculates the damage done per second by a weapon after MutableShipStats are applied. |
static float |
calculateDamagePerShot(com.fs.starfarer.api.combat.WeaponAPI weapon)
Calculates the damage done per shot by a weapon after MutableShipStats are applied. |
static java.util.List<com.fs.starfarer.api.combat.ShipAPI> |
getEnemiesInArc(com.fs.starfarer.api.combat.WeaponAPI weapon)
Finds all enemy ships within range of a WeaponAPI . |
static java.util.List<com.fs.starfarer.api.combat.ShipAPI> |
getEnemiesInArc(com.fs.starfarer.api.combat.WeaponAPI weapon,
boolean sortByDistance)
Finds all enemy ships within range of a WeaponAPI . |
static java.util.List<com.fs.starfarer.api.combat.MissileAPI> |
getEnemyMissilesInArc(com.fs.starfarer.api.combat.WeaponAPI weapon)
Finds all enemy missiles within range of a WeaponAPI . |
static java.util.List<com.fs.starfarer.api.combat.MissileAPI> |
getEnemyMissilesInArc(com.fs.starfarer.api.combat.WeaponAPI weapon,
boolean sortByDistance)
Finds all enemy missiles within range of a WeaponAPI . |
static com.fs.starfarer.api.combat.ShipAPI |
getNearestEnemyInArc(com.fs.starfarer.api.combat.WeaponAPI weapon)
Find the closest enemy in range of a WeaponAPI . |
static com.fs.starfarer.api.combat.MissileAPI |
getNearestEnemyMissileInArc(com.fs.starfarer.api.combat.WeaponAPI weapon)
Find the closest enemy missile in range of a WeaponAPI . |
static float |
getTimeToAim(com.fs.starfarer.api.combat.WeaponAPI weapon,
org.lwjgl.util.vector.Vector2f aimAt)
Calculate how long it would take to turn a WeaponAPI to aim at a location. |
static boolean |
isWithinArc(com.fs.starfarer.api.combat.CombatEntityAPI entity,
com.fs.starfarer.api.combat.WeaponAPI weapon)
Checks if a CombatEntityAPI is within the arc and range of a WeaponAPI . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static float calculateActualDamage(float baseDamage, com.fs.starfarer.api.combat.WeaponAPI weapon)
baseDamage
- The base damage of this weapon.weapon
- The WeaponAPI
to check for bonuses on.
weapon
after bonuses are applied.public static float calculateDamagePerShot(com.fs.starfarer.api.combat.WeaponAPI weapon)
weapon
- The weapon to check.
weapon
per shot, after bonuses.public static float calculateDamagePerSecond(com.fs.starfarer.api.combat.WeaponAPI weapon)
weapon
- The weapon to check.
weapon
per second, after bonuses.public static float calculateDamagePerBurst(com.fs.starfarer.api.combat.WeaponAPI weapon)
weapon
- The weapon to check.
weapon
per burst, after bonuses.public static boolean isWithinArc(com.fs.starfarer.api.combat.CombatEntityAPI entity, com.fs.starfarer.api.combat.WeaponAPI weapon)
CombatEntityAPI
is within the arc and range of a WeaponAPI
.
entity
- The CombatEntityAPI
to check if weapon
is aimed at.weapon
- The WeaponAPI
to test against.
true
if in arc and in range, false
otherwise.public static float getTimeToAim(com.fs.starfarer.api.combat.WeaponAPI weapon, org.lwjgl.util.vector.Vector2f aimAt)
WeaponAPI
to aim at a location.
weapon
- The WeaponAPI
to turn.aimAt
- The Vector2f
to aim at.
weapon
.public static com.fs.starfarer.api.combat.ShipAPI getNearestEnemyInArc(com.fs.starfarer.api.combat.WeaponAPI weapon)
WeaponAPI
.
weapon
- The WeaponAPI
to search around.
ShipAPI
closest to weapon
, or null
if none are in range.public static java.util.List<com.fs.starfarer.api.combat.ShipAPI> getEnemiesInArc(com.fs.starfarer.api.combat.WeaponAPI weapon, boolean sortByDistance)
WeaponAPI
.
weapon
- The weapon to detect enemies in range of.sortByDistance
- Whether to sort the results by distance from weapon
.
List
containing all enemy ships within range.public static java.util.List<com.fs.starfarer.api.combat.ShipAPI> getEnemiesInArc(com.fs.starfarer.api.combat.WeaponAPI weapon)
WeaponAPI
.
weapon
- The weapon to detect enemies in range of.
List
containing all enemy ships within range.getEnemiesInArc(com.fs.starfarer.api.combat.WeaponAPI, boolean)
public static com.fs.starfarer.api.combat.MissileAPI getNearestEnemyMissileInArc(com.fs.starfarer.api.combat.WeaponAPI weapon)
WeaponAPI
.
weapon
- The WeaponAPI
to search around.
MissileAPI
closest to weapon
, or null
if none are in range.public static java.util.List<com.fs.starfarer.api.combat.MissileAPI> getEnemyMissilesInArc(com.fs.starfarer.api.combat.WeaponAPI weapon, boolean sortByDistance)
WeaponAPI
.
weapon
- The weapon to detect enemies in range of.sortByDistance
- Whether to sort the results by distance from weapon
.
List
containing all enemy missiles within range.public static java.util.List<com.fs.starfarer.api.combat.MissileAPI> getEnemyMissilesInArc(com.fs.starfarer.api.combat.WeaponAPI weapon)
WeaponAPI
.
weapon
- The weapon to detect enemies in range of.
List
containing all enemy missiles within range.WeaponUtils#getEnemyMissilesInRange(com.fs.starfarer.api.combat.WeaponAPI, boolean)
public static void aimTowardsPoint(com.fs.starfarer.api.combat.WeaponAPI weapon, org.lwjgl.util.vector.Vector2f point, float time)
weapon
- The weapon to aim.point
- The point this weapon should try to aim at.time
- How long since the last frame (for turn rate calculations).
|
LazyLib | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |