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, showCooldownIndicator
public 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 float getLoopSoundUIVolume()
getLoopSoundUIVolume
in class BaseAbilityPlugin
public float getLoopSoundUIPitch()
getLoopSoundUIPitch
in class BaseAbilityPlugin
public float getLoopSoundWorldVolume()
getLoopSoundWorldVolume
in class BaseAbilityPlugin
public float getLoopSoundWorldPitch()
getLoopSoundWorldPitch
in class BaseAbilityPlugin
public 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)
EveryFrameScript
advance
in interface EveryFrameScript
advance
in class BaseAbilityPlugin
amount
- seconds elapsed during the last frame.protected void addIncompatibleToTooltip(TooltipMakerAPI tooltip, boolean expanded)
public float getCooldownFraction()
AbilityPlugin
getCooldownFraction
in interface AbilityPlugin
getCooldownFraction
in class BaseAbilityPlugin
public float getProgressFraction()
AbilityPlugin
getProgressFraction
in interface AbilityPlugin
getProgressFraction
in class BaseAbilityPlugin
public boolean showProgressIndicator()
showProgressIndicator
in interface AbilityPlugin
showProgressIndicator
in class BaseAbilityPlugin
public boolean showActiveIndicator()
showActiveIndicator
in interface AbilityPlugin
showActiveIndicator
in class BaseAbilityPlugin
public boolean isUsable()
AbilityPlugin
isUsable
in interface AbilityPlugin
isUsable
in class BaseAbilityPlugin
public void pressButton()
AbilityPlugin
pressButton
in interface AbilityPlugin
pressButton
in class BaseAbilityPlugin
public void activate()
AbilityPlugin
activate
in interface AbilityPlugin
activate
in class BaseAbilityPlugin
public void deactivate()
AbilityPlugin
deactivate
in interface AbilityPlugin
deactivate
in class BaseAbilityPlugin
public void cleanup()
AbilityPlugin
cleanup
in interface AbilityPlugin
cleanup
in class BaseAbilityPlugin
public boolean isActive()
AbilityPlugin
isActive
in interface AbilityPlugin
isActive
in class BaseAbilityPlugin
public boolean isInProgress()
isInProgress
in interface AbilityPlugin
isInProgress
in class BaseAbilityPlugin
public boolean hasCustomButtonPressSounds()
hasCustomButtonPressSounds
in interface AbilityPlugin
hasCustomButtonPressSounds
in class BaseAbilityPlugin
public boolean runWhilePaused()
runWhilePaused
in interface EveryFrameScript
runWhilePaused
in class BaseAbilityPlugin
public float getActiveDaysLeft()
public void setActiveDaysLeft(float activeDaysLeft)
public float getCooldownLeft()
getCooldownLeft
in interface AbilityPlugin
getCooldownLeft
in class BaseAbilityPlugin
public void setCooldownLeft(float cooldownLeft)
setCooldownLeft
in interface AbilityPlugin
setCooldownLeft
in class BaseAbilityPlugin
public boolean isFadingOut()
public float getLevel()
getLevel
in interface AbilityPlugin
getLevel
in class BaseAbilityPlugin
Copyright © 2013 Fractal Softworks, LLC. All Rights Reserved.