public abstract class BaseToggleAbility extends BaseAbilityPlugin
| Modifier and Type | Field and Description |
|---|---|
protected float |
cooldownLeft |
protected boolean |
isActivateCooldown |
protected float |
level |
protected boolean |
turnedOn |
disableFrames, entity, id, PLAY_UI_SOUNDS_IN_WORLD_SOURCES, spec| Constructor and Description |
|---|
BaseToggleAbility() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Programmatic way to activate the ability.
|
protected abstract void |
activateImpl() |
protected void |
addIncompatibleToTooltip(TooltipMakerAPI tooltip,
boolean expanded) |
void |
advance(float amount)
Use SectorAPI.getClock() to convert to campaign days.
|
protected abstract void |
applyEffect(float amount,
float level)
Will be called once when level is 0 and consistently when level >0.
|
void |
cleanup()
After this method is called, it should be possible to remove the ability
from the entity without any after-effects.
|
protected abstract void |
cleanupImpl() |
void |
deactivate()
Toggleable or interruptable abilities should implement this method so
that other abilities may turn them off or interrupt them if needed.
|
protected abstract void |
deactivateImpl() |
float |
getActivateCooldownDays() |
float |
getActivationDays() |
float |
getCooldownFraction()
0 at start of cooldown, 1 at end.
|
float |
getCooldownLeft() |
float |
getDeactivateCooldownDays() |
float |
getDeactivationDays() |
float |
getLevel() |
float |
getLoopSoundUIPitch() |
float |
getLoopSoundUIVolume() |
float |
getLoopSoundWorldPitch() |
float |
getLoopSoundWorldVolume() |
float |
getProgressFraction()
0 at start of progress, 1 at end.
|
boolean |
hasCustomButtonPressSounds() |
boolean |
isActive()
Whether a toggle-style ability is turned on.
|
boolean |
isUsable()
Whether the ability can be activated / the UI button corresponding to it is enabled.
|
void |
pressButton()
Called from the UI when the button for this ability is pressed.
|
boolean |
runWhilePaused() |
void |
setCooldownLeft(float cooldownLeft) |
boolean |
showActiveIndicator() |
boolean |
showProgressIndicator() |
addIncompatibleToTooltip, createTooltip, 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, hasTooltip, init, interruptIncompatible, isActiveOrInProgress, isCompatible, isCooldownRenderingAdditive, isDone, isInProgress, isOnCooldown, isTooltipExpandable, readResolve, render, showCooldownIndicatorprotected boolean turnedOn
protected float cooldownLeft
protected boolean isActivateCooldown
protected float level
public BaseToggleAbility()
public float getLoopSoundUIVolume()
getLoopSoundUIVolume in class BaseAbilityPluginpublic float getLoopSoundUIPitch()
getLoopSoundUIPitch in class BaseAbilityPluginpublic float getLoopSoundWorldVolume()
getLoopSoundWorldVolume in class BaseAbilityPluginpublic float getLoopSoundWorldPitch()
getLoopSoundWorldPitch in class BaseAbilityPluginpublic float getActivateCooldownDays()
public float getDeactivateCooldownDays()
public float getActivationDays()
public float getDeactivationDays()
protected abstract void activateImpl()
protected abstract void applyEffect(float amount, float level)
level - protected abstract void deactivateImpl()
protected abstract void cleanupImpl()
public float getCooldownLeft()
getCooldownLeft in interface AbilityPlugingetCooldownLeft in class BaseAbilityPluginpublic void setCooldownLeft(float cooldownLeft)
setCooldownLeft in interface AbilityPluginsetCooldownLeft in class BaseAbilityPluginpublic void advance(float amount)
EveryFrameScriptadvance in interface EveryFrameScriptadvance in class BaseAbilityPluginamount - seconds elapsed during the last frame.protected void addIncompatibleToTooltip(TooltipMakerAPI tooltip, boolean expanded)
public boolean isUsable()
AbilityPluginisUsable in interface AbilityPluginisUsable in class BaseAbilityPluginpublic float getCooldownFraction()
AbilityPlugingetCooldownFraction in interface AbilityPlugingetCooldownFraction in class BaseAbilityPluginpublic float getProgressFraction()
AbilityPlugingetProgressFraction in interface AbilityPlugingetProgressFraction in class BaseAbilityPluginpublic boolean showProgressIndicator()
showProgressIndicator in interface AbilityPluginshowProgressIndicator in class BaseAbilityPluginpublic boolean showActiveIndicator()
showActiveIndicator in interface AbilityPluginshowActiveIndicator in class BaseAbilityPluginpublic void pressButton()
AbilityPluginpressButton in interface AbilityPluginpressButton in class BaseAbilityPluginpublic void activate()
AbilityPluginactivate in interface AbilityPluginactivate in class BaseAbilityPluginpublic void deactivate()
AbilityPlugindeactivate in interface AbilityPlugindeactivate in class BaseAbilityPluginpublic void cleanup()
AbilityPlugincleanup in interface AbilityPlugincleanup in class BaseAbilityPluginpublic boolean isActive()
AbilityPluginisActive in interface AbilityPluginisActive in class BaseAbilityPluginpublic boolean hasCustomButtonPressSounds()
hasCustomButtonPressSounds in interface AbilityPluginhasCustomButtonPressSounds in class BaseAbilityPluginpublic boolean runWhilePaused()
runWhilePaused in interface EveryFrameScriptrunWhilePaused in class BaseAbilityPluginpublic float getLevel()
getLevel in interface AbilityPlugingetLevel in class BaseAbilityPlugin