ChairmanAbility (Base)

Overview

Abstract base class for all abilities. Handles shared cooldown UI, gating via IsValid(), and exposes the abstract hooks ApplyEffect(), AbilityDescription(), and AbilityTitle().

Serialized Fields

  • IntVariable sharedAbilityCooldown — global cooldown counter shared by all abilities.
  • IntVariable lastAbilityCooldown — last cooldown duration; used to lerp the fill.
  • int abilityCooldown (default 60) — per-ability cooldown length.
  • Transform cooldownGraphic — its local Y is lerped from -130 (just used) to 0 (ready).
  • LeanButton abilityButton — interactable only when not cooling down and IsValid() returns true.

Behaviour

  • On tick, UpdateUI():
    • If sharedAbilityCooldown != 0, moves cooldownGraphic vertically and disables the button.
    • Otherwise, enables the button when IsValid() is true.

Methods for Implementors

public abstract void ApplyEffect();
public abstract string AbilityDescription();
public abstract string AbilityTitle();
protected virtual bool IsValid() => true;

Integration Notes

  • Wire sharedAbilityCooldown, lastAbilityCooldown, cooldownGraphic, and abilityButton in the ability prefab.
  • Cooldown visuals assume a vertical fill effect via cooldownGraphic translation.