Files
healer-man/src/game/cooldownReset.ts
T
2026-09-20 11:23:13 -04:00

19 lines
674 B
TypeScript

import type { AbilityDefinition } from "./abilityCatalog";
/**
* Resolves the abilities affected by a cooldown reset. An untargeted reset is
* the WoW "other abilities" form, so it must never make its source ability
* immediately available again.
*/
export function cooldownResetCandidates(
abilities: readonly AbilityDefinition[],
sourceAbilityId: string,
abilityName?: string,
): readonly AbilityDefinition[] {
if (abilityName) {
const normalizedName = abilityName.toLowerCase();
return abilities.filter((candidate) => candidate.name.toLowerCase() === normalizedName);
}
return abilities.filter((candidate) => candidate.id !== sourceAbilityId);
}