Files
healer-man/src/game/wow335PriestFocusedWillRuntime.ts
T
2026-09-30 09:57:13 -04:00

65 lines
2.3 KiB
TypeScript

import type { AuraDefinition } from "./combatAuras";
export const WOW335_PRIEST_FOCUSED_WILL_TALENT_ID = "talent-1858";
export const WOW335_PRIEST_FOCUSED_WILL_AURA_ID = "wow335:priest:focused-will";
export const WOW335_PRIEST_FOCUSED_WILL_AURA_TAG = "wow335-priest-focused-will";
export const WOW335_PRIEST_FOCUSED_WILL_DURATION_MS = 10_000;
export const WOW335_PRIEST_FOCUSED_WILL_MAX_STACKS = 3;
const SPELL_CRITICAL_CHANCE_BONUS_BY_RANK = [0, 1, 2, 3] as const;
const HEALING_TAKEN_BONUS_PER_STACK = 0.03;
export interface Wow335PriestFocusedWillProfile {
readonly rank: number;
readonly spellCriticalChanceBonusPercent: number;
readonly healingTakenBonusPerStack: number;
readonly durationMs: number;
readonly maxStacks: number;
}
function normalizedRank(rank: number): number {
return Number.isFinite(rank) ? Math.max(0, Math.min(3, Math.trunc(rank))) : 0;
}
/** Local generated rank tooltip: +1/2/3% spell crit, plus the 3%-per-stack capstone. */
export function wow335PriestFocusedWillProfile(rank: number): Wow335PriestFocusedWillProfile {
const learnedRank = normalizedRank(rank);
return {
rank: learnedRank,
spellCriticalChanceBonusPercent: SPELL_CRITICAL_CHANCE_BONUS_BY_RANK[learnedRank] ?? 0,
healingTakenBonusPerStack: learnedRank > 0 ? HEALING_TAKEN_BONUS_PER_STACK : 0,
durationMs: learnedRank > 0 ? WOW335_PRIEST_FOCUSED_WILL_DURATION_MS : 0,
maxStacks: learnedRank > 0 ? WOW335_PRIEST_FOCUSED_WILL_MAX_STACKS : 0,
};
}
/** Focused Will procs only from a landed incoming critical hit while learned. */
export function wow335PriestFocusedWillShouldProc(
rank: number,
landed: boolean,
critical: boolean,
): boolean {
return normalizedRank(rank) > 0 && landed && critical;
}
export function wow335PriestFocusedWillAuraDefinition(rank: number): AuraDefinition | null {
const profile = wow335PriestFocusedWillProfile(rank);
if (profile.rank <= 0) return null;
return {
id: WOW335_PRIEST_FOCUSED_WILL_AURA_ID,
name: "Focused Will",
disposition: "buff",
durationMs: profile.durationMs,
maxStacks: profile.maxStacks,
stackBehavior: "add",
utilityTags: [WOW335_PRIEST_FOCUSED_WILL_AURA_TAG],
modifiers: [{
kind: "healing",
direction: "taken",
operation: "percent",
value: profile.healingTakenBonusPerStack,
perStack: true,
}],
};
}