Update Healer Man server

This commit is contained in:
phenom committed 2026-09-28 22:46:45 -04:00
1 parent 9d7e0e2f9e
commit 35dfdaed61
94 files changed
+17034 -418

No files matched your search

+68
View File
@@ -124,6 +124,43 @@ describe("combat auras", () => {
expect(result.auras[0].absorbs.map((absorb) => absorb.remaining)).toEqual([0, 0]);
});
it("supports fractional, multi-school absorbs while keeping the capacity shared", () => {
const auras = apply(buff({
id: "anti-magic-shell",
absorbs: [{
id: "shell",
amount: 120,
schools: ["holy", "fire", "nature", "frost", "shadow", "arcane"],
fraction: 0.75,
}],
}));
const magical = absorbDamage(auras, {
targetId: "player",
amount: 100,
school: "fire",
now: 100,
});
expect(magical).toMatchObject({ absorbed: 75, remainingDamage: 25 });
expect(magical.auras[0].absorbs[0].remaining).toBe(45);
const physical = absorbDamage(magical.auras, {
targetId: "player",
amount: 40,
school: "physical",
now: 200,
});
expect(physical).toMatchObject({ absorbed: 0, remainingDamage: 40 });
expect(physical.auras[0].absorbs[0].remaining).toBe(45);
const capped = absorbDamage(magical.auras, {
targetId: "player",
amount: 100,
school: "shadow",
now: 300,
});
expect(capped).toMatchObject({ absorbed: 45, remainingDamage: 55 });
});
it("supports guaranteed and failed deterministic proc rolls", () => {
const definition = buff({
procs: [{
@@ -149,6 +186,37 @@ describe("combat auras", () => {
expect(failed.triggered).toHaveLength(0);
});
it("spends melee-only proc charges only on landed melee attack events", () => {
const auras = apply(buff({
procs: [{
id: "melee-charge",
triggers: ["hit", "crit"],
attackKinds: ["melee"],
chance: 1,
charges: 5,
action: { kind: "custom", id: "melee-only" },
}],
}));
const rangedHit = evaluateAuraProcs(auras, {
trigger: "hit",
subjectId: "player",
otherId: "mob",
attackKind: "ranged",
}, 100, () => 0);
expect(rangedHit.triggered).toHaveLength(0);
expect(rangedHit.auras[0].procStates[0].remainingCharges).toBe(5);
const meleeHit = evaluateAuraProcs(rangedHit.auras, {
trigger: "hit",
subjectId: "player",
otherId: "mob",
attackKind: "melee",
}, 200, () => 0);
expect(meleeHit.triggered).toHaveLength(1);
expect(meleeHit.auras[0].procStates[0].remainingCharges).toBe(4);
});
it("enforces proc internal cooldowns and consumes charges only on success", () => {
const roll = vi.fn(() => 0);
const definition = buff({