Class ToggleAbilityWithCost
java.lang.Object
com.fs.starfarer.api.impl.campaign.abilities.BaseAbilityPlugin
com.fs.starfarer.api.impl.campaign.abilities.BaseToggleAbility
com.fs.starfarer.api.impl.campaign.abilities.ToggleAbilityWithCost
- All Implemented Interfaces:
AbilityPlugin
,EveryFrameScript
- Direct Known Subclasses:
ReversePolarityToggle
-
Field Summary
Fields inherited from class com.fs.starfarer.api.impl.campaign.abilities.BaseToggleAbility
cooldownLeft, isActivateCooldown, level, 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
void
addCostTooltipSection
(TooltipMakerAPI tooltip, boolean expanded, String prefix) void
addOtherNotUsableReason
(TooltipMakerAPI tooltip, boolean expanded) protected void
applyEffect
(float amount, float level) Will be called once when level is 0 and consistently when level >0.protected void
applyFleetVisual
(float amount, float level) protected void
applyStatsEffect
(float amount, float level) boolean
canRecoverCRWhileActive
(boolean forTooltip) protected void
protected float
computeFuelCost
(boolean forTooltip) protected float
computeSupplyCost
(boolean forTooltip) protected void
protected void
float
getActivationAtLowCRShipDamageProbability
(boolean forTooltip) getActivationDamageLevel
(boolean forTooltip) float
0 at start of cooldown, 1 at end.float
getCRCost
(FleetMemberAPI member, boolean forTooltip) float
getCRCostMult
(boolean forTooltip) float
getFuelCostMult
(boolean forTooltip) protected List<FleetMemberAPI>
getNonReadyShips
(boolean forTooltip) boolean
boolean
boolean
boolean
isUsable()
Whether the ability can be activated / the UI button corresponding to it is enabled.boolean
shouldApplyCostWhenDeactivating
(boolean forTooltip) protected boolean
protected void
Methods inherited from class com.fs.starfarer.api.impl.campaign.abilities.BaseToggleAbility
activate, addIncompatibleToTooltip, advance, cleanup, deactivate, getActivateCooldownDays, getActivationDays, getCooldownLeft, getDeactivateCooldownDays, getDeactivationDays, getLevel, getLoopSoundUIPitch, getLoopSoundUIVolume, getLoopSoundWorldPitch, getLoopSoundWorldVolume, getProgressFraction, hasCustomButtonPressSounds, isActive, pressButton, runWhilePaused, setCooldownLeft, showActiveIndicator, showProgressIndicator
Methods inherited from class com.fs.starfarer.api.impl.campaign.abilities.BaseAbilityPlugin
addIncompatibleToTooltip, createTooltip, disableIncompatible, fleetJoinedBattle, fleetLeftBattle, fleetOpenedMarket, forceDisable, getActivationText, getActiveColor, getActiveLayers, getDeactivationText, getEntity, getFleet, getId, getInterruptedList, getLoopSoundUI, getLoopSoundWorld, getModId, getOffSoundUI, getOffSoundWorld, getOnSoundUI, getOnSoundWorld, getProgressColor, getSpec, getSpriteName, getTooltipWidth, init, interruptIncompatible, isActiveOrInProgress, isCompatible, isDone, isInProgress, isTooltipExpandable, readResolve, render, showCooldownIndicator
-
Constructor Details
-
ToggleAbilityWithCost
public ToggleAbilityWithCost()
-
-
Method Details
-
getFuelCostMult
public float getFuelCostMult(boolean forTooltip) -
getCRCostMult
public float getCRCostMult(boolean forTooltip) -
getActivationAtLowCRShipDamageProbability
public float getActivationAtLowCRShipDamageProbability(boolean forTooltip) -
getActivationDamageLevel
-
canRecoverCRWhileActive
public boolean canRecoverCRWhileActive(boolean forTooltip) -
shouldApplyCostWhenDeactivating
public boolean shouldApplyCostWhenDeactivating(boolean forTooltip) -
activateImpl
protected void activateImpl()- Specified by:
activateImpl
in classBaseToggleAbility
-
deductCost
protected void deductCost() -
applyStatsEffect
protected void applyStatsEffect(float amount, float level) -
unapplyStatsEffect
protected void unapplyStatsEffect() -
applyFleetVisual
protected void applyFleetVisual(float amount, float level) -
applyEffect
protected void applyEffect(float amount, float level) Description copied from class:BaseToggleAbility
Will be called once when level is 0 and consistently when level >0.- Specified by:
applyEffect
in classBaseToggleAbility
-
deactivateImpl
protected void deactivateImpl()- Specified by:
deactivateImpl
in classBaseToggleAbility
-
cleanupImpl
protected void cleanupImpl()- Specified by:
cleanupImpl
in classBaseToggleAbility
-
getNonReadyShips
-
getCRCost
-
computeFuelCost
protected float computeFuelCost(boolean forTooltip) -
computeSupplyCost
protected float computeSupplyCost(boolean forTooltip) -
addOtherNotUsableReason
-
addCostTooltipSection
-
hasTooltip
public boolean hasTooltip()- Specified by:
hasTooltip
in interfaceAbilityPlugin
- Overrides:
hasTooltip
in classBaseAbilityPlugin
-
isOnCooldown
public boolean isOnCooldown()- Specified by:
isOnCooldown
in interfaceAbilityPlugin
- Overrides:
isOnCooldown
in classBaseAbilityPlugin
-
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 classBaseToggleAbility
- Returns:
-
showAlarm
protected boolean showAlarm() -
getCooldownFraction
public float getCooldownFraction()Description copied from interface:AbilityPlugin
0 at start of cooldown, 1 at end.- Specified by:
getCooldownFraction
in interfaceAbilityPlugin
- Overrides:
getCooldownFraction
in classBaseToggleAbility
- Returns:
-
getCooldownColor
- Specified by:
getCooldownColor
in interfaceAbilityPlugin
- Overrides:
getCooldownColor
in classBaseAbilityPlugin
-
isCooldownRenderingAdditive
public boolean isCooldownRenderingAdditive()- Specified by:
isCooldownRenderingAdditive
in interfaceAbilityPlugin
- Overrides:
isCooldownRenderingAdditive
in classBaseAbilityPlugin
-