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 BaseAbilityPlugin()
public void init(java.lang.String id, SectorEntityToken entity)
init in interface AbilityPluginprotected 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 AbilityPluginpublic java.lang.String getId()
getId in interface AbilityPluginpublic void advance(float amount)
EveryFrameScriptadvance in interface EveryFrameScriptamount - seconds elapsed during the last frame.public boolean isDone()
isDone in interface EveryFrameScriptpublic boolean runWhilePaused()
runWhilePaused in interface EveryFrameScriptpublic boolean showActiveIndicator()
showActiveIndicator in interface AbilityPluginpublic boolean isUsable()
AbilityPluginisUsable in interface AbilityPluginpublic void forceDisable()
AbilityPluginforceDisable in interface AbilityPluginpublic float getCooldownFraction()
AbilityPlugingetCooldownFraction in interface AbilityPluginpublic boolean hasCustomButtonPressSounds()
hasCustomButtonPressSounds in interface AbilityPluginpublic boolean hasTooltip()
hasTooltip in interface AbilityPluginpublic void createTooltip(TooltipMakerAPI tooltip, boolean expanded)
AbilityPlugincreateTooltip in interface AbilityPluginpublic boolean isTooltipExpandable()
isTooltipExpandable in interface AbilityPluginpublic float getTooltipWidth()
getTooltipWidth in interface AbilityPluginpublic void pressButton()
AbilityPluginpressButton in interface AbilityPluginpublic java.lang.String getSpriteName()
getSpriteName in interface AbilityPluginpublic void activate()
AbilityPluginactivate in interface AbilityPluginpublic void deactivate()
AbilityPlugindeactivate in interface AbilityPluginpublic java.awt.Color getCooldownColor()
getCooldownColor in interface AbilityPluginpublic java.awt.Color getProgressColor()
getProgressColor in interface AbilityPluginpublic java.awt.Color getActiveColor()
getActiveColor in interface AbilityPluginpublic float getProgressFraction()
AbilityPlugingetProgressFraction in interface AbilityPluginpublic boolean isActive()
AbilityPluginisActive in interface AbilityPluginpublic boolean isActiveOrInProgress()
AbilityPluginisActiveOrInProgress in interface AbilityPluginpublic boolean isInProgress()
isInProgress in interface AbilityPluginpublic boolean showCooldownIndicator()
showCooldownIndicator in interface AbilityPluginpublic boolean showProgressIndicator()
showProgressIndicator in interface AbilityPluginpublic boolean isOnCooldown()
isOnCooldown in interface AbilityPluginpublic void cleanup()
AbilityPlugincleanup in interface AbilityPluginpublic boolean isCooldownRenderingAdditive()
isCooldownRenderingAdditive in interface AbilityPluginpublic abstract void setCooldownLeft(float days)
setCooldownLeft in interface AbilityPluginpublic abstract float getCooldownLeft()
getCooldownLeft in interface AbilityPluginprotected java.lang.String getActivationText()
protected java.lang.String getDeactivationText()
public void fleetJoinedBattle(BattleAPI battle)
fleetJoinedBattle in interface AbilityPluginpublic void fleetLeftBattle(BattleAPI battle, boolean engagedInHostilities)
fleetLeftBattle in interface AbilityPluginpublic void fleetOpenedMarket(MarketAPI market)
AbilityPluginfleetOpenedMarket in interface AbilityPluginpublic AbilitySpecAPI getSpec()
getSpec in interface AbilityPluginpublic java.util.EnumSet<CampaignEngineLayers> getActiveLayers()
getActiveLayers in interface AbilityPluginpublic void render(CampaignEngineLayers layer, ViewportAPI viewport)
render in interface AbilityPluginpublic float getLevel()
getLevel in interface AbilityPlugin