Update Healer Man server
This commit is contained in:
1 parent
4c768fbec6
commit
b16821e92e
330 files changed
+35406
-1760
No files matched your search
@@ -0,0 +1,55 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { abilityAtLevel } from "./abilityCatalog";
|
||||
import { WOW335_ABILITIES_BY_CLASS } from "./wow335AbilityCatalog";
|
||||
import {
|
||||
wow335ShamanImprovedShieldOrbAmount,
|
||||
wow335ShamanImprovedShieldOrbBonusPercent,
|
||||
} from "./wow335ShamanImprovedShieldsRuntime";
|
||||
|
||||
function shieldProc(name: string, suffix: string) {
|
||||
const ability = WOW335_ABILITIES_BY_CLASS.shaman.find((candidate) => candidate.name === name);
|
||||
expect(ability, `Shaman ${name}`).toBeDefined();
|
||||
const ranked = abilityAtLevel(ability!, 80);
|
||||
const proc = ranked.effects
|
||||
.filter((effect) => effect.kind === "apply-aura")
|
||||
.flatMap((effect) => effect.aura.procs ?? [])
|
||||
.find((candidate) => candidate.id.endsWith(suffix));
|
||||
expect(proc, `${name} ${suffix} proc`).toBeDefined();
|
||||
return proc!;
|
||||
}
|
||||
|
||||
describe("WoW Shaman Improved Shields orb bonuses", () => {
|
||||
it.each([
|
||||
["lightning-shield", false, [0, 20, 40, 60]],
|
||||
["lightning-shield", true, [0, 10, 20, 30]],
|
||||
["earth-shield", false, [0, 5, 10, 15]],
|
||||
["earth-shield", true, [0, 5, 10, 15]],
|
||||
] as const)("uses generated %s rank bonuses against playerTarget=%s", (kind, isPlayerTarget, expected) => {
|
||||
expect([0, 1, 2, 3].map((rank) => (
|
||||
wow335ShamanImprovedShieldOrbBonusPercent(kind, rank, isPlayerTarget)
|
||||
))).toEqual(expected);
|
||||
});
|
||||
|
||||
it("scales the local Lightning Shield damage and Earth Shield healing proc payloads", () => {
|
||||
const lightning = shieldProc("Lightning Shield", ":lightning-shield");
|
||||
const earth = shieldProc("Earth Shield", ":earth-shield");
|
||||
expect(lightning.action.kind).toBe("damage");
|
||||
expect(earth.action.kind).toBe("heal");
|
||||
if (lightning.action.kind !== "damage" || earth.action.kind !== "heal") return;
|
||||
|
||||
expect(wow335ShamanImprovedShieldOrbAmount(lightning.action.amount, "lightning-shield", 3))
|
||||
.toBe(Math.round(lightning.action.amount * 1.6));
|
||||
expect(wow335ShamanImprovedShieldOrbAmount(lightning.action.amount, "lightning-shield", 3, true))
|
||||
.toBe(Math.round(lightning.action.amount * 1.3));
|
||||
expect(wow335ShamanImprovedShieldOrbAmount(earth.action.amount, "earth-shield", 3))
|
||||
.toBe(Math.round(earth.action.amount * 1.15));
|
||||
});
|
||||
|
||||
it("treats missing/invalid ranks and invalid amounts safely", () => {
|
||||
expect(wow335ShamanImprovedShieldOrbBonusPercent("lightning-shield", Number.NaN)).toBe(0);
|
||||
expect(wow335ShamanImprovedShieldOrbBonusPercent("earth-shield", Number.POSITIVE_INFINITY)).toBe(0);
|
||||
expect(wow335ShamanImprovedShieldOrbBonusPercent("lightning-shield", 99)).toBe(60);
|
||||
expect(wow335ShamanImprovedShieldOrbAmount(100, "earth-shield", -1)).toBe(100);
|
||||
expect(wow335ShamanImprovedShieldOrbAmount(Number.NaN, "earth-shield", 3)).toBe(0);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user