public abstract class BaseAbilityPlugin extends java.lang.Object implements AbilityPlugin, EveryFrameScript
Modifier and Type | Field and Description |
---|---|
protected int |
disableFrames |
protected SectorEntityToken |
entity |
protected java.lang.String |
id |
static boolean |
PLAY_UI_SOUNDS_IN_WORLD_SOURCES |
protected AbilitySpecAPI |
spec |
Constructor and Description |
---|
BaseAbilityPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
activate()
Programmatic way to activate the ability.
|
protected void |
addIncompatibleToTooltip(TooltipMakerAPI tooltip,
java.lang.String desc,
java.lang.String descShort,
boolean expanded) |
void |
advance(float amount)
Use SectorAPI.getClock() to convert to campaign days.
|
void |
cleanup()
After this method is called, it should be possible to remove the ability
from the entity without any after-effects.
|
void |
createTooltip(TooltipMakerAPI tooltip,
boolean expanded)
Will be called every frame the tooltip is shown, so the tooltip can be dynamic.
|
void |
deactivate()
Toggleable or interruptable abilities should implement this method so
that other abilities may turn them off or interrupt them if needed.
|
protected void |
disableIncompatible() |
void |
fleetJoinedBattle(BattleAPI battle) |
void |
fleetLeftBattle(BattleAPI battle,
boolean engagedInHostilities) |
void |
fleetOpenedMarket(MarketAPI market)
Only called for the player fleet.
|
void |
forceDisable()
Make this ability unusable for 1-2 frames after this call.
|
protected java.lang.String |
getActivationText() |
java.awt.Color |
getActiveColor() |
java.util.EnumSet<CampaignEngineLayers> |
getActiveLayers() |
java.awt.Color |
getCooldownColor() |
float |
getCooldownFraction()
0 at start of cooldown, 1 at end.
|
abstract float |
getCooldownLeft() |
protected java.lang.String |
getDeactivationText() |
SectorEntityToken |
getEntity() |
CampaignFleetAPI |
getFleet() |
java.lang.String |
getId() |
java.util.List<AbilityPlugin> |
getInterruptedList() |
float |
getLevel() |
java.lang.String |
getLoopSoundUI() |
float |
getLoopSoundUIPitch() |
float |
getLoopSoundUIVolume() |
java.lang.String |
getLoopSoundWorld() |
float |
getLoopSoundWorldPitch() |
float |
getLoopSoundWorldVolume() |
java.lang.String |
getModId() |
java.lang.String |
getOffSoundUI() |
java.lang.String |
getOffSoundWorld() |
java.lang.String |
getOnSoundUI() |
java.lang.String |
getOnSoundWorld() |
java.awt.Color |
getProgressColor() |
float |
getProgressFraction()
0 at start of progress, 1 at end.
|
AbilitySpecAPI |
getSpec() |
java.lang.String |
getSpriteName() |
float |
getTooltipWidth() |
boolean |
hasCustomButtonPressSounds() |
boolean |
hasTooltip() |
void |
init(java.lang.String id,
SectorEntityToken entity) |
protected void |
interruptIncompatible() |
boolean |
isActive()
Whether a toggle-style ability is turned on.
|
boolean |
isActiveOrInProgress()
Should return (isActive() || getProgressFraction() > 0).
|
boolean |
isCompatible(AbilityPlugin other) |
boolean |
isCooldownRenderingAdditive() |
boolean |
isDone() |
boolean |
isInProgress() |
boolean |
isOnCooldown() |
boolean |
isTooltipExpandable() |
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.
|
protected java.lang.Object |
readResolve() |
void |
render(CampaignEngineLayers layer,
ViewportAPI viewport) |
boolean |
runWhilePaused() |
abstract void |
setCooldownLeft(float days) |
boolean |
showActiveIndicator() |
boolean |
showCooldownIndicator() |
boolean |
showProgressIndicator() |
public static boolean PLAY_UI_SOUNDS_IN_WORLD_SOURCES
protected SectorEntityToken entity
protected java.lang.String id
protected int disableFrames
protected transient AbilitySpecAPI spec
public void init(java.lang.String id, SectorEntityToken entity)
init
in interface AbilityPlugin
protected java.lang.Object readResolve()
public java.lang.String getOnSoundUI()
public java.lang.String getOnSoundWorld()
public java.lang.String getOffSoundUI()
public java.lang.String getOffSoundWorld()
public java.lang.String getLoopSoundUI()
public float getLoopSoundUIVolume()
public float getLoopSoundUIPitch()
public java.lang.String getLoopSoundWorld()
public float getLoopSoundWorldVolume()
public float getLoopSoundWorldPitch()
protected void interruptIncompatible()
protected void disableIncompatible()
public boolean isCompatible(AbilityPlugin other)
protected void addIncompatibleToTooltip(TooltipMakerAPI tooltip, java.lang.String desc, java.lang.String descShort, boolean expanded)
public java.util.List<AbilityPlugin> getInterruptedList()
public java.lang.String getModId()
public CampaignFleetAPI getFleet()
public SectorEntityToken getEntity()
getEntity
in interface AbilityPlugin
public java.lang.String getId()
getId
in interface AbilityPlugin
public void advance(float amount)
EveryFrameScript
advance
in interface EveryFrameScript
amount
- seconds elapsed during the last frame.public boolean isDone()
isDone
in interface EveryFrameScript
public boolean runWhilePaused()
runWhilePaused
in interface EveryFrameScript
public boolean showActiveIndicator()
showActiveIndicator
in interface AbilityPlugin
public boolean isUsable()
AbilityPlugin
isUsable
in interface AbilityPlugin
public void forceDisable()
AbilityPlugin
forceDisable
in interface AbilityPlugin
public float getCooldownFraction()
AbilityPlugin
getCooldownFraction
in interface AbilityPlugin
public boolean hasCustomButtonPressSounds()
hasCustomButtonPressSounds
in interface AbilityPlugin
public boolean hasTooltip()
hasTooltip
in interface AbilityPlugin
public void createTooltip(TooltipMakerAPI tooltip, boolean expanded)
AbilityPlugin
createTooltip
in interface AbilityPlugin
public boolean isTooltipExpandable()
isTooltipExpandable
in interface AbilityPlugin
public float getTooltipWidth()
getTooltipWidth
in interface AbilityPlugin
public void pressButton()
AbilityPlugin
pressButton
in interface AbilityPlugin
public java.lang.String getSpriteName()
getSpriteName
in interface AbilityPlugin
public void activate()
AbilityPlugin
activate
in interface AbilityPlugin
public void deactivate()
AbilityPlugin
deactivate
in interface AbilityPlugin
public java.awt.Color getCooldownColor()
getCooldownColor
in interface AbilityPlugin
public java.awt.Color getProgressColor()
getProgressColor
in interface AbilityPlugin
public java.awt.Color getActiveColor()
getActiveColor
in interface AbilityPlugin
public float getProgressFraction()
AbilityPlugin
getProgressFraction
in interface AbilityPlugin
public boolean isActive()
AbilityPlugin
isActive
in interface AbilityPlugin
public boolean isActiveOrInProgress()
AbilityPlugin
isActiveOrInProgress
in interface AbilityPlugin
public boolean isInProgress()
isInProgress
in interface AbilityPlugin
public boolean showCooldownIndicator()
showCooldownIndicator
in interface AbilityPlugin
public boolean showProgressIndicator()
showProgressIndicator
in interface AbilityPlugin
public boolean isOnCooldown()
isOnCooldown
in interface AbilityPlugin
public void cleanup()
AbilityPlugin
cleanup
in interface AbilityPlugin
public boolean isCooldownRenderingAdditive()
isCooldownRenderingAdditive
in interface AbilityPlugin
public abstract void setCooldownLeft(float days)
setCooldownLeft
in interface AbilityPlugin
public abstract float getCooldownLeft()
getCooldownLeft
in interface AbilityPlugin
protected java.lang.String getActivationText()
protected java.lang.String getDeactivationText()
public void fleetJoinedBattle(BattleAPI battle)
fleetJoinedBattle
in interface AbilityPlugin
public void fleetLeftBattle(BattleAPI battle, boolean engagedInHostilities)
fleetLeftBattle
in interface AbilityPlugin
public void fleetOpenedMarket(MarketAPI market)
AbilityPlugin
fleetOpenedMarket
in interface AbilityPlugin
public AbilitySpecAPI getSpec()
getSpec
in interface AbilityPlugin
public java.util.EnumSet<CampaignEngineLayers> getActiveLayers()
getActiveLayers
in interface AbilityPlugin
public void render(CampaignEngineLayers layer, ViewportAPI viewport)
render
in interface AbilityPlugin
public float getLevel()
getLevel
in interface AbilityPlugin
Copyright © 2013 Fractal Softworks, LLC. All Rights Reserved.