public abstract class BaseDurationAbility extends BaseAbilityPlugin
| Modifier and Type | Field and Description |
|---|---|
protected float |
activeDaysLeft |
protected float |
cooldownLeft |
protected boolean |
fadingOut |
protected float |
level |
static float |
LOOP_FADE_TIME_DAYS |
protected float |
loopFadeLeft |
protected boolean |
turnedOn |
disableFrames, entity, id, PLAY_UI_SOUNDS_IN_WORLD_SOURCES, spec| Constructor and Description |
|---|
BaseDurationAbility() |
| 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 |
getActivationDays() |
float |
getActiveDaysLeft() |
float |
getCooldownDays() |
float |
getCooldownFraction()
0 at start of cooldown, 1 at end.
|
float |
getCooldownLeft() |
float |
getDeactivationDays() |
float |
getDurationDays() |
float |
getLevel() |
float |
getLoopSoundUIPitch() |
float |
getLoopSoundUIVolume() |
float |
getLoopSoundWorldPitch() |
float |
getLoopSoundWorldVolume() |
float |
getProgressFraction()
0 at start of progress, 1 at end.
|
float |
getTotalDurationDays() |
boolean |
hasCustomButtonPressSounds() |
boolean |
isActive()
Whether a toggle-style ability is turned on.
|
boolean |
isFadingOut() |
boolean |
isInProgress() |
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 |
setActiveDaysLeft(float activeDaysLeft) |
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, isOnCooldown, isTooltipExpandable, readResolve, render, showCooldownIndicatorpublic static final float LOOP_FADE_TIME_DAYS
protected boolean turnedOn
protected float activeDaysLeft
protected float cooldownLeft
protected float level
protected float loopFadeLeft
protected boolean fadingOut
public BaseDurationAbility()
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 getCooldownDays()
public float getDurationDays()
public float getTotalDurationDays()
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 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 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 boolean isUsable()
AbilityPluginisUsable in interface AbilityPluginisUsable 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 isInProgress()
isInProgress in interface AbilityPluginisInProgress in class BaseAbilityPluginpublic boolean hasCustomButtonPressSounds()
hasCustomButtonPressSounds in interface AbilityPluginhasCustomButtonPressSounds in class BaseAbilityPluginpublic boolean runWhilePaused()
runWhilePaused in interface EveryFrameScriptrunWhilePaused in class BaseAbilityPluginpublic float getActiveDaysLeft()
public void setActiveDaysLeft(float activeDaysLeft)
public float getCooldownLeft()
getCooldownLeft in interface AbilityPlugingetCooldownLeft in class BaseAbilityPluginpublic void setCooldownLeft(float cooldownLeft)
setCooldownLeft in interface AbilityPluginsetCooldownLeft in class BaseAbilityPluginpublic boolean isFadingOut()
public float getLevel()
getLevel in interface AbilityPlugingetLevel in class BaseAbilityPlugin