Class ThreatSwarmAI
java.lang.Object
com.fs.starfarer.api.impl.combat.threat.ThreatSwarmAI
- All Implemented Interfaces:
ShipAIPlugin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected float
protected IntervalUtil
protected boolean
static float
static float
static float
static float
protected boolean
protected float
protected float
protected float
protected float
protected IntervalUtil
protected ShipAPI
protected ShipwideAIFlags
protected List<ThreatSwarmAI.FlockingData>
protected float
protected IntervalUtil
static float
protected IntervalUtil
static float
protected IntervalUtil
protected boolean
static float
static float
protected ShipAPI
protected float
protected boolean
protected IntervalUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
advance
(float amount) The AI should do its main work here.protected void
advanceForSpecificSwarmType
(float amount) void
protected void
protected void
void
When this is called, the AI should immediately evaluate nearby threats and such, if it only does it periodically otherwise.static float
getShipWeight
(ShipAPI ship) static float
getShipWeight
(ShipAPI ship, boolean adjustForNonCombat) protected void
static boolean
isAttackSwarm
(ShipAPI ship) static boolean
isConstructionSwarm
(ShipAPI ship) static boolean
isReclamationSwarm
(ShipAPI ship) boolean
Only called for fighters, not regular ships or drones.protected void
void
setDoNotFireDelay
(float amount) Advise the AI not to fire for amount seconds.protected void
toggleOff
(int groupNum) protected void
toggleOn
(int groupNum) protected void
protected void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.fs.starfarer.api.combat.ShipAIPlugin
setTargetOverride
-
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
-
ship
-
updateInterval
-
headingInterval
-
attackRangeMultInterval
-
reclamationReturnInterval
-
sinceTurnedOffFlash
protected float sinceTurnedOffFlash -
fabricator
-
flockingData
-
desiredHeading
protected float desiredHeading -
headingChangeRate
protected float headingChangeRate -
elapsedSincePrevHeadingUpdate
protected float elapsedSincePrevHeadingUpdate -
attackRangeMult
protected float attackRangeMult -
enableOtherWeaponInterval
-
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
-
-
Method Details
-
isAttackSwarm
-
isConstructionSwarm
-
isReclamationSwarm
-
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 interfaceShipAIPlugin
-
giveMovementCommands
protected void giveMovementCommands() -
computeDesiredHeading
protected void computeDesiredHeading() -
updateFlockingData
protected void updateFlockingData() -
getAIFlags
- Specified by:
getAIFlags
in interfaceShipAIPlugin
-
getShipWeight
-
getShipWeight
-
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 interfaceShipAIPlugin
-
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 interfaceShipAIPlugin
-
needsRefit
public boolean needsRefit()Description copied from interface:ShipAIPlugin
Only called for fighters, not regular ships or drones.- Specified by:
needsRefit
in interfaceShipAIPlugin
- Returns:
- whether the fighter needs refit
-
cancelCurrentManeuver
public void cancelCurrentManeuver()- Specified by:
cancelCurrentManeuver
in interfaceShipAIPlugin
-
getConfig
- Specified by:
getConfig
in interfaceShipAIPlugin
-