Package com.fs.starfarer.api.campaign
Interface CampaignFleetAPI
- All Superinterfaces:
FleetOrStubAPI
,HasMemory
,SectorEntityToken
- Author:
- Alex Mosolov Copyright 2012 Fractal Softworks, LLC
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.fs.starfarer.api.campaign.SectorEntityToken
SectorEntityToken.VisibilityLevel
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAssignment
(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays) void
addAssignment
(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, Script onCompletion) void
addAssignment
(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, String actionText) void
addAssignment
(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, String actionText, boolean addTimeToNext, Script onStart, Script onCompletion) void
addAssignment
(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, String actionText, Script onCompletion) void
void
deflate()
void
despawn()
void
despawn
(CampaignEventListener.FleetDespawnReason reason, Object param) void
void
void
void
Makes sure the fleet's capacities, crew levels, etc match the fleet composition and cargo.float
In pixels per second, not per day.getAI()
float
getBaseSensorRangeToDetect
(float sensorProfile) float
Current burn level - not maximum, but how fast it's currently going.float
Sum of Misc.getMemberStrength(member, true, true, true) for all members.int
int
fighter, frigate: 1 destroyer: 2 cruiser: 3 capital: 5boolean
boolean
The fleet is trying to interact with this entity - i.e.org.lwjgl.util.vector.Vector2f
org.lwjgl.util.vector.Vector2f
getName()
int
int
int
int
int
int
int
getStats()
float
float
org.lwjgl.util.vector.Vector2f
In pixels per second.org.lwjgl.util.vector.Vector2f
getViewForMember
(FleetMemberAPI member) Returns the "view" of the fleet member in the campaign - i.e.getViews()
Returns the "view" of the fleet member in the campaign - i.e.void
void
goSlowOneFrame
(boolean stop) boolean
Only works for the player fleet.void
boolean
isAIMode()
boolean
boolean
isEmpty()
boolean
isFriendlyTo
(SectorEntityToken other) boolean
isHidden()
boolean
isHostileTo
(SectorEntityToken other) Eventually falls back to faction.isHostile(), but may return true if there's hostility due to MakeOtherFleetHostile true, a captain's relationship to the player/other captain, etc.boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
True if the player's transponder is on, or it has seen the player with the transponder on and hasn't lost track of them since that point.void
void
setAbortDespawn
(Boolean abortDespawn) void
setAI
(CampaignFleetAIAPI campaignFleetAI) void
setAIMode
(boolean aiMode) Turns off supplies/fuel use, accidents, and ship crew requirements.void
void
setCommander
(PersonAPI commander) void
setDoNotAdvanceAI
(Boolean doNotAdvanceAI) void
setFaction
(String factionId, boolean includeCaptains) void
setForceNoSensorProfileUpdate
(Boolean forceNoSensorProfileUpdate) void
void
setInflated
(Boolean inflated) void
setInflater
(FleetInflater inflater) void
void
setLocation
(float x, float y) Use this to set the location.void
setMoveDestination
(float x, float y) Used by the AI to control the fleet as well, so it's not a reliable way to order a fleet around as the AI will be calling this method every frame.void
setMoveDestinationOverride
(float x, float y) Overrides AI and player input.void
void
setNoAutoDespawn
(Boolean noAutoDespawn) void
setNoEngaging
(float seconds) void
setNoFactionInName
(boolean noFactionInName) void
setNullAIActionText
(String nullAIActionText) void
void
setStationMode
(Boolean stationMode) void
setVelocity
(float x, float y) In pixels per second, not per day.void
setWasMousedOverByPlayer
(Boolean wasMousedOverByPlayer) void
Updates numCapitals/numCruisers/etcvoid
boolean
Methods inherited from interface com.fs.starfarer.api.campaign.FleetOrStubAPI
addAssignmentAtStart, addAssignmentAtStart, addEventListener, addScript, getAssignmentsCopy, getCurrentAssignment, getId, getLocationInHyperspace, getMemoryWithoutUpdate, getScripts, isCurrentAssignment, isFleet, removeEventListener, removeFirstAssignment, removeFirstAssignmentIfItIs
Methods inherited from interface com.fs.starfarer.api.campaign.SectorEntityToken
addAbility, addDropRandom, addDropRandom, addDropRandom, addDropValue, addDropValue, addFloatingText, addFloatingText, addScript, addTag, advance, autoUpdateHyperLocationBasedOnInSystemEntityAtRadius, clearAbilities, clearFloatingText, clearTags, forceSensorContactFaderBrightness, forceSensorFaderBrightness, forceSensorFaderOut, getAbilities, getAbility, getActivePerson, getAlwaysUseSensorFaderBrightness, getAutogenJumpPointNameInHyper, getCargo, getCircularOrbitAngle, getCircularOrbitPeriod, getCircularOrbitRadius, getConstellation, getCustomData, getCustomDescriptionId, getCustomEntitySpec, getCustomEntityType, getCustomInteractionDialogImageVisual, getCustomPlugin, getDetectedRangeMod, getDetectionRangeDetailsOverrideMult, getDiscoveryXP, getDropRandom, getDropValue, getExtendedDetectedAtRange, getFacing, getFaction, getFullName, getId, getIndicatorColor, getLightColor, getLightSource, getLocationInHyperspace, getMarket, getMaxSensorRangeToDetect, getMemory, getMemoryWithoutUpdate, getOrbit, getOrbitFocus, getRadius, getSalvageXP, getScripts, getSensorContactFaderBrightness, getSensorFaderBrightness, getSensorProfile, getSensorRangeMod, getSensorStrength, getStarSystem, getTags, getVisibilityLevelOfPlayerFleet, getVisibilityLevelTo, getVisibilityLevelToPlayerFleet, hasAbility, hasDiscoveryXP, hasSalvageXP, hasScriptOfClass, hasSensorProfile, hasSensorStrength, hasTag, isAlive, isDiscoverable, isExpired, isFreeTransfer, isInOrNearSystem, isSkipForJumpPointAutoGen, isStar, isSystemCenter, isTransponderOn, isVisibleToPlayerFleet, isVisibleToSensorsOf, removeAbility, removeScript, removeScriptsOfClass, removeTag, setActivePerson, setAlwaysUseSensorFaderBrightness, setAutogenJumpPointNameInHyper, setCircularOrbit, setCircularOrbitAngle, setCircularOrbitPointingDown, setCircularOrbitWithSpin, setContainingLocation, setCustomDescriptionId, setCustomInteractionDialogImageVisual, setDetectionRangeDetailsOverrideMult, setDiscoverable, setDiscoveryXP, setExpired, setExtendedDetectedAtRange, setFacing, setFaction, setFixedLocation, setFreeTransfer, setId, setInteractionImage, setLightSource, setMarket, setMemory, setOrbit, setOrbitFocus, setSalvageXP, setSensorProfile, setSensorStrength, setSkipForJumpPointAutoGen, setTransponderOn
-
Method Details
-
isInCurrentLocation
boolean isInCurrentLocation()- Specified by:
isInCurrentLocation
in interfaceSectorEntityToken
- Returns:
- whether the fleet's LocationAPI is the same one the player's fleet is currently in.
-
isInHyperspace
boolean isInHyperspace()- Specified by:
isInHyperspace
in interfaceSectorEntityToken
-
setLocation
void setLocation(float x, float y) Use this to set the location. DO NOT use getLocation().x =etc, that won't work. - Specified by:
setLocation
in interfaceSectorEntityToken
- Parameters:
x
-y
-
-
despawn
void despawn()- Specified by:
despawn
in interfaceFleetOrStubAPI
-
despawn
- Specified by:
despawn
in interfaceFleetOrStubAPI
-
addAssignment
- Specified by:
addAssignment
in interfaceFleetOrStubAPI
-
addAssignment
void addAssignment(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, Script onCompletion) - Specified by:
addAssignment
in interfaceFleetOrStubAPI
-
addAssignment
void addAssignment(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, String actionText) - Specified by:
addAssignment
in interfaceFleetOrStubAPI
-
addAssignment
void addAssignment(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, String actionText, Script onCompletion) - Specified by:
addAssignment
in interfaceFleetOrStubAPI
-
clearAssignments
void clearAssignments()- Specified by:
clearAssignments
in interfaceFleetOrStubAPI
-
setPreferredResupplyLocation
-
getVelocity
org.lwjgl.util.vector.Vector2f getVelocity()Description copied from interface:SectorEntityToken
In pixels per second.- Specified by:
getVelocity
in interfaceSectorEntityToken
- Returns:
-
getLocation
org.lwjgl.util.vector.Vector2f getLocation()- Specified by:
getLocation
in interfaceFleetOrStubAPI
- Specified by:
getLocation
in interfaceSectorEntityToken
-
getLogistics
FleetLogisticsAPI getLogistics() -
getContainingLocation
LocationAPI getContainingLocation()- Specified by:
getContainingLocation
in interfaceFleetOrStubAPI
- Specified by:
getContainingLocation
in interfaceSectorEntityToken
-
getCommander
PersonAPI getCommander() -
getCommanderStats
MutableCharacterStatsAPI getCommanderStats() -
getFlagship
FleetMemberAPI getFlagship() -
isPlayerFleet
boolean isPlayerFleet()- Specified by:
isPlayerFleet
in interfaceSectorEntityToken
-
getFleetData
FleetDataAPI getFleetData() -
removeFleetMemberWithDestructionFlash
-
setName
- Specified by:
setName
in interfaceSectorEntityToken
-
getTotalSupplyCostPerDay
float getTotalSupplyCostPerDay() -
getNumCapitals
int getNumCapitals() -
getNumCruisers
int getNumCruisers() -
getNumDestroyers
int getNumDestroyers() -
getNumFrigates
int getNumFrigates() -
getNumFighters
int getNumFighters() -
updateCounts
void updateCounts()Updates numCapitals/numCruisers/etc -
getTravelSpeed
float getTravelSpeed() -
getAI
CampaignFleetAIAPI getAI() -
getFleetPoints
int getFleetPoints() -
getNameWithFaction
String getNameWithFaction() -
getName
String getName()- Specified by:
getName
in interfaceSectorEntityToken
-
isValidPlayerFleet
boolean isValidPlayerFleet()- Returns:
- true if the fleet is not empty and doesn't consist entirely of fighter wings.
-
setNoEngaging
void setNoEngaging(float seconds) -
getStats
MutableFleetStatsAPI getStats() -
setMoveDestination
void setMoveDestination(float x, float y) Used by the AI to control the fleet as well, so it's not a reliable way to order a fleet around as the AI will be calling this method every frame.- Parameters:
x
-y
-
-
setMoveDestinationOverride
void setMoveDestinationOverride(float x, float y) Overrides AI and player input.- Parameters:
x
-y
-
-
getInteractionTarget
SectorEntityToken getInteractionTarget()The fleet is trying to interact with this entity - i.e. engage an enemy fleet, use a wormhole, etc.- Returns:
-
setInteractionTarget
-
isInHyperspaceTransition
boolean isInHyperspaceTransition() -
setAIMode
void setAIMode(boolean aiMode) Turns off supplies/fuel use, accidents, and ship crew requirements. Locks the LR to 100%.- Parameters:
aiMode
-
-
isAIMode
boolean isAIMode() -
getFleetSizeCount
int getFleetSizeCount()fighter, frigate: 1 destroyer: 2 cruiser: 3 capital: 5- Returns:
-
setNoFactionInName
void setNoFactionInName(boolean noFactionInName) -
isNoFactionInName
boolean isNoFactionInName() -
setCommander
-
forceSync
void forceSync()Makes sure the fleet's capacities, crew levels, etc match the fleet composition and cargo. Also reapplies any fleet buffs, effects of hullmods, skills, etc. -
knowsWhoPlayerIs
boolean knowsWhoPlayerIs()True if the player's transponder is on, or it has seen the player with the transponder on and hasn't lost track of them since that point.- Returns:
-
isHostileTo
Eventually falls back to faction.isHostile(), but may return true if there's hostility due to MakeOtherFleetHostile true, a captain's relationship to the player/other captain, etc.- Parameters:
other
-- Returns:
-
getViews
List<FleetMemberViewAPI> getViews()Returns the "view" of the fleet member in the campaign - i.e. the little ships flying around. Not every fleet member necessarily has a view. Fleets don't have any member views when they're not currently visible to the player.- Returns:
-
getViewForMember
Returns the "view" of the fleet member in the campaign - i.e. the little ships flying around. Not every fleet member necessarily has a view. Fleets don't have any member views when they're not currently visible to the player.- Returns:
-
getCurrBurnLevel
float getCurrBurnLevel()Current burn level - not maximum, but how fast it's currently going.- Returns:
-
setVelocity
void setVelocity(float x, float y) In pixels per second, not per day. -
getAcceleration
float getAcceleration()In pixels per second, not per day.- Returns:
-
setFaction
-
getBattle
BattleAPI getBattle() -
setBattle
-
setAI
-
getNameWithFactionKeepCase
String getNameWithFactionKeepCase() -
isFriendlyTo
-
getBaseSensorRangeToDetect
float getBaseSensorRangeToDetect(float sensorProfile) - Specified by:
getBaseSensorRangeToDetect
in interfaceSectorEntityToken
-
isDoNotAdvanceAI
Boolean isDoNotAdvanceAI() -
setDoNotAdvanceAI
-
getMembersWithFightersCopy
List<FleetMemberAPI> getMembersWithFightersCopy() -
setNullAIActionText
-
getNullAIActionText
String getNullAIActionText() -
setStationMode
-
isStationMode
boolean isStationMode() -
wasMousedOverByPlayer
Boolean wasMousedOverByPlayer() -
setWasMousedOverByPlayer
-
isDespawning
boolean isDespawning() -
getMoveDestination
org.lwjgl.util.vector.Vector2f getMoveDestination() -
getEventListeners
List<FleetEventListener> getEventListeners()- Specified by:
getEventListeners
in interfaceFleetOrStubAPI
-
getInflater
FleetInflater getInflater() -
setInflater
-
inflateIfNeeded
void inflateIfNeeded() -
deflate
void deflate() -
isEmpty
boolean isEmpty() -
getForceNoSensorProfileUpdate
Boolean getForceNoSensorProfileUpdate() -
setForceNoSensorProfileUpdate
-
isInflated
boolean isInflated() -
setInflated
-
isNoAutoDespawn
Boolean isNoAutoDespawn() -
setNoAutoDespawn
-
addAssignment
void addAssignment(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, String actionText, boolean addTimeToNext, Script onStart, Script onCompletion) -
isHidden
boolean isHidden() -
setHidden
-
getAbortDespawn
Boolean getAbortDespawn() -
setAbortDespawn
-
getEffectiveStrength
float getEffectiveStrength()Sum of Misc.getMemberStrength(member, true, true, true) for all members. Cached and updated as needed.- Returns:
-
getNumMembersFast
int getNumMembersFast() -
goSlowOneFrame
void goSlowOneFrame(boolean stop) -
wasSlowMoving
boolean wasSlowMoving() -
getNumShips
int getNumShips() -
updateFleetView
void updateFleetView() -
hasShipsWithUniqueSig
boolean hasShipsWithUniqueSig()Only works for the player fleet.- Returns:
-
getGoSlowStop
boolean getGoSlowStop() -
goSlowOneFrame
void goSlowOneFrame() -
getGoSlowOneFrame
boolean getGoSlowOneFrame() -
getVelocityFromMovementModule
org.lwjgl.util.vector.Vector2f getVelocityFromMovementModule() -
fadeOutIndicator
void fadeOutIndicator()- Specified by:
fadeOutIndicator
in interfaceSectorEntityToken
-
fadeInIndicator
void fadeInIndicator()- Specified by:
fadeInIndicator
in interfaceSectorEntityToken
-
forceOutIndicator
void forceOutIndicator()- Specified by:
forceOutIndicator
in interfaceSectorEntityToken
-