Package com.fs.starfarer.api.combat
Interface AutofireAIPlugin
public interface AutofireAIPlugin
-
Method Summary
Modifier and TypeMethodDescriptionvoid
advance
(float amount) Only called when the group is on autofire.void
forceOff()
Tells the weapon AI to reconsider whether it should be firing, before it decides it should fire again.org.lwjgl.util.vector.Vector2f
boolean
Only called when the group is on autofire.
-
Method Details
-
advance
void advance(float amount) Only called when the group is on autofire. Should generally make the decision on what to fire at and whether to fire here, and then return the result of that decision in shouldFire().- Parameters:
amount
- seconds since last frame.
-
shouldFire
boolean shouldFire()Only called when the group is on autofire.- Returns:
- whether the weapon should fire now.
-
forceOff
void forceOff()Tells the weapon AI to reconsider whether it should be firing, before it decides it should fire again. Called when a group is toggled on/off. -
getTarget
org.lwjgl.util.vector.Vector2f getTarget()- Returns:
- location to aim at, with target leading if applicable. Can be null if the weapon has no target/isn't trying to aim anywhere.
-
getTargetShip
ShipAPI getTargetShip()- Returns:
- current target, if it's a ship. null otherwise.
-
getWeapon
WeaponAPI getWeapon()- Returns:
- the weapon that this AI is controlling. That means the plugin should hold on to it when it's passed in in ModPlugin.pickWeaponAutofireAI().
-
getTargetMissile
MissileAPI getTargetMissile()
-