Files
healer-man/src/game/wow335ShamanLightningOverloadRuntime.test.ts
T
2026-10-02 10:38:12 -04:00

39 lines
2.2 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
wow335ShamanLightningOverloadDamageAmount,
wow335ShamanLightningOverloadProfileForRank,
wow335ShamanLightningOverloadShouldProc,
} from "./wow335ShamanLightningOverloadRuntime";
describe("WoW Shaman Lightning Overload", () => {
it("reads rank chance from the generated talent and models half damage with no threat", () => {
expect(wow335ShamanLightningOverloadProfileForRank(0)).toBeNull();
expect(wow335ShamanLightningOverloadProfileForRank(1)).toMatchObject({
procChancePercent: 7,
criticalProcChancePercent: 21,
damageMultiplier: 0.5,
threatScale: 0,
});
expect(wow335ShamanLightningOverloadProfileForRank(2)?.procChancePercent).toBe(14);
expect(wow335ShamanLightningOverloadProfileForRank(3)).toMatchObject({
procChancePercent: 20,
criticalProcChancePercent: 60,
eligibleAbilityNames: ["Lightning Bolt", "Chain Lightning"],
});
expect(wow335ShamanLightningOverloadDamageAmount(101)).toBe(51);
expect(wow335ShamanLightningOverloadDamageAmount(-1)).toBe(0);
});
it("requires a landed direct Lightning Bolt or Chain Lightning hit and triples only critical-hit chance", () => {
const rankOne = wow335ShamanLightningOverloadProfileForRank(1);
expect(wow335ShamanLightningOverloadShouldProc(rankOne, "Lightning Bolt", true, false, false, 0.069)).toBe(true);
expect(wow335ShamanLightningOverloadShouldProc(rankOne, "Lightning Bolt", true, false, false, 0.07)).toBe(false);
expect(wow335ShamanLightningOverloadShouldProc(rankOne, "Chain Lightning", true, true, false, 0.20)).toBe(true);
expect(wow335ShamanLightningOverloadShouldProc(rankOne, "Chain Lightning", true, true, false, 0.21)).toBe(false);
expect(wow335ShamanLightningOverloadShouldProc(rankOne, "Lava Burst", true, true, false, 0)).toBe(false);
expect(wow335ShamanLightningOverloadShouldProc(rankOne, "Lightning Bolt", false, true, false, 0)).toBe(false);
expect(wow335ShamanLightningOverloadShouldProc(rankOne, "Lightning Bolt", true, true, true, 0)).toBe(false);
expect(wow335ShamanLightningOverloadShouldProc(rankOne, "Lightning Bolt", true, true, false, 1)).toBe(false);
});
});