Counter - ennvina/spellactivationoverlay GitHub Wiki

A counter is an ability that is usable only under certain condition. Counters always have a glowing button and sometimes have an overlay.

Triggers

There are three types of triggers:

  • in reaction to an attack that landed, or did not land, such as Warrior's Overpower
  • when an enemy target has low health, such as Warrior's Execute or Paladin's Hammer of Wrath
  • when an ability goes off cooldown, such as Paladin's Divine Storm

Anticipation

The simplest form of counter is making a button glow when the ability is usable.

But sometimes, a player may want to know that the ability could be usable after something unrelated to the trigger itself. For example, when a target dodges a Warrior attack, the Warrior is allowed to cast Overpower, but only in Battle Stance. In this case, some Warriors might want to know the ability is usable even if they are not in Battle Stance. At this very moment, the Warrior cannot cast Overpower, but it "only" requires switching stance.

For this reason, some counters do not exclusively rely on the immediate availability of their respective ability. Rather, they can rely on their potential availability. It is common to provide an option for such counters, to either glow the button when it really is available now, or to make it glow when the main trigger happened.

Combat-only

Counters that are based only on their cooldown are available even when the player goes idle. Such button would glow 24/7 when commuting, resting in a capital city, etc.

To prevent this permanent glow, a counter tagged as combat-only is designed to quickly fade out after combat:

  1. while the player is in combat, the button glows
  2. when the player casts the ability, it goes on cooldown, so the button stops glowing
  3. when the cooldown timer ends while still in combat, the button glows again
  4. if the players leaves combat without re-using the ability, the button stops glowing after a few seconds
  5. when the player re-enters combat later on, the button glows again

Also, if the player left combat while the ability was on cooldown, and the cooldown ends when out of combat, the button will glow shortly to tell the player that the ability is back again.