Skip to content
Version 2.11.0
↓ Get the launcher

ImagineCooldownCalc class

Shared cooldown math for Battle-Imagine (and any multi-charge) skills, used by both the CooldownBar and the CombatMeter so their timing can’t drift. Two parts:

  • EffectiveDuration — the real per-charge recharge: the wire duration (or valid_cd_time) reduced by cooldown reduction (every player has a flat ~10% default; gear/buffs add the cooldown-acceleration attrs 11960 skill / 11980 imagine). Haste (atk/cast speed) does NOT affect this.
  • Update — a sequential-recharge simulator. The wire moves begin only ON CAST and never reports a live charge count, and after the first charge’s window expires it says nothing about the remaining charges still recharging. So we simulate: each cast (begin advances) spends one charge and re-anchors the soonest-charge window; charges then return one per perCharge; time-to-full counts down continuously.

One instance per consumer (it holds per-key recharge state). Unity-free and pure → unit-testable.

public sealed class ImagineCooldownCalc
name description
ImagineCooldownCalc() The default constructor.
Update(…) Advance the simulated recharge for key (the base skill id) and return the current state.
static EffectiveDuration(…) Effective per-charge recharge in ms: (validCdMs > 0 ? validCdMs : durMs) × (1 − cdReductionFraction).
struct Recharge Result of Update for one key this tick.