Class DistressCallAbility
java.lang.Object
com.fs.starfarer.api.impl.campaign.abilities.BaseAbilityPlugin
com.fs.starfarer.api.impl.campaign.abilities.BaseDurationAbility
com.fs.starfarer.api.impl.campaign.abilities.DistressCallAbility
- All Implemented Interfaces:
AbilityPlugin
,EveryFrameScript
,RouteManager.RouteFleetSpawner
public class DistressCallAbility
extends BaseDurationAbility
implements RouteManager.RouteFleetSpawner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static enum
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final float
protected long
static final float
static final float
protected int
protected boolean
protected TimeoutTracker<DistressCallAbility.AbilityUseData>
Fields inherited from class com.fs.starfarer.api.impl.campaign.abilities.BaseDurationAbility
activeDaysLeft, cooldownLeft, fadingOut, level, LOOP_FADE_TIME_DAYS, loopFadeLeft, turnedOn
Fields inherited from class com.fs.starfarer.api.impl.campaign.abilities.BaseAbilityPlugin
disableFrames, entity, id, PLAY_UI_SOUNDS_IN_WORLD_SOURCES, spec
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
addHelpScript
(float delayDays, StarSystemAPI system, JumpPointAPI inner, JumpPointAPI outer) protected void
addPiratesScript
(float delayDays, StarSystemAPI system, JumpPointAPI inner, JumpPointAPI outer) protected void
addResponseScript
(float delayDays, DistressCallAbility.DistressCallOutcome outcome) void
advance
(float amount) Use SectorAPI.getClock() to convert to campaign days.protected void
applyEffect
(float amount, float level) Will be called once when level is 0 and consistently when level >0.protected void
void
createTooltip
(TooltipMakerAPI tooltip, boolean expanded) Will be called every frame the tooltip is shown, so the tooltip can be dynamic.protected void
int
getUses()
boolean
boolean
isUsable()
Whether the ability can be activated / the UI button corresponding to it is enabled.protected Object
void
boolean
boolean
spawnFleet
(RouteManager.RouteData route) boolean
wasUsedNearby
(float withinDays, org.lwjgl.util.vector.Vector2f locInHyper, float withinRangeLY) Methods inherited from class com.fs.starfarer.api.impl.campaign.abilities.BaseDurationAbility
activate, addIncompatibleToTooltip, cleanup, deactivate, getActivationDays, getActiveDaysLeft, getCooldownDays, getCooldownFraction, getCooldownLeft, getDeactivationDays, getDurationDays, getLevel, getLoopSoundUIPitch, getLoopSoundUIVolume, getLoopSoundWorldPitch, getLoopSoundWorldVolume, getProgressFraction, getTotalDurationDays, hasCustomButtonPressSounds, isActive, isFadingOut, isInProgress, pressButton, runWhilePaused, setActiveDaysLeft, setCooldownLeft, showActiveIndicator, showProgressIndicator
Methods inherited from class com.fs.starfarer.api.impl.campaign.abilities.BaseAbilityPlugin
addIncompatibleToTooltip, disableIncompatible, fleetJoinedBattle, fleetLeftBattle, fleetOpenedMarket, forceDisable, getActivationText, getActiveColor, getActiveLayers, getCooldownColor, getDeactivationText, getEntity, getFleet, getId, getInterruptedList, getLoopSoundUI, getLoopSoundWorld, getModId, getOffSoundUI, getOffSoundWorld, getOnSoundUI, getOnSoundWorld, getProgressColor, getSpec, getSpriteName, getTooltipWidth, init, interruptIncompatible, isActiveOrInProgress, isCompatible, isCooldownRenderingAdditive, isDone, isOnCooldown, isTooltipExpandable, render, showCooldownIndicator
-
Field Details
-
NEARBY_USE_TIMEOUT_DAYS
public static final float NEARBY_USE_TIMEOUT_DAYS- See Also:
-
NEARBY_USE_RADIUS_LY
public static final float NEARBY_USE_RADIUS_LY- See Also:
-
DAYS_TO_TRACK_USAGE
public static final float DAYS_TO_TRACK_USAGE- See Also:
-
performed
protected boolean performed -
numTimesUsed
protected int numTimesUsed -
lastUsed
protected long lastUsed -
uses
-
-
Constructor Details
-
DistressCallAbility
public DistressCallAbility()
-
-
Method Details
-
readResolve
- Overrides:
readResolve
in classBaseAbilityPlugin
-
activateImpl
protected void activateImpl()- Specified by:
activateImpl
in classBaseDurationAbility
-
applyEffect
protected void applyEffect(float amount, float level) Description copied from class:BaseDurationAbility
Will be called once when level is 0 and consistently when level >0.- Specified by:
applyEffect
in classBaseDurationAbility
-
wasUsedNearby
public boolean wasUsedNearby(float withinDays, org.lwjgl.util.vector.Vector2f locInHyper, float withinRangeLY) -
advance
public void advance(float amount) Description copied from interface:EveryFrameScript
Use SectorAPI.getClock() to convert to campaign days.- Specified by:
advance
in interfaceEveryFrameScript
- Overrides:
advance
in classBaseDurationAbility
- Parameters:
amount
- seconds elapsed during the last frame.
-
getUses
-
getNumUsesInLastPeriod
public int getNumUsesInLastPeriod() -
addResponseScript
-
addPiratesScript
protected void addPiratesScript(float delayDays, StarSystemAPI system, JumpPointAPI inner, JumpPointAPI outer) -
addHelpScript
protected void addHelpScript(float delayDays, StarSystemAPI system, JumpPointAPI inner, JumpPointAPI outer) -
isUsable
public boolean isUsable()Description copied from interface:AbilityPlugin
Whether the ability can be activated / the UI button corresponding to it is enabled.- Specified by:
isUsable
in interfaceAbilityPlugin
- Overrides:
isUsable
in classBaseDurationAbility
- Returns:
-
deactivateImpl
protected void deactivateImpl()- Specified by:
deactivateImpl
in classBaseDurationAbility
-
cleanupImpl
protected void cleanupImpl()- Specified by:
cleanupImpl
in classBaseDurationAbility
-
createTooltip
Description copied from interface:AbilityPlugin
Will be called every frame the tooltip is shown, so the tooltip can be dynamic.- Specified by:
createTooltip
in interfaceAbilityPlugin
- Overrides:
createTooltip
in classBaseAbilityPlugin
-
hasTooltip
public boolean hasTooltip()- Specified by:
hasTooltip
in interfaceAbilityPlugin
- Overrides:
hasTooltip
in classBaseAbilityPlugin
-
spawnFleet
- Specified by:
spawnFleet
in interfaceRouteManager.RouteFleetSpawner
-
reportAboutToBeDespawnedByRouteManager
- Specified by:
reportAboutToBeDespawnedByRouteManager
in interfaceRouteManager.RouteFleetSpawner
-
shouldCancelRouteAfterDelayCheck
- Specified by:
shouldCancelRouteAfterDelayCheck
in interfaceRouteManager.RouteFleetSpawner
-
shouldRepeat
- Specified by:
shouldRepeat
in interfaceRouteManager.RouteFleetSpawner
-