Class SlipstreamEntityPlugin

java.lang.Object
com.fs.starfarer.api.impl.campaign.BaseCustomEntityPlugin
com.fs.starfarer.api.impl.campaign.velfield.SlipstreamEntityPlugin
All Implemented Interfaces:
CustomCampaignEntityPlugin

public class SlipstreamEntityPlugin extends BaseCustomEntityPlugin
  • Field Details

    • MAX_PARTICLES_ADD_PER_FRAME

      public static float MAX_PARTICLES_ADD_PER_FRAME
    • RAD_PER_DEG

      public static float RAD_PER_DEG
    • params

    • texelsPerPixel

      protected float texelsPerPixel
    • particles

      protected transient List<SlipstreamEntityPlugin.SlipstreamParticle> particles
    • texProgress1

      protected float texProgress1
    • texProgress2

      protected float texProgress2
    • texProgress3

      protected float texProgress3
    • fader

      protected FaderUtil fader
    • playerWasInSlipstream

      protected boolean playerWasInSlipstream
  • Constructor Details

    • SlipstreamEntityPlugin

      public SlipstreamEntityPlugin()
  • Method Details

    • rotateAroundOrigin

      public static org.lwjgl.util.vector.Vector2f rotateAroundOrigin(org.lwjgl.util.vector.Vector2f v, float cos, float sin)
    • init

      public void init(SectorEntityToken entity, Object pluginParams)
      Specified by:
      init in interface CustomCampaignEntityPlugin
      Overrides:
      init in class BaseCustomEntityPlugin
    • getRenderRange

      public float getRenderRange()
      Description copied from interface: CustomCampaignEntityPlugin
      How far away from the viewport the center of this entity can be before it stops being rendered. Should at least be the radius of the entity; sometimes more may be necessary depending on the visual effect desired.
      Specified by:
      getRenderRange in interface CustomCampaignEntityPlugin
      Overrides:
      getRenderRange in class BaseCustomEntityPlugin
      Returns:
    • advance

      public void advance(float amount)
      Specified by:
      advance in interface CustomCampaignEntityPlugin
      Overrides:
      advance in class BaseCustomEntityPlugin
      Parameters:
      amount - in seconds. Use SectorAPI.getClock() to figure out how many campaign days that is.
    • render

      public void render(CampaignEngineLayers layer, ViewportAPI viewport)
      Description copied from interface: CustomCampaignEntityPlugin
      Should only render for specified layer. Will be called once per each layer, per frame. Needs to respect viewport.getAlphaMult() - i.e. use that alpha value for rendering. Needs to render at the entity's location - there's no translation before this method call. If a sprite is specified, it will be rendered in the bottommost layer of the layers this entity renders for. This method will be called after the sprite has rendered.
      Specified by:
      render in interface CustomCampaignEntityPlugin
      Overrides:
      render in class BaseCustomEntityPlugin
    • renderLayer

      public void renderLayer(SpriteAPI sprite, float texProgress, float alpha)
    • getRandomColor

      public Color getRandomColor()
    • getLengthAndWidthFractionWithinStream

      public float[] getLengthAndWidthFractionWithinStream(org.lwjgl.util.vector.Vector2f loc)
      result[0] = along the length of the field, 0 = at start, 1 = at tail result[1] = along the width of the field, 0 = on center, 1 = on edge, no directional information null if outside stream Assumes rectangular, non-tapered stream
      Parameters:
      loc -
      Returns:
    • applyEffectToFleets

      public void applyEffectToFleets(float amount)
    • applyEffect

      public void applyEffect(SectorEntityToken other, float days)