Interface DamagingProjectileAPI

All Superinterfaces:
CombatEntityAPI
All Known Subinterfaces:
MissileAPI

public interface DamagingProjectileAPI extends CombatEntityAPI
  • 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

      void setSource(ShipAPI source)
    • 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

      void removeDamagedAlready(CombatEntityAPI c)
      Only supported by damaging explosions, not @Override other types of projectiles.
      Parameters:
      c -
    • addDamagedAlready

      void addDamagedAlready(CombatEntityAPI c)
      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

      default DamagingExplosionSpec getExplosionSpecIfExplosion()