Interface CampaignFleetAPI

All Superinterfaces:
FleetOrStubAPI, HasMemory, SectorEntityToken

public interface CampaignFleetAPI extends SectorEntityToken, FleetOrStubAPI
Author:
Alex Mosolov Copyright 2012 Fractal Softworks, LLC
  • Method Details

    • isInCurrentLocation

      boolean isInCurrentLocation()
      Specified by:
      isInCurrentLocation in interface SectorEntityToken
      Returns:
      whether the fleet's LocationAPI is the same one the player's fleet is currently in.
    • isInHyperspace

      boolean isInHyperspace()
      Specified by:
      isInHyperspace in interface SectorEntityToken
    • 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 interface SectorEntityToken
      Parameters:
      x -
      y -
    • despawn

      void despawn()
      Specified by:
      despawn in interface FleetOrStubAPI
    • despawn

      void despawn(CampaignEventListener.FleetDespawnReason reason, Object param)
      Specified by:
      despawn in interface FleetOrStubAPI
    • addAssignment

      void addAssignment(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays)
      Specified by:
      addAssignment in interface FleetOrStubAPI
    • addAssignment

      void addAssignment(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, Script onCompletion)
      Specified by:
      addAssignment in interface FleetOrStubAPI
    • addAssignment

      void addAssignment(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, String actionText)
      Specified by:
      addAssignment in interface FleetOrStubAPI
    • addAssignment

      void addAssignment(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, String actionText, Script onCompletion)
      Specified by:
      addAssignment in interface FleetOrStubAPI
    • clearAssignments

      void clearAssignments()
      Specified by:
      clearAssignments in interface FleetOrStubAPI
    • setPreferredResupplyLocation

      void setPreferredResupplyLocation(SectorEntityToken token)
    • getVelocity

      org.lwjgl.util.vector.Vector2f getVelocity()
      Description copied from interface: SectorEntityToken
      In pixels per second.
      Specified by:
      getVelocity in interface SectorEntityToken
      Returns:
    • getLocation

      org.lwjgl.util.vector.Vector2f getLocation()
      Specified by:
      getLocation in interface FleetOrStubAPI
      Specified by:
      getLocation in interface SectorEntityToken
    • getLogistics

      FleetLogisticsAPI getLogistics()
    • getContainingLocation

      LocationAPI getContainingLocation()
      Specified by:
      getContainingLocation in interface FleetOrStubAPI
      Specified by:
      getContainingLocation in interface SectorEntityToken
    • getCommander

      PersonAPI getCommander()
    • getCommanderStats

      MutableCharacterStatsAPI getCommanderStats()
    • getFlagship

      FleetMemberAPI getFlagship()
    • isPlayerFleet

      boolean isPlayerFleet()
      Specified by:
      isPlayerFleet in interface SectorEntityToken
    • getFleetData

      FleetDataAPI getFleetData()
    • removeFleetMemberWithDestructionFlash

      void removeFleetMemberWithDestructionFlash(FleetMemberAPI member)
    • setName

      void setName(String name)
      Specified by:
      setName in interface SectorEntityToken
    • 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

    • getFleetPoints

      int getFleetPoints()
    • getNameWithFaction

      String getNameWithFaction()
    • getName

      String getName()
      Specified by:
      getName in interface SectorEntityToken
    • 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

    • 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

      void setInteractionTarget(SectorEntityToken target)
    • 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

      void setCommander(PersonAPI commander)
    • 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

      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.
      Parameters:
      other -
      Returns:
    • 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

      FleetMemberViewAPI getViewForMember(FleetMemberAPI member)
      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

      void setFaction(String factionId, boolean includeCaptains)
    • getBattle

      BattleAPI getBattle()
    • setBattle

      void setBattle(BattleAPI battle)
    • setAI

      void setAI(CampaignFleetAIAPI campaignFleetAI)
    • getNameWithFactionKeepCase

      String getNameWithFactionKeepCase()
    • isFriendlyTo

      boolean isFriendlyTo(SectorEntityToken other)
    • getBaseSensorRangeToDetect

      float getBaseSensorRangeToDetect(float sensorProfile)
      Specified by:
      getBaseSensorRangeToDetect in interface SectorEntityToken
    • isDoNotAdvanceAI

      Boolean isDoNotAdvanceAI()
    • setDoNotAdvanceAI

      void setDoNotAdvanceAI(Boolean doNotAdvanceAI)
    • getMembersWithFightersCopy

      List<FleetMemberAPI> getMembersWithFightersCopy()
    • setNullAIActionText

      void setNullAIActionText(String nullAIActionText)
    • getNullAIActionText

      String getNullAIActionText()
    • setStationMode

      void setStationMode(Boolean stationMode)
    • isStationMode

      boolean isStationMode()
    • wasMousedOverByPlayer

      Boolean wasMousedOverByPlayer()
    • setWasMousedOverByPlayer

      void setWasMousedOverByPlayer(Boolean wasMousedOverByPlayer)
    • isDespawning

      boolean isDespawning()
    • getMoveDestination

      org.lwjgl.util.vector.Vector2f getMoveDestination()
    • getEventListeners

      List<FleetEventListener> getEventListeners()
      Specified by:
      getEventListeners in interface FleetOrStubAPI
    • getInflater

      FleetInflater getInflater()
    • setInflater

      void setInflater(FleetInflater inflater)
    • inflateIfNeeded

      void inflateIfNeeded()
    • deflate

      void deflate()
    • isEmpty

      boolean isEmpty()
    • getForceNoSensorProfileUpdate

      Boolean getForceNoSensorProfileUpdate()
    • setForceNoSensorProfileUpdate

      void setForceNoSensorProfileUpdate(Boolean forceNoSensorProfileUpdate)
    • isInflated

      boolean isInflated()
    • setInflated

      void setInflated(Boolean inflated)
    • isNoAutoDespawn

      Boolean isNoAutoDespawn()
    • setNoAutoDespawn

      void setNoAutoDespawn(Boolean noAutoDespawn)
    • addAssignment

      void addAssignment(FleetAssignment assignment, SectorEntityToken target, float maxDurationInDays, String actionText, boolean addTimeToNext, Script onStart, Script onCompletion)
    • isHidden

      boolean isHidden()
    • setHidden

      void setHidden(Boolean hidden)
    • getAbortDespawn

      Boolean getAbortDespawn()
    • setAbortDespawn

      void setAbortDespawn(Boolean abortDespawn)
    • 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 interface SectorEntityToken
    • fadeInIndicator

      void fadeInIndicator()
      Specified by:
      fadeInIndicator in interface SectorEntityToken
    • forceOutIndicator

      void forceOutIndicator()
      Specified by:
      forceOutIndicator in interface SectorEntityToken