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 wireduration(orvalid_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 movesbeginonly 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 perperCharge; 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 ImagineCooldownCalcPublic Members
Section titled “Public Members”| 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. |
See Also
Section titled “See Also”- namespace Stellar.Abstractions.Domain.GameData