Interface AbilityPlugin

All Known Implementing Classes:
BaseAbilityPlugin, BaseDurationAbility, BaseToggleAbility, DistressCallAbility, DurationAbilityWithCost2, EmergencyBurnAbility, FractureJumpAbility, GenerateSlipsurgeAbility, GoDarkAbility, GraviticScanAbility, InterdictionPulseAbility, RemoteSurveyAbility, ReversePolarityToggle, ScavengeAbility, SensorBurstAbility, SustainedBurnAbility, ToggleAbilityWithCost, TransponderAbility

public interface AbilityPlugin
  • Method Details

    • init

      void init(String id, SectorEntityToken entity)
    • pressButton

      void pressButton()
      Called from the UI when the button for this ability is pressed. Should not be called by the AI for other ability-using fleets, for example.
    • activate

      void activate()
      Programmatic way to activate the ability. Expected behavior: if (!isActiveOrInProgress()) { }
    • deactivate

      void deactivate()
      Toggleable or interruptable abilities should implement this method so that other abilities may turn them off or interrupt them if needed. Expected behavior: if (isActiveOrInProgress()) { }
    • cleanup

      void cleanup()
      After this method is called, it should be possible to remove the ability from the entity without any after-effects.
    • showActiveIndicator

      boolean showActiveIndicator()
    • showProgressIndicator

      boolean showProgressIndicator()
    • showCooldownIndicator

      boolean showCooldownIndicator()
    • isUsable

      boolean isUsable()
      Whether the ability can be activated / the UI button corresponding to it is enabled.
      Returns:
    • isActive

      boolean isActive()
      Whether a toggle-style ability is turned on. Duration abilities will always return false here; use isInProgress() to get their status.
      Returns:
    • isInProgress

      boolean isInProgress()
    • isOnCooldown

      boolean isOnCooldown()
    • isActiveOrInProgress

      boolean isActiveOrInProgress()
      Should return (isActive() || getProgressFraction() > 0).
      Returns:
    • getCooldownFraction

      float getCooldownFraction()
      0 at start of cooldown, 1 at end.
      Returns:
    • getProgressFraction

      float getProgressFraction()
      0 at start of progress, 1 at end.
      Returns:
    • getProgressColor

      Color getProgressColor()
    • getActiveColor

      Color getActiveColor()
    • getCooldownColor

      Color getCooldownColor()
    • isCooldownRenderingAdditive

      boolean isCooldownRenderingAdditive()
    • hasCustomButtonPressSounds

      boolean hasCustomButtonPressSounds()
    • getSpriteName

      String getSpriteName()
    • getEntity

      SectorEntityToken getEntity()
    • getId

      String getId()
    • createTooltip

      void createTooltip(TooltipMakerAPI tooltip, boolean expanded)
      Will be called every frame the tooltip is shown, so the tooltip can be dynamic.
      Parameters:
      tooltip -
      expanded -
    • hasTooltip

      boolean hasTooltip()
    • isTooltipExpandable

      boolean isTooltipExpandable()
    • getTooltipWidth

      float getTooltipWidth()
    • forceDisable

      void forceDisable()
      Make this ability unusable for 1-2 frames after this call.
    • fleetJoinedBattle

      void fleetJoinedBattle(BattleAPI battle)
    • fleetLeftBattle

      void fleetLeftBattle(BattleAPI battle, boolean engagedInHostilities)
    • fleetOpenedMarket

      void fleetOpenedMarket(MarketAPI market)
      Only called for the player fleet.
      Parameters:
      market -
    • getSpec

      AbilitySpecAPI getSpec()
    • render

      void render(CampaignEngineLayers layer, ViewportAPI viewport)
    • getActiveLayers

      EnumSet<CampaignEngineLayers> getActiveLayers()
    • setCooldownLeft

      void setCooldownLeft(float days)
    • getCooldownLeft

      float getCooldownLeft()
    • getLevel

      float getLevel()