Update class mechanics, stat rulesets, and CoA reference catalogs

This commit is contained in:
phenom committed 2026-10-04 12:56:30 -04:00
1 parent b16821e92e
commit 39458d5de6
221 files changed
+2584962 -568

No files matched your search

@@ -0,0 +1,49 @@
import { describe, expect, it } from "vitest";
import {
ROM_KNIGHT_PANTHERS_BLESSING_SPELL_ID,
romKnightPanthersBlessingRestoreOnDodge,
} from "./romKnightPanthersBlessingRuntime";
const valid = {
classId: "rom-knight",
secondaryClassId: "rom-rogue",
learnedPassiveSpellIds: [ROM_KNIGHT_PANTHERS_BLESSING_SPELL_ID],
dodged: true,
ownerAlive: true,
maximumHealth: 1_255,
currentHealth: 1_000,
maximumMana: 75,
currentMana: 74,
} as const;
describe("current CoA Knight/Rogue Panther's Blessing", () => {
it("restores rounded percentages from the owner's own maximum pools and caps each pool", () => {
expect(romKnightPanthersBlessingRestoreOnDodge(valid)).toEqual({
requestedHealth: 126,
restoredHealth: 126,
requestedMana: 1,
restoredMana: 1,
});
expect(romKnightPanthersBlessingRestoreOnDodge({
...valid,
currentHealth: 1_230,
currentMana: 75,
})).toEqual({
requestedHealth: 126,
restoredHealth: 25,
requestedMana: 1,
restoredMana: 0,
});
});
it.each([
["wrong primary class", { classId: "rom-rogue" }],
["wrong secondary class", { secondaryClassId: "rom-warrior" }],
["passive not learned", { learnedPassiveSpellIds: [] }],
["no dodge result", { dodged: false }],
["owner is not alive", { ownerAlive: false }],
] as const)("does not trigger for %s", (_label, override) => {
expect(romKnightPanthersBlessingRestoreOnDodge({ ...valid, ...override })).toBeNull();
});
});