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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected float
protected boolean
protected boolean
protected boolean
protected float
protected CustomCampaignEntityAPI
protected int
protected boolean
protected SensorGhostManager
protected SmoothMovementUtil
protected List<GhostBehavior>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addInterrupt
(GhostBehaviorInterrupt interrupt) void
advance
(float amount) Use SectorAPI.getClock() to convert to campaign days.void
float
genDelay
(float base) float
genFloat
(float min, float max) float
float
genInt
(int min, int max) float
float
float
float
float
float
float
float
float
float
int
float
int
void
initEntity
(float sensorProfile, float radius) void
initEntity
(float sensorProfile, float radius, int extraSensorInds) void
initEntity
(float sensorProfile, float radius, int extraSensorInds, LocationAPI where) boolean
boolean
boolean
boolean
isDone()
void
moveTo
(org.lwjgl.util.vector.Vector2f dest, float maxBurn) void
moveTo
(org.lwjgl.util.vector.Vector2f dest, org.lwjgl.util.vector.Vector2f destVel, float maxBurn) void
placeNearEntity
(SectorEntityToken entity, float minDist, float maxDist) boolean
boolean
placeNearPlayer
(float minDist, float maxDist) protected Object
protected void
reportDespawning
(BaseSensorGhost.DespawnReason reason, Object param) boolean
void
setAccelMult
(float accelMult) void
void
setDespawnInAbyss
(boolean despawnInAbyss) void
setDespawnOutsideSector
(boolean despawnOutsideSector) void
setDespawnRange
(float despawnRange) void
setLoc
(org.lwjgl.util.vector.Vector2f loc) void
setNumSensorIndicators
(int min, int max, Random random) void
setVel
(org.lwjgl.util.vector.Vector2f vel)
-
Field Details
-
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
-
script
-
manager
-
-
Constructor Details
-
BaseSensorGhost
-
-
Method Details
-
readResolve
-
addBehavior
- Specified by:
addBehavior
in interfaceSensorGhost
-
addInterrupt
-
getDespawnRange
public float getDespawnRange()- Specified by:
getDespawnRange
in interfaceSensorGhost
-
setDespawnRange
public void setDespawnRange(float despawnRange) - Specified by:
setDespawnRange
in interfaceSensorGhost
-
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
-
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
-
setNumSensorIndicators
-
reportDespawning
-
advance
public void advance(float amount) Description copied from interface:EveryFrameScript
Use SectorAPI.getClock() to convert to campaign days.- Specified by:
advance
in interfaceEveryFrameScript
- 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 interfaceSensorGhost
-
moveTo
public void moveTo(org.lwjgl.util.vector.Vector2f dest, org.lwjgl.util.vector.Vector2f destVel, float maxBurn) - Specified by:
moveTo
in interfaceSensorGhost
-
getMaxBurn
public int getMaxBurn()- Specified by:
getMaxBurn
in interfaceSensorGhost
-
getCurrBurn
public int getCurrBurn()- Specified by:
getCurrBurn
in interfaceSensorGhost
-
getAcceleration
public float getAcceleration()- Specified by:
getAcceleration
in interfaceSensorGhost
-
getMovement
- Specified by:
getMovement
in interfaceSensorGhost
-
getEntity
- Specified by:
getEntity
in interfaceSensorGhost
-
isDone
public boolean isDone()- Specified by:
isDone
in interfaceEveryFrameScript
- Returns:
- true when the script is finished and can be cleaned up by the engine.
-
runWhilePaused
public boolean runWhilePaused()- Specified by:
runWhilePaused
in interfaceEveryFrameScript
- 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 interfaceSensorGhost
-
setDespawnInAbyss
public void setDespawnInAbyss(boolean despawnInAbyss) - Specified by:
setDespawnInAbyss
in interfaceSensorGhost
-
isCreationFailed
public boolean isCreationFailed()- Specified by:
isCreationFailed
in interfaceSensorGhost
-
setCreationFailed
public void setCreationFailed() -
getScript
- Specified by:
getScript
in interfaceSensorGhost
-
clearScript
public void clearScript()- Specified by:
clearScript
in interfaceSensorGhost
-