35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
/** Current CoA Priest/Scout Saint's Blessing's conditional damage rider. */
|
|
export const ROM_PRIEST_SCOUT_SAINTS_BLESSING_DAMAGE = Object.freeze({
|
|
passiveSpellId: 493_039,
|
|
targetHealthThreshold: 0.3,
|
|
damageBonus: 0.28,
|
|
});
|
|
|
|
export interface RomPriestScoutSaintsBlessingDamageContext {
|
|
readonly primaryClassId: string;
|
|
readonly secondaryClassId?: string;
|
|
readonly learnedPassiveSpellIds: readonly number[];
|
|
/** Target's current health divided by its maximum health at damage resolution. */
|
|
readonly targetHealthPercent: number;
|
|
}
|
|
|
|
/**
|
|
* Return the current CoA multiplier for a damage packet resolved against a
|
|
* living target below 30% maximum health. The caller should evaluate this at
|
|
* each damage event so the threshold follows the target's live health.
|
|
*/
|
|
export function romPriestScoutSaintsBlessingDamageMultiplier(
|
|
context: RomPriestScoutSaintsBlessingDamageContext,
|
|
): number {
|
|
if (context.primaryClassId !== "rom-priest"
|
|
|| context.secondaryClassId !== "rom-scout"
|
|
|| !context.learnedPassiveSpellIds.includes(ROM_PRIEST_SCOUT_SAINTS_BLESSING_DAMAGE.passiveSpellId)
|
|
|| !Number.isFinite(context.targetHealthPercent)
|
|
|| context.targetHealthPercent <= 0
|
|
|| context.targetHealthPercent >= ROM_PRIEST_SCOUT_SAINTS_BLESSING_DAMAGE.targetHealthThreshold) {
|
|
return 1;
|
|
}
|
|
|
|
return 1 + ROM_PRIEST_SCOUT_SAINTS_BLESSING_DAMAGE.damageBonus;
|
|
}
|