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

62 lines
2.2 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { abilityById } from "./abilityCatalog";
import { applyAura, resolveDamageValue } from "./combatAuras";
describe("RoM Mage Fire Ward catalog behavior", () => {
it("retains RuneWaker's +10 Fire resistance and applies current CoA's all-magic reduction", () => {
const fireWard = abilityById("rom-mage-general-5");
expect(fireWard).toMatchObject({
dbcSpellId: 490_248,
target: "self",
castMode: "instant",
castTimeMs: 0,
cooldownMs: 0,
range: { min: 0, max: 15 },
radius: 10,
targeting: { shape: "circle", radius: 10 },
costs: [{ resource: "mana", amount: 120 }],
description: expect.stringContaining("+230 Fire resistance at skill level 105"),
});
expect(fireWard?.description).toContain("Fire resistance by 10 points");
expect(fireWard?.description).toContain("11.5%");
const auraEffect = fireWard?.effects.find((effect) => effect.kind === "apply-aura");
expect(auraEffect).toMatchObject({
kind: "apply-aura",
scope: "party",
radius: 10,
aura: { name: "Fire Ward: fire-resistance" },
});
if (!auraEffect || auraEffect.kind !== "apply-aura") throw new Error("Fire Ward aura missing");
expect(auraEffect.aura.durationMs).toBe(600_000);
expect(auraEffect.aura.modifiers).toContainEqual(expect.objectContaining({
kind: "stat",
stat: "resistance:fire",
operation: "flat",
value: 10,
}));
expect(auraEffect.aura.description).toContain("CoA lists +230 at skill level 105");
const auras = applyAura([], {
definition: auraEffect.aura,
sourceId: "fire-ward-mage",
targetId: "fire-ward-recipient",
now: 1_000,
}).auras;
const magicalSchools = ["arcane", "fire", "frost", "holy", "nature", "shadow"] as const;
for (const school of magicalSchools) {
expect(resolveDamageValue(100, auras, {
direction: "taken",
school,
attackKind: "spell",
})).toBeCloseTo(88.5);
}
expect(resolveDamageValue(100, auras, {
direction: "taken",
school: "physical",
attackKind: "melee",
})).toBe(100);
});
});