forked from phenom/healer-man
Update Healer Man server
This commit is contained in:
1 parent
39458d5de6
commit
6cc1b9217f
203 files changed
+133929
-31271
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import { useCombatStore, PLAYER_AURA_ENTITY_ID } from "./combatStore";
|
||||
import { clearMobRuntimeRegistry, setMobPosition } from "./mobRuntimeRegistry";
|
||||
import { clearPartyRuntimeRegistry } from "./partyRuntimeRegistry";
|
||||
import { usePartyStore } from "./partyStore";
|
||||
import { ROM_FIVE_IDENTITIES } from "./romFiveIdentities";
|
||||
import { deriveCharacterStats } from "./wotlkStats";
|
||||
import { nativeDamageCasterAmount } from "./romNativeCombatAmount";
|
||||
|
||||
describe("source ordinal damage in an actual native player cast", () => {
|
||||
beforeEach(() => {
|
||||
clearMobRuntimeRegistry();
|
||||
clearPartyRuntimeRegistry();
|
||||
const identity = ROM_FIVE_IDENTITIES.find((entry) => entry.classId === "rom-scout")!;
|
||||
useCombatStore.getState().initializeCharacter({ ...identity, level: 80, statRuleset: "rom" });
|
||||
useCombatStore.getState().setPlayerPosition([0, 0, 0]);
|
||||
usePartyStore.setState({ members: [] });
|
||||
// Isolate ordinal power from learned generic ranged-damage auras.
|
||||
useCombatStore.setState({ auras: [], combatEvents: [] });
|
||||
});
|
||||
|
||||
it("applies Reflected Shot source falloff once to the three enumerated recipients", () => {
|
||||
const before = useCombatStore.getState();
|
||||
const ability = before.abilities.find((entry) => entry.name === "Reflected Shot")!;
|
||||
expect(ability).toBeDefined();
|
||||
const effect = ability.effects.find((entry) => entry.kind === "damage")!;
|
||||
const native = deriveCharacterStats(before.classId, before.level, before.gearStats,
|
||||
before.raceId, {}, before.secondaryClassId, before.gender, before.statRuleset).romNative!;
|
||||
for (let index = 0; index < 3; index += 1) {
|
||||
const id = `native-ordinal-${index}`;
|
||||
before.registerMob(id, { name: id, level: 80, maxHealth: 10_000_000, xpReward: 0 });
|
||||
setMobPosition(id, [2 + index, 0, 0]);
|
||||
}
|
||||
before.selectMob("native-ordinal-0");
|
||||
const cast = useCombatStore.getState().castAbility(ability.id, undefined, 1_000);
|
||||
expect(cast.ok, cast.reason).toBe(true);
|
||||
const events = useCombatStore.getState().combatEvents.filter((event) =>
|
||||
event.kind === "damage" && event.sourceActorId === PLAYER_AURA_ENTITY_ID
|
||||
&& event.abilityId === ability.id);
|
||||
expect(events).toHaveLength(3);
|
||||
for (const [targetOrdinal, event] of events.entries()) {
|
||||
const sourcePower = nativeDamageCasterAmount(effect, 80, native, { targetCount: 3, targetOrdinal });
|
||||
expect(sourcePower).not.toBeNull();
|
||||
expect(event.rawAmount).toBe(Math.round(sourcePower!));
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user