Update Healer Man server
This commit is contained in:
1 parent
35dfdaed61
commit
4fb7a0b9c8
161 files changed
+24618
-529
No files matched your search
@@ -0,0 +1,88 @@
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import { applyAura } from "./combatAuras";
|
||||
import { PLAYER_AURA_ENTITY_ID, useCombatStore } from "./combatStore";
|
||||
import { usePartyStore } from "./partyStore";
|
||||
import { ROM_ALL_ABILITIES } from "./romAbilityCatalog";
|
||||
import { romEffectsForCast } from "./romCombatMechanics";
|
||||
|
||||
const righteousExplosion = ROM_ALL_ABILITIES.find((ability) => ability.dbcSpellId === 499836)!;
|
||||
const castContext = {
|
||||
sealStacks: 0,
|
||||
bleedCount: 0,
|
||||
charged: false,
|
||||
mainHandDagger: false,
|
||||
casterMaxHealth: 1_000,
|
||||
targetHealthPercent: 1,
|
||||
};
|
||||
|
||||
function finishCast(now: number) {
|
||||
const cast = useCombatStore.getState().activeCast;
|
||||
if (cast) useCombatStore.getState().tick((cast.completesAt - now) / 1_000 + 0.01, cast.completesAt);
|
||||
}
|
||||
|
||||
describe("RoM Champion/Priest Righteous Explosion", () => {
|
||||
beforeEach(() => {
|
||||
useCombatStore.setState({ auras: [], activeCast: null, combatEvents: [] });
|
||||
});
|
||||
|
||||
it("cleanses every modeled harmful category from the whole party", () => {
|
||||
const effects = romEffectsForCast(righteousExplosion, castContext);
|
||||
expect(effects).toContainEqual(expect.objectContaining({
|
||||
kind: "dispel",
|
||||
mode: "cleanse",
|
||||
relationship: "friendly",
|
||||
categories: ["magic", "curse", "poison", "disease", "enrage"],
|
||||
maxCount: 99,
|
||||
scope: "party",
|
||||
}));
|
||||
});
|
||||
|
||||
it("removes more than one harmful effect from each party member", () => {
|
||||
useCombatStore.getState().initializeCharacter({
|
||||
classId: "rom-champion", secondaryClassId: "rom-priest", raceId: "rom-dwarf", level: 70,
|
||||
});
|
||||
usePartyStore.getState().initializeParty(
|
||||
"rom-champion-priest-righteous-explosion", 70, useCombatStore.getState().health, "tank", 2, "rom",
|
||||
);
|
||||
|
||||
const memberIds = usePartyStore.getState().members.map((member) => member.id);
|
||||
let auras = useCombatStore.getState().auras;
|
||||
for (const targetId of [PLAYER_AURA_ENTITY_ID, ...memberIds]) {
|
||||
for (const [id, category] of [["magic", "magic"], ["curse", "curse"], ["enrage", "enrage"]] as const) {
|
||||
auras = applyAura(auras, {
|
||||
definition: {
|
||||
id: `righteous-explosion-${id}`,
|
||||
name: `Test ${id}`,
|
||||
disposition: "debuff",
|
||||
dispelCategory: category,
|
||||
durationMs: 30_000,
|
||||
},
|
||||
sourceId: "test:enemy",
|
||||
targetId,
|
||||
now: 1_000,
|
||||
}).auras;
|
||||
}
|
||||
auras = applyAura(auras, {
|
||||
definition: {
|
||||
id: "righteous-explosion-buff",
|
||||
name: "Unrelated buff",
|
||||
disposition: "buff",
|
||||
durationMs: 30_000,
|
||||
},
|
||||
sourceId: "test:ally",
|
||||
targetId,
|
||||
now: 1_000,
|
||||
}).auras;
|
||||
}
|
||||
useCombatStore.setState({ auras });
|
||||
|
||||
expect(useCombatStore.getState().castAbility(righteousExplosion.id, undefined, 1_000)).toMatchObject({ ok: true });
|
||||
finishCast(1_000);
|
||||
|
||||
const after = useCombatStore.getState().auras;
|
||||
for (const targetId of [PLAYER_AURA_ENTITY_ID, ...memberIds]) {
|
||||
expect(after.filter((aura) => aura.targetId === targetId && aura.definition.id.startsWith("righteous-explosion-"))
|
||||
.map((aura) => aura.definition.id)).toEqual(["righteous-explosion-buff"]);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user