Class BaseSensorGhost

java.lang.Object
com.fs.starfarer.api.impl.campaign.ghosts.BaseSensorGhost
All Implemented Interfaces:
EveryFrameScript, SensorGhost
Direct Known Subclasses:
AbyssalDrifterGhost, ChargerGhost, EchoGhost, EncounterTricksterGhost, GuideGhost, LeviathanCalfGhost, LeviathanGhost, MinnowGhost, NoGhost, RacerGhost, RemnantGhost, RemoraGhost, ShipGhost, StormcallerGhost, StormTricksterGhost, TestGhost, ZigguratGhost

public class BaseSensorGhost extends Object implements SensorGhost
  • Field Details

    • entity

      protected CustomCampaignEntityAPI entity
    • despawnRange

      protected float despawnRange
    • despawnOutsideSector

      protected boolean despawnOutsideSector
    • despawnInAbyss

      protected boolean despawnInAbyss
    • fleeing

      protected boolean fleeing
    • fleeBurnLevel

      protected int fleeBurnLevel
    • accelMult

      protected float accelMult
    • creationFailed

      protected transient boolean creationFailed
    • movement

      protected SmoothMovementUtil movement
    • script

      protected List<GhostBehavior> script
    • manager

      protected SensorGhostManager manager
  • Constructor Details

    • BaseSensorGhost

      public BaseSensorGhost(SensorGhostManager manager, int fleeBurnLevel)
  • Method Details

    • readResolve

      protected Object readResolve()
    • addBehavior

      public void addBehavior(GhostBehavior b)
      Specified by:
      addBehavior in interface SensorGhost
    • addInterrupt

      public void addInterrupt(GhostBehaviorInterrupt interrupt)
    • getDespawnRange

      public float getDespawnRange()
      Specified by:
      getDespawnRange in interface SensorGhost
    • setDespawnRange

      public void setDespawnRange(float despawnRange)
      Specified by:
      setDespawnRange in interface SensorGhost
    • getRandom

      public Random getRandom()
    • genSmallSensorProfile

      public float genSmallSensorProfile()
    • genMediumSensorProfile

      public float genMediumSensorProfile()
    • genLargeSensorProfile

      public float genLargeSensorProfile()
    • genHugeSensorProfile

      public float genHugeSensorProfile()
    • genTinyRadius

      public float genTinyRadius()
    • genVerySmallRadius

      public float genVerySmallRadius()
    • genSmallRadius

      public float genSmallRadius()
    • genMediumRadius

      public float genMediumRadius()
    • genLargeRadius

      public float genLargeRadius()
    • genFloat

      public float genFloat(float min, float max)
    • genInt

      public float genInt(int min, int max)
    • genDelay

      public float genDelay(float base)
    • placeNearPlayer

      public boolean placeNearPlayer()
    • placeNearPlayer

      public boolean placeNearPlayer(float minDist, float maxDist)
    • placeNearEntity

      public void placeNearEntity(SectorEntityToken entity, float minDist, float maxDist)
    • setLoc

      public void setLoc(org.lwjgl.util.vector.Vector2f loc)
    • setVel

      public void setVel(org.lwjgl.util.vector.Vector2f vel)
    • initEntity

      public void initEntity(float sensorProfile, float radius)
    • initEntity

      public void initEntity(float sensorProfile, float radius, int extraSensorInds)
    • initEntity

      public void initEntity(float sensorProfile, float radius, int extraSensorInds, LocationAPI where)
    • setNumSensorIndicators

      public void setNumSensorIndicators(int min, int max, Random random)
    • reportDespawning

      protected void reportDespawning(BaseSensorGhost.DespawnReason reason, Object param)
    • advance

      public void advance(float amount)
      Description copied from interface: EveryFrameScript
      Use SectorAPI.getClock() to convert to campaign days.
      Specified by:
      advance in interface EveryFrameScript
      Parameters:
      amount - seconds elapsed during the last frame.
    • getAccelMult

      public float getAccelMult()
    • setAccelMult

      public void setAccelMult(float accelMult)
    • moveTo

      public void moveTo(org.lwjgl.util.vector.Vector2f dest, float maxBurn)
      Specified by:
      moveTo in interface SensorGhost
    • moveTo

      public void moveTo(org.lwjgl.util.vector.Vector2f dest, org.lwjgl.util.vector.Vector2f destVel, float maxBurn)
      Specified by:
      moveTo in interface SensorGhost
    • getMaxBurn

      public int getMaxBurn()
      Specified by:
      getMaxBurn in interface SensorGhost
    • getCurrBurn

      public int getCurrBurn()
      Specified by:
      getCurrBurn in interface SensorGhost
    • getAcceleration

      public float getAcceleration()
      Specified by:
      getAcceleration in interface SensorGhost
    • getMovement

      public SmoothMovementUtil getMovement()
      Specified by:
      getMovement in interface SensorGhost
    • getEntity

      public CustomCampaignEntityAPI getEntity()
      Specified by:
      getEntity in interface SensorGhost
    • isDone

      public boolean isDone()
      Specified by:
      isDone in interface EveryFrameScript
      Returns:
      true when the script is finished and can be cleaned up by the engine.
    • runWhilePaused

      public boolean runWhilePaused()
      Specified by:
      runWhilePaused in interface EveryFrameScript
      Returns:
      whether advance() should be called while the campaign engine is paused.
    • isDespawnOutsideSector

      public boolean isDespawnOutsideSector()
    • setDespawnOutsideSector

      public void setDespawnOutsideSector(boolean despawnOutsideSector)
    • isDespawnInAbyss

      public boolean isDespawnInAbyss()
      Specified by:
      isDespawnInAbyss in interface SensorGhost
    • setDespawnInAbyss

      public void setDespawnInAbyss(boolean despawnInAbyss)
      Specified by:
      setDespawnInAbyss in interface SensorGhost
    • isCreationFailed

      public boolean isCreationFailed()
      Specified by:
      isCreationFailed in interface SensorGhost
    • setCreationFailed

      public void setCreationFailed()
    • getScript

      public List<GhostBehavior> getScript()
      Specified by:
      getScript in interface SensorGhost
    • clearScript

      public void clearScript()
      Specified by:
      clearScript in interface SensorGhost