Class ToggleAbilityWithCost

All Implemented Interfaces:
AbilityPlugin, EveryFrameScript
Direct Known Subclasses:
ReversePolarityToggle

public class ToggleAbilityWithCost extends BaseToggleAbility
  • Constructor Details

    • ToggleAbilityWithCost

      public ToggleAbilityWithCost()
  • Method Details

    • getFuelCostMult

      public float getFuelCostMult(boolean forTooltip)
    • getCRCostMult

      public float getCRCostMult(boolean forTooltip)
    • getActivationAtLowCRShipDamageProbability

      public float getActivationAtLowCRShipDamageProbability(boolean forTooltip)
    • getActivationDamageLevel

      public Misc.FleetMemberDamageLevel getActivationDamageLevel(boolean forTooltip)
    • canRecoverCRWhileActive

      public boolean canRecoverCRWhileActive(boolean forTooltip)
    • shouldApplyCostWhenDeactivating

      public boolean shouldApplyCostWhenDeactivating(boolean forTooltip)
    • activateImpl

      protected void activateImpl()
      Specified by:
      activateImpl in class BaseToggleAbility
    • deductCost

      protected void deductCost()
    • applyStatsEffect

      protected void applyStatsEffect(float amount, float level)
    • unapplyStatsEffect

      protected void unapplyStatsEffect()
    • applyFleetVisual

      protected void applyFleetVisual(float amount, float level)
    • applyEffect

      protected void applyEffect(float amount, float level)
      Description copied from class: BaseToggleAbility
      Will be called once when level is 0 and consistently when level >0.
      Specified by:
      applyEffect in class BaseToggleAbility
    • deactivateImpl

      protected void deactivateImpl()
      Specified by:
      deactivateImpl in class BaseToggleAbility
    • cleanupImpl

      protected void cleanupImpl()
      Specified by:
      cleanupImpl in class BaseToggleAbility
    • getNonReadyShips

      protected List<FleetMemberAPI> getNonReadyShips(boolean forTooltip)
    • getCRCost

      public float getCRCost(FleetMemberAPI member, boolean forTooltip)
    • computeFuelCost

      protected float computeFuelCost(boolean forTooltip)
    • computeSupplyCost

      protected float computeSupplyCost(boolean forTooltip)
    • addOtherNotUsableReason

      public void addOtherNotUsableReason(TooltipMakerAPI tooltip, boolean expanded)
    • addCostTooltipSection

      public void addCostTooltipSection(TooltipMakerAPI tooltip, boolean expanded, String prefix)
    • hasTooltip

      public boolean hasTooltip()
      Specified by:
      hasTooltip in interface AbilityPlugin
      Overrides:
      hasTooltip in class BaseAbilityPlugin
    • isOnCooldown

      public boolean isOnCooldown()
      Specified by:
      isOnCooldown in interface AbilityPlugin
      Overrides:
      isOnCooldown in class BaseAbilityPlugin
    • isUsable

      public boolean isUsable()
      Description copied from interface: AbilityPlugin
      Whether the ability can be activated / the UI button corresponding to it is enabled.
      Specified by:
      isUsable in interface AbilityPlugin
      Overrides:
      isUsable in class BaseToggleAbility
      Returns:
    • showAlarm

      protected boolean showAlarm()
    • getCooldownFraction

      public float getCooldownFraction()
      Description copied from interface: AbilityPlugin
      0 at start of cooldown, 1 at end.
      Specified by:
      getCooldownFraction in interface AbilityPlugin
      Overrides:
      getCooldownFraction in class BaseToggleAbility
      Returns:
    • getCooldownColor

      public Color getCooldownColor()
      Specified by:
      getCooldownColor in interface AbilityPlugin
      Overrides:
      getCooldownColor in class BaseAbilityPlugin
    • isCooldownRenderingAdditive

      public boolean isCooldownRenderingAdditive()
      Specified by:
      isCooldownRenderingAdditive in interface AbilityPlugin
      Overrides:
      isCooldownRenderingAdditive in class BaseAbilityPlugin