Package com.fs.starfarer.api.campaign
Interface SectorEntityToken
- All Superinterfaces:
HasMemory
- All Known Subinterfaces:
AsteroidAPI
,CampaignFleetAPI
,CampaignProgressIndicatorAPI
,CampaignTerrainAPI
,CustomCampaignEntityAPI
,JumpPointAPI
,NascentGravityWellAPI
,OrbitalStationAPI
,PlanetAPI
,RingBandAPI
- Author:
- Alex Mosolov Copyright 2012 Fractal Softworks, LLC
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAbility
(String id) void
void
addDropRandom
(String group, int chances) void
addDropRandom
(String group, int chances, int value) void
void
addDropValue
(String group, int value) void
addFloatingText
(String text, Color color, float duration) void
addFloatingText
(String text, Color color, float duration, boolean showWhenOnlySensorContact) void
addScript
(EveryFrameScript script) void
void
advance
(float amount) void
autoUpdateHyperLocationBasedOnInSystemEntityAtRadius
(SectorEntityToken entity, float radius) void
void
void
void
void
void
void
forceSensorContactFaderBrightness
(float b) void
forceSensorFaderBrightness
(float b) void
getAbility
(String id) float
getBaseSensorRangeToDetect
(float sensorProfile) getCargo()
For the player fleet, the actual cargo.float
float
float
Only returns non-null for custom campaign entities with a plugin.float
Applies to the 5000/2000 max sensor range limit in normal/hyper space.float
getId()
org.lwjgl.util.vector.Vector2f
org.lwjgl.util.vector.Vector2f
The location in hyperspace of the LocationAPI containing this entity, or this entity's location if it's already in hyperspace.float
Does not includes fleet radii - i.e.Will cause the relevant updateFacts() methods to run to update the entity's perception of the world.Get the memory without updating facts.getName()
getOrbit()
float
float
float
float
float
getTags()
org.lwjgl.util.vector.Vector2f
In pixels per second.boolean
hasAbility
(String id) boolean
boolean
boolean
boolean
boolean
boolean
boolean
isAlive()
Returns false if: 1) getContainingLocation() is null, or 2) getContainingLocation() doesn't contain this entityboolean
boolean
boolean
boolean
boolean
boolean
isInOrNearSystem
(StarSystemAPI system) True if in system or within commRelayRangeAroundSystem light-years.boolean
boolean
boolean
isStar()
boolean
boolean
boolean
boolean
void
removeAbility
(String id) void
removeScript
(EveryFrameScript script) void
void
void
setActivePerson
(PersonAPI activePerson) void
setAlwaysUseSensorFaderBrightness
(Boolean alwaysUseSensorFaderBrightness) Always use sensor fader brightness for rendering circular indicator around the entity.void
setAutogenJumpPointNameInHyper
(String autogenJumpPointNameInHyper) void
setCircularOrbit
(SectorEntityToken focus, float angle, float orbitRadius, float orbitDays) void
setCircularOrbitAngle
(float angle) void
setCircularOrbitPointingDown
(SectorEntityToken focus, float angle, float orbitRadius, float orbitDays) void
setCircularOrbitWithSpin
(SectorEntityToken focus, float angle, float orbitRadius, float orbitDays, float minSpin, float maxSpin) void
setContainingLocation
(LocationAPI location) void
setCustomDescriptionId
(String customDescriptionId) void
void
setDetectionRangeDetailsOverrideMult
(Float detectionRangeDetailsOverrideMult) void
setDiscoverable
(Boolean discoverable) void
setDiscoveryXP
(Float discoveryXP) void
setExpired
(boolean expired) void
setExtendedDetectedAtRange
(Float extendedDetectedAtRange) Applies to the 5000/2000 max sensor range limit in normal/hyper space.void
setFacing
(float facing) void
setFaction
(String factionId) void
setFixedLocation
(float x, float y) void
setFreeTransfer
(boolean freeTransfer) Whether moving ships and items to and from this entity has a cost.void
void
setInteractionImage
(String category, String key) void
setLightSource
(SectorEntityToken star, Color color) void
setLocation
(float x, float y) void
void
void
void
void
setOrbitFocus
(SectorEntityToken focus) void
setSalvageXP
(Float salvageXP) void
setSensorProfile
(Float sensorProfile) void
setSensorStrength
(Float sensorStrength) void
setSkipForJumpPointAutoGen
(boolean skipForJumpPointAutoGen) void
setTransponderOn
(boolean transponderOn)
-
Method Details
-
isPlayerFleet
boolean isPlayerFleet() -
getMarket
MarketAPI getMarket() -
setMarket
-
getCargo
CargoAPI getCargo()For the player fleet, the actual cargo. For AI fleets, only non-logistics-related stuff - i.e. goods being carried, etc. NOT supplies/fuel/crew/etc.- Returns:
-
getLocation
org.lwjgl.util.vector.Vector2f getLocation() -
getLocationInHyperspace
org.lwjgl.util.vector.Vector2f getLocationInHyperspace()The location in hyperspace of the LocationAPI containing this entity, or this entity's location if it's already in hyperspace.- Returns:
-
getOrbit
OrbitAPI getOrbit() -
setOrbit
-
getId
String getId() -
getName
String getName() -
getFullName
String getFullName() -
setFaction
-
getContainingLocation
LocationAPI getContainingLocation() -
getRadius
float getRadius() -
getFaction
FactionAPI getFaction() -
getCustomDescriptionId
String getCustomDescriptionId() -
setCustomDescriptionId
-
setCustomInteractionDialogImageVisual
-
getCustomInteractionDialogImageVisual
InteractionDialogImageVisual getCustomInteractionDialogImageVisual() -
setFreeTransfer
void setFreeTransfer(boolean freeTransfer) Whether moving ships and items to and from this entity has a cost.- Parameters:
freeTransfer
-
-
isFreeTransfer
boolean isFreeTransfer() -
hasTag
-
addTag
-
removeTag
-
getTags
Collection<String> getTags() -
clearTags
void clearTags() -
setFixedLocation
void setFixedLocation(float x, float y) -
setCircularOrbit
-
setCircularOrbitPointingDown
void setCircularOrbitPointingDown(SectorEntityToken focus, float angle, float orbitRadius, float orbitDays) -
setCircularOrbitWithSpin
void setCircularOrbitWithSpin(SectorEntityToken focus, float angle, float orbitRadius, float orbitDays, float minSpin, float maxSpin) -
getMemory
MemoryAPI getMemory()Will cause the relevant updateFacts() methods to run to update the entity's perception of the world. Return value should be stored and re-used rather than calling this method again, unless a fact update is needed. -
getMemoryWithoutUpdate
MemoryAPI getMemoryWithoutUpdate()Get the memory without updating facts.- Specified by:
getMemoryWithoutUpdate
in interfaceHasMemory
- Returns:
-
getFacing
float getFacing() -
setFacing
void setFacing(float facing) -
isInHyperspace
boolean isInHyperspace() -
addScript
-
removeScript
-
removeScriptsOfClass
-
isInOrNearSystem
True if in system or within commRelayRangeAroundSystem light-years.- Parameters:
system
-- Returns:
-
isInCurrentLocation
boolean isInCurrentLocation() -
getVelocity
org.lwjgl.util.vector.Vector2f getVelocity()In pixels per second.- Returns:
-
setInteractionImage
-
setName
-
isAlive
boolean isAlive()Returns false if: 1) getContainingLocation() is null, or 2) getContainingLocation() doesn't contain this entity- Returns:
-
getActivePerson
PersonAPI getActivePerson() -
setActivePerson
-
isVisibleToSensorsOf
-
isVisibleToPlayerFleet
boolean isVisibleToPlayerFleet() -
getVisibilityLevelToPlayerFleet
SectorEntityToken.VisibilityLevel getVisibilityLevelToPlayerFleet() -
getVisibilityLevelTo
-
addAbility
-
removeAbility
-
getAbility
-
hasAbility
-
getAbilities
Map<String,AbilityPlugin> getAbilities() -
isTransponderOn
boolean isTransponderOn() -
setTransponderOn
void setTransponderOn(boolean transponderOn) -
addFloatingText
-
getLightSource
SectorEntityToken getLightSource() -
getLightColor
Color getLightColor() -
setMemory
-
getCustomData
-
getIndicatorColor
Color getIndicatorColor() -
getCustomPlugin
CustomCampaignEntityPlugin getCustomPlugin()Only returns non-null for custom campaign entities with a plugin.- Returns:
-
getCircularOrbitRadius
float getCircularOrbitRadius() -
getCircularOrbitPeriod
float getCircularOrbitPeriod() -
getOrbitFocus
SectorEntityToken getOrbitFocus() -
setId
-
getAutogenJumpPointNameInHyper
String getAutogenJumpPointNameInHyper() -
setAutogenJumpPointNameInHyper
-
isSkipForJumpPointAutoGen
boolean isSkipForJumpPointAutoGen() -
setSkipForJumpPointAutoGen
void setSkipForJumpPointAutoGen(boolean skipForJumpPointAutoGen) -
getCircularOrbitAngle
float getCircularOrbitAngle() -
getCustomEntityType
String getCustomEntityType() -
getSensorStrength
float getSensorStrength() -
setSensorStrength
-
getSensorProfile
float getSensorProfile() -
setSensorProfile
-
getDetectedRangeMod
StatBonus getDetectedRangeMod() -
getSensorRangeMod
StatBonus getSensorRangeMod() -
getBaseSensorRangeToDetect
float getBaseSensorRangeToDetect(float sensorProfile) -
hasSensorStrength
boolean hasSensorStrength() -
hasSensorProfile
boolean hasSensorProfile() -
getMaxSensorRangeToDetect
Does not includes fleet radii - i.e. the returned range is from outer edge to outer edge.- Returns:
-
isDiscoverable
boolean isDiscoverable() -
setDiscoverable
-
getCustomEntitySpec
CustomEntitySpecAPI getCustomEntitySpec() -
getDropValue
List<SalvageEntityGenDataSpec.DropData> getDropValue() -
getDropRandom
List<SalvageEntityGenDataSpec.DropData> getDropRandom() -
addDropValue
-
addDropRandom
-
addDropRandom
-
isExpired
boolean isExpired() -
setExpired
void setExpired(boolean expired) -
getSensorFaderBrightness
float getSensorFaderBrightness() -
getSensorContactFaderBrightness
float getSensorContactFaderBrightness() -
forceSensorFaderBrightness
void forceSensorFaderBrightness(float b) -
getDiscoveryXP
Float getDiscoveryXP() -
setDiscoveryXP
-
hasDiscoveryXP
boolean hasDiscoveryXP() -
addDropValue
-
addDropRandom
-
setAlwaysUseSensorFaderBrightness
Always use sensor fader brightness for rendering circular indicator around the entity.- Parameters:
alwaysUseSensorFaderBrightness
-
-
getAlwaysUseSensorFaderBrightness
Boolean getAlwaysUseSensorFaderBrightness() -
advance
void advance(float amount) -
hasScriptOfClass
-
setContainingLocation
-
clearAbilities
void clearAbilities() -
getConstellation
Constellation getConstellation() -
isStar
boolean isStar() -
getSalvageXP
Float getSalvageXP() -
setSalvageXP
-
hasSalvageXP
boolean hasSalvageXP() -
setDetectionRangeDetailsOverrideMult
-
getDetectionRangeDetailsOverrideMult
Float getDetectionRangeDetailsOverrideMult() -
getVisibilityLevelOfPlayerFleet
SectorEntityToken.VisibilityLevel getVisibilityLevelOfPlayerFleet() -
setCircularOrbitAngle
void setCircularOrbitAngle(float angle) -
addFloatingText
-
isSystemCenter
boolean isSystemCenter() -
getStarSystem
StarSystemAPI getStarSystem() -
clearFloatingText
void clearFloatingText() -
setLocation
void setLocation(float x, float y) -
autoUpdateHyperLocationBasedOnInSystemEntityAtRadius
-
forceSensorContactFaderBrightness
void forceSensorContactFaderBrightness(float b) -
forceSensorFaderOut
void forceSensorFaderOut() -
setLightSource
-
getScripts
List<EveryFrameScript> getScripts() -
getExtendedDetectedAtRange
float getExtendedDetectedAtRange()Applies to the 5000/2000 max sensor range limit in normal/hyper space. Does not, by itself, increase the range at which the entity is detected, just applies to the limit.- Returns:
-
setExtendedDetectedAtRange
Applies to the 5000/2000 max sensor range limit in normal/hyper space. Does not, by itself, increase the range at which the entity is detected, just applies to the limit. -
fadeOutIndicator
void fadeOutIndicator() -
fadeInIndicator
void fadeInIndicator() -
forceOutIndicator
void forceOutIndicator() -
setOrbitFocus
-