Class ThreatSwarmAI

java.lang.Object
com.fs.starfarer.api.impl.combat.threat.ThreatSwarmAI
All Implemented Interfaces:
ShipAIPlugin

public class ThreatSwarmAI extends Object implements ShipAIPlugin
  • Field Details

    • ATTRACTOR_RANGE_MAX_SAME_WING

      public static float ATTRACTOR_RANGE_MAX_SAME_WING
    • ATTRACTOR_RANGE_MAX

      public static float ATTRACTOR_RANGE_MAX
    • COHESION_RANGE_MIN

      public static float COHESION_RANGE_MIN
    • COHESION_RANGE_MAX

      public static float COHESION_RANGE_MAX
    • REPEL_RANGE_MIN

      public static float REPEL_RANGE_MIN
    • REPEL_RANGE_MAX

      public static float REPEL_RANGE_MAX
    • MAX_TARGET_RANGE

      public static float MAX_TARGET_RANGE
    • PROB_ENABLE_OTHER_GROUP

      public static float PROB_ENABLE_OTHER_GROUP
    • flags

      protected ShipwideAIFlags flags
    • ship

      protected ShipAPI ship
    • updateInterval

      protected IntervalUtil updateInterval
    • headingInterval

      protected IntervalUtil headingInterval
    • attackRangeMultInterval

      protected IntervalUtil attackRangeMultInterval
    • reclamationReturnInterval

      protected IntervalUtil reclamationReturnInterval
    • sinceTurnedOffFlash

      protected float sinceTurnedOffFlash
    • fabricator

      protected ShipAPI fabricator
    • flockingData

      protected List<ThreatSwarmAI.FlockingData> flockingData
    • desiredHeading

      protected float desiredHeading
    • headingChangeRate

      protected float headingChangeRate
    • elapsedSincePrevHeadingUpdate

      protected float elapsedSincePrevHeadingUpdate
    • attackRangeMult

      protected float attackRangeMult
    • enableOtherWeaponInterval

      protected IntervalUtil enableOtherWeaponInterval
    • priorityTargetPickerInterval

      protected IntervalUtil priorityTargetPickerInterval
    • enableOtherWeaponDuration

      protected float enableOtherWeaponDuration
    • elapsed

      protected float elapsed
    • startedConstruction

      protected boolean startedConstruction
    • attackSwarm

      protected boolean attackSwarm
    • constructionSwarm

      protected boolean constructionSwarm
    • reclamationSwarm

      protected boolean reclamationSwarm
  • Constructor Details

    • ThreatSwarmAI

      public ThreatSwarmAI(ShipAPI ship)
  • Method Details

    • isAttackSwarm

      public static boolean isAttackSwarm(ShipAPI ship)
    • isConstructionSwarm

      public static boolean isConstructionSwarm(ShipAPI ship)
    • isReclamationSwarm

      public static boolean isReclamationSwarm(ShipAPI ship)
    • getShared

    • doInitialSetup

      protected void doInitialSetup()
    • toggleOn

      protected void toggleOn(int groupNum)
    • toggleOff

      protected void toggleOff(int groupNum)
    • advanceForSpecificSwarmType

      protected void advanceForSpecificSwarmType(float amount)
    • pickPriorityTarget

      protected void pickPriorityTarget()
    • updateAttackRangeMult

      protected void updateAttackRangeMult()
    • advance

      public void advance(float amount)
      Description copied from interface: ShipAIPlugin
      The AI should do its main work here.
      Specified by:
      advance in interface ShipAIPlugin
    • giveMovementCommands

      protected void giveMovementCommands()
    • computeDesiredHeading

      protected void computeDesiredHeading()
    • updateFlockingData

      protected void updateFlockingData()
    • getAIFlags

      public ShipwideAIFlags getAIFlags()
      Specified by:
      getAIFlags in interface ShipAIPlugin
    • getShipWeight

      public static float getShipWeight(ShipAPI ship)
    • getShipWeight

      public static float getShipWeight(ShipAPI ship, boolean adjustForNonCombat)
    • setDoNotFireDelay

      public void setDoNotFireDelay(float amount)
      Description copied from interface: ShipAIPlugin
      Advise the AI not to fire for amount seconds. Used when fighters are taking off from a carrier to prevent bomb/torpedo friendly fire.
      Specified by:
      setDoNotFireDelay in interface ShipAIPlugin
    • forceCircumstanceEvaluation

      public void forceCircumstanceEvaluation()
      Description copied from interface: ShipAIPlugin
      When this is called, the AI should immediately evaluate nearby threats and such, if it only does it periodically otherwise. Called when the autopilot is toggled on.
      Specified by:
      forceCircumstanceEvaluation in interface ShipAIPlugin
    • needsRefit

      public boolean needsRefit()
      Description copied from interface: ShipAIPlugin
      Only called for fighters, not regular ships or drones.
      Specified by:
      needsRefit in interface ShipAIPlugin
      Returns:
      whether the fighter needs refit
    • cancelCurrentManeuver

      public void cancelCurrentManeuver()
      Specified by:
      cancelCurrentManeuver in interface ShipAIPlugin
    • getConfig

      public ShipAIConfig getConfig()
      Specified by:
      getConfig in interface ShipAIPlugin