public interface AbilityPlugin
Modifier and Type | Method and Description |
---|---|
void |
activate()
Programmatic way to activate the ability.
|
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.
|
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.
|
java.awt.Color |
getActiveColor() |
java.util.EnumSet<CampaignEngineLayers> |
getActiveLayers() |
java.awt.Color |
getCooldownColor() |
float |
getCooldownFraction()
0 at start of cooldown, 1 at end.
|
float |
getCooldownLeft() |
SectorEntityToken |
getEntity() |
java.lang.String |
getId() |
float |
getLevel() |
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) |
boolean |
isActive()
Whether a toggle-style ability is turned on.
|
boolean |
isActiveOrInProgress()
Should return (isActive() || getProgressFraction() > 0).
|
boolean |
isCooldownRenderingAdditive() |
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.
|
void |
render(CampaignEngineLayers layer,
ViewportAPI viewport) |
void |
setCooldownLeft(float days) |
boolean |
showActiveIndicator() |
boolean |
showCooldownIndicator() |
boolean |
showProgressIndicator() |
void init(java.lang.String id, SectorEntityToken entity)
void pressButton()
void activate()
void deactivate()
void cleanup()
boolean showActiveIndicator()
boolean showProgressIndicator()
boolean showCooldownIndicator()
boolean isUsable()
boolean isActive()
boolean isInProgress()
boolean isOnCooldown()
boolean isActiveOrInProgress()
float getCooldownFraction()
float getProgressFraction()
java.awt.Color getProgressColor()
java.awt.Color getActiveColor()
java.awt.Color getCooldownColor()
boolean isCooldownRenderingAdditive()
boolean hasCustomButtonPressSounds()
java.lang.String getSpriteName()
SectorEntityToken getEntity()
java.lang.String getId()
void createTooltip(TooltipMakerAPI tooltip, boolean expanded)
tooltip
- expanded
- boolean hasTooltip()
boolean isTooltipExpandable()
float getTooltipWidth()
void forceDisable()
void fleetJoinedBattle(BattleAPI battle)
void fleetLeftBattle(BattleAPI battle, boolean engagedInHostilities)
void fleetOpenedMarket(MarketAPI market)
market
- AbilitySpecAPI getSpec()
void render(CampaignEngineLayers layer, ViewportAPI viewport)
java.util.EnumSet<CampaignEngineLayers> getActiveLayers()
void setCooldownLeft(float days)
float getCooldownLeft()
float getLevel()
Copyright © 2013 Fractal Softworks, LLC. All Rights Reserved.