|
LazyLib | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectWeaponUtils
public class WeaponUtils
Contains methods that deal with weapons and weapon arcs.
Method Summary | |
---|---|
static void |
aimTowardsPoint(WeaponAPI weapon,
Vector2f point,
float time)
Manually adjusts a weapon's aim towards a point. |
static float |
calculateActualDamage(float baseDamage,
WeaponAPI weapon)
Calculates the damage done by a weapon after MutableShipStats are applied. |
static float |
calculateActualDamage(float baseDamage,
WeaponAPI weapon,
ShipAPI target,
DefenseType defense)
Calculates the damage done by a weapon to a ship after all MutableShipStats on both sides are applied. |
static float |
calculateDamagePerBurst(WeaponAPI weapon)
Calculates the damage done per burst by a weapon after MutableShipStats are applied. |
static float |
calculateDamagePerBurst(WeaponAPI weapon,
ShipAPI target,
DefenseType defense)
Calculates the damage done per burst by a weapon to a ship after all MutableShipStats on both sides are applied. |
static float |
calculateDamagePerSecond(WeaponAPI weapon)
Calculates the damage done per second by a weapon after MutableShipStats are applied. |
static float |
calculateDamagePerSecond(WeaponAPI weapon,
ShipAPI target,
DefenseType defense)
Calculates the damage done per second by a weapon to a ship after all MutableShipStats on both sides are applied. |
static float |
calculateDamagePerShot(WeaponAPI weapon)
Calculates the damage done per shot by a weapon after MutableShipStats are applied. |
static float |
calculateDamagePerShot(WeaponAPI weapon,
ShipAPI target,
DefenseType defense)
Calculates the damage done per shot by a weapon to a ship after all MutableShipStats on both sides are applied. |
static List<ShipAPI> |
getEnemiesInArc(WeaponAPI weapon)
Finds all enemy ships within range of a WeaponAPI . |
static List<ShipAPI> |
getEnemiesInArc(WeaponAPI weapon,
boolean sortByDistance)
Finds all enemy ships within range of a WeaponAPI . |
static List<MissileAPI> |
getEnemyMissilesInArc(WeaponAPI weapon)
Finds all enemy missiles within range of a WeaponAPI . |
static List<MissileAPI> |
getEnemyMissilesInArc(WeaponAPI weapon,
boolean sortByDistance)
Finds all enemy missiles within range of a WeaponAPI . |
static ShipAPI |
getNearestEnemyInArc(WeaponAPI weapon)
Find the closest enemy in range of a WeaponAPI . |
static MissileAPI |
getNearestEnemyMissileInArc(WeaponAPI weapon)
Find the closest enemy missile in range of a WeaponAPI . |
static float |
getTimeToAim(WeaponAPI weapon,
Vector2f aimAt)
Calculate how long it would take to turn a WeaponAPI to aim at a location. |
static boolean |
isWithinArc(CombatEntityAPI entity,
WeaponAPI weapon)
Checks if a CombatEntityAPI is within the arc and range of a WeaponAPI . |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static float calculateActualDamage(float baseDamage, 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 calculateActualDamage(float baseDamage, WeaponAPI weapon, ShipAPI target, DefenseType defense)
baseDamage
- The base damage of this weapon.weapon
- The WeaponAPI
to check for bonuses on.target
- The ship weapon
is aiming at.defense
- The defense of target
aimed at (used for calculating
penalties).
weapon
after all bonuses and penalties
are applied.public static float calculateDamagePerShot(WeaponAPI weapon)
weapon
- The weapon to check.
weapon
per shot, after bonuses.public static float calculateDamagePerShot(WeaponAPI weapon, ShipAPI target, DefenseType defense)
weapon
- The weapon to check.target
- The ship weapon
is aiming at.defense
- The defense of target
aimed at (used for calculating
penalties).
weapon
per shot after all bonuses
and penalties are applied.public static float calculateDamagePerSecond(WeaponAPI weapon)
weapon
- The weapon to check.
weapon
per second, after bonuses.public static float calculateDamagePerSecond(WeaponAPI weapon, ShipAPI target, DefenseType defense)
weapon
- The weapon to check.target
- The ship weapon
is aiming at.defense
- The defense of target
aimed at (used for calculating
penalties).
weapon
per second after all bonuses
and penalties are applied.public static float calculateDamagePerBurst(WeaponAPI weapon)
weapon
- The weapon to check.
weapon
per burst, after bonuses.public static float calculateDamagePerBurst(WeaponAPI weapon, ShipAPI target, DefenseType defense)
weapon
- The weapon to check.target
- The ship weapon
is aiming at.defense
- The defense of target
aimed at (used for calculating
penalties).
weapon
per burst after all bonuses
and penalties are applied.public static boolean isWithinArc(CombatEntityAPI entity, 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(WeaponAPI weapon, Vector2f aimAt)
WeaponAPI
to aim at a location.
weapon
- The WeaponAPI
to turn.aimAt
- The Vector2f
to aim at.
weapon
.public static ShipAPI getNearestEnemyInArc(WeaponAPI weapon)
WeaponAPI
.
weapon
- The WeaponAPI
to search around.
ShipAPI
closest to weapon
, or null
if none are in range.public static List<ShipAPI> getEnemiesInArc(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 List<ShipAPI> getEnemiesInArc(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 MissileAPI getNearestEnemyMissileInArc(WeaponAPI weapon)
WeaponAPI
.
weapon
- The WeaponAPI
to search around.
MissileAPI
closest to weapon
, or null
if none are in range.public static List<MissileAPI> getEnemyMissilesInArc(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 List<MissileAPI> getEnemyMissilesInArc(WeaponAPI weapon)
WeaponAPI
.
weapon
- The weapon to detect enemies in range of.
List
containing all enemy missiles within range.getEnemyMissilesInArc(com.fs.starfarer.api.combat.WeaponAPI, boolean)
public static void aimTowardsPoint(WeaponAPI weapon, 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 |