Package com.fs.starfarer.api.combat
Interface DamagingProjectileAPI
- All Superinterfaces:
CombatEntityAPI
- All Known Subinterfaces:
MissileAPI
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Only supported by damaging explosions, not other types of projectiles.boolean
Whether the projectile already did its damage and is now fading out.float
Does not include damage reduction from projectile fading out or having done damagefloat
float
float
Time the projectile has been alive.float
default DamagingExplosionSpec
float
Generally a ShipAPI for the ship that ultimately fired this weapon.org.lwjgl.util.vector.Vector2f
org.lwjgl.util.vector.Vector2f
Only non-null for "moving ray" and "ballistic projectile" type projectiles, not missiles/plasma shots/etc.boolean
isFading()
boolean
void
Only supported by damaging explosions, not @Override other types of projectiles.void
setDamageAmount
(float damage) void
setFromMissile
(boolean fromMissile) Should be set to true for BALLISTIC, BALLISTIC_AS_BEAM, and PLASMA_SHOT projectiles spawned from a missile.void
Methods inherited from interface com.fs.starfarer.api.combat.CombatEntityAPI
getAI, getAngularVelocity, getCollisionClass, getCollisionRadius, getCustomData, getExactBounds, getFacing, getHitpoints, getHullLevel, getLocation, getMass, getMaxHitpoints, getOwner, getShield, getVelocity, isExpired, isPointInBounds, removeCustomData, setAngularVelocity, setCollisionClass, setCollisionRadius, setCustomData, setFacing, setHitpoints, setMass, setOwner, wasRemoved
-
Method Details
-
getDamageType
DamageType getDamageType() -
getDamageAmount
float getDamageAmount() -
getBaseDamageAmount
float getBaseDamageAmount()Does not include damage reduction from projectile fading out or having done damage- Returns:
-
getEmpAmount
float getEmpAmount() -
setDamageAmount
void setDamageAmount(float damage) -
getWeapon
WeaponAPI getWeapon()- Returns:
- Weapon that fired this projectile. Can be null (for example, if spawned without one via the API).
-
didDamage
boolean didDamage()Whether the projectile already did its damage and is now fading out.- Returns:
-
getDamageTarget
CombatEntityAPI getDamageTarget()- Returns:
- What the damage was dealt to, once didDamage() returns true. Can be null.
-
getProjectileSpecId
String getProjectileSpecId() -
getSource
ShipAPI getSource()Generally a ShipAPI for the ship that ultimately fired this weapon. Can be null. Projectiles can't hit their source, except for fizzled-out missiles.- Returns:
-
setSource
-
isFading
boolean isFading()- Returns:
- whether the projectile has started fading out due to exceeding its maximum range.
-
getSpawnType
ProjectileSpawnType getSpawnType() -
getElapsed
float getElapsed()Time the projectile has been alive.- Returns:
-
getDamage
DamageAPI getDamage() -
isFromMissile
boolean isFromMissile() -
setFromMissile
void setFromMissile(boolean fromMissile) Should be set to true for BALLISTIC, BALLISTIC_AS_BEAM, and PLASMA_SHOT projectiles spawned from a missile. Needed for incoming damage evaluation AI to function properly in these cases.- Parameters:
fromMissile
-
-
removeDamagedAlready
Only supported by damaging explosions, not @Override other types of projectiles.- Parameters:
c
-
-
addDamagedAlready
Only supported by damaging explosions, not other types of projectiles.- Parameters:
c
-
-
getMoveSpeed
float getMoveSpeed() -
getSpawnLocation
org.lwjgl.util.vector.Vector2f getSpawnLocation() -
getProjectileSpec
ProjectileSpecAPI getProjectileSpec() -
getBrightness
float getBrightness() -
getTailEnd
org.lwjgl.util.vector.Vector2f getTailEnd()Only non-null for "moving ray" and "ballistic projectile" type projectiles, not missiles/plasma shots/etc.- Returns:
-
getDamagedAlready
List<CombatEntityAPI> getDamagedAlready() -
getExplosionSpecIfExplosion
-