Update Healer Man server
This commit is contained in:
1 parent
4c768fbec6
commit
b16821e92e
330 files changed
+35406
-1760
No files matched your search
@@ -2,13 +2,13 @@ import { beforeEach, describe, expect, it } from "vitest";
|
||||
import { abilityById } from "./abilityCatalog";
|
||||
import { PLAYER_AGGRO_ID } from "./aggro";
|
||||
import { useCombatStore } from "./combatStore";
|
||||
import { clearMobRuntimeRegistry, setMobPosition } from "./mobRuntimeRegistry";
|
||||
import { clearMobRuntimeRegistry } from "./mobRuntimeRegistry";
|
||||
import { advanceDungeonPartyCombat, resetPartyRuntimeClock } from "./partyRuntime";
|
||||
import { clearPartyRuntimeRegistry, registerPartyRuntimePosition } from "./partyRuntimeRegistry";
|
||||
import { createConfiguredPartyMember, usePartyStore } from "./partyStore";
|
||||
import { ROM_PRIEST_MAGE_ENLIGHTENMENT } from "./romPriestMageRuntime";
|
||||
import { ROM_PRIEST_MAGE_ENLIGHTENMENT_PASSIVE_TAG } from "./romPriestMageRuntime";
|
||||
|
||||
const ACTIVE_TAG = "rom-priest-mage-enlightenment-active";
|
||||
const PASSIVE_TAG = ROM_PRIEST_MAGE_ENLIGHTENMENT_PASSIVE_TAG;
|
||||
|
||||
function initializePriestMage(): void {
|
||||
useCombatStore.getState().initializeCharacter({
|
||||
@@ -37,43 +37,31 @@ describe("RoM Priest/Mage Enlightenment integration", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("triggers only on completed Heal and respects the caster's 20-second cooldown", () => {
|
||||
it("activates as a permanent +12% Wisdom passive for the player", () => {
|
||||
const heal = abilityById("rom-priest-primary-2");
|
||||
const wrongSpell = abilityById("rom-priest-primary-4");
|
||||
const passive = abilityById("rom-priest-rom-mage-elite-40");
|
||||
if (!heal || !wrongSpell || !passive) throw new Error("Missing local Priest/Mage Enlightenment rows");
|
||||
expect([heal.dbcSpellId, wrongSpell.dbcSpellId, passive.dbcSpellId]).toEqual([490_261, 491_165, 492_933]);
|
||||
expect(passive.effects).toEqual([]);
|
||||
expect(aura(PLAYER_AGGRO_ID, ACTIVE_TAG, 1_000)).toBeUndefined();
|
||||
expect(aura(PLAYER_AGGRO_ID, ROM_PRIEST_MAGE_ENLIGHTENMENT.cooldownAuraTag, 1_000)).toBeUndefined();
|
||||
if (!heal || !passive) throw new Error("Missing local Priest/Mage Heal or Enlightenment rows");
|
||||
expect([heal.dbcSpellId, passive.dbcSpellId]).toEqual([490_261, 492_933]);
|
||||
expect(passive.passive).toBe(true);
|
||||
expect(passive.description).toBe("Passive: Increases Wisdom by 12%.");
|
||||
expect(passive.effects).toHaveLength(1);
|
||||
expect(passive.effects[0]).toMatchObject({
|
||||
kind: "apply-aura",
|
||||
aura: {
|
||||
durationMs: null,
|
||||
modifiers: [{ kind: "stat", stat: "wisdom", operation: "percent", value: 0.12 }],
|
||||
},
|
||||
});
|
||||
expect(aura(PLAYER_AGGRO_ID, PASSIVE_TAG, 1_000)?.expiresAt).toBeNull();
|
||||
|
||||
useCombatStore.getState().damagePlayer(100);
|
||||
expect(useCombatStore.getState().castAbility(heal.id, undefined, 1_000)).toMatchObject({ ok: true });
|
||||
useCombatStore.getState().tick(0.1, 3_100);
|
||||
expect(aura(PLAYER_AGGRO_ID, ACTIVE_TAG, 3_100)?.expiresAt).toBe(11_100);
|
||||
expect(aura(PLAYER_AGGRO_ID, ROM_PRIEST_MAGE_ENLIGHTENMENT.cooldownAuraTag, 3_100)?.expiresAt)
|
||||
.toBe(23_100);
|
||||
|
||||
useCombatStore.getState().registerMob("enlightenment-wrong-spell-target", {
|
||||
name: "Enlightenment wrong-spell target", maxHealth: 100_000, xpReward: 0,
|
||||
});
|
||||
setMobPosition("enlightenment-wrong-spell-target", [3, 0, 0]);
|
||||
useCombatStore.getState().selectMob("enlightenment-wrong-spell-target");
|
||||
expect(useCombatStore.getState().castAbility(wrongSpell.id, undefined, 5_000)).toMatchObject({ ok: true });
|
||||
expect(aura(PLAYER_AGGRO_ID, ACTIVE_TAG, 5_000)?.expiresAt).toBe(11_100);
|
||||
|
||||
expect(useCombatStore.getState().castAbility(heal.id, undefined, 7_000)).toMatchObject({ ok: true });
|
||||
useCombatStore.getState().tick(0.1, 9_100);
|
||||
expect(aura(PLAYER_AGGRO_ID, ACTIVE_TAG, 9_100)?.expiresAt).toBe(11_100);
|
||||
expect(aura(PLAYER_AGGRO_ID, ROM_PRIEST_MAGE_ENLIGHTENMENT.cooldownAuraTag, 9_100)?.expiresAt)
|
||||
.toBe(23_100);
|
||||
|
||||
expect(useCombatStore.getState().castAbility(heal.id, undefined, 24_000)).toMatchObject({ ok: true });
|
||||
useCombatStore.getState().tick(0.1, 26_100);
|
||||
expect(aura(PLAYER_AGGRO_ID, ACTIVE_TAG, 26_100)?.expiresAt).toBe(34_100);
|
||||
expect(aura(PLAYER_AGGRO_ID, PASSIVE_TAG, 3_100)?.expiresAt).toBeNull();
|
||||
expect(aura(PLAYER_AGGRO_ID, "rom-priest-mage-enlightenment-cooldown", 3_100)).toBeUndefined();
|
||||
});
|
||||
|
||||
it("triggers after a party Priest/Mage finishes Heal and keeps the aura on that caster", () => {
|
||||
it("activates as a permanent +12% Wisdom passive for a generated companion", () => {
|
||||
const seed = "priest-mage-enlightenment-party";
|
||||
const healer = createConfiguredPartyMember({
|
||||
name: "Enlightenment Priest",
|
||||
@@ -107,15 +95,15 @@ describe("RoM Priest/Mage Enlightenment integration", () => {
|
||||
}] });
|
||||
registerPartyRuntimePosition(healer.id, [0, 0, 0]);
|
||||
useCombatStore.getState().synchronizeActors();
|
||||
expect(passive.effects).toEqual([]);
|
||||
expect(aura(healer.id, ACTIVE_TAG, 1_000)).toBeUndefined();
|
||||
expect(passive.effects).toHaveLength(1);
|
||||
expect(aura(healer.id, PASSIVE_TAG, 1_000)).toBeUndefined();
|
||||
|
||||
advanceDungeonPartyCombat(2_500);
|
||||
|
||||
expect(useCombatStore.getState().combatEvents.some((event) => event.sourceActorId === healer.id
|
||||
&& event.abilityId === heal.id && event.kind === "healing")).toBe(true);
|
||||
expect(aura(healer.id, ACTIVE_TAG, 2_500)?.expiresAt).toBe(10_500);
|
||||
expect(aura(healer.id, ROM_PRIEST_MAGE_ENLIGHTENMENT.cooldownAuraTag, 2_500)?.expiresAt).toBe(22_500);
|
||||
expect(aura(PLAYER_AGGRO_ID, ACTIVE_TAG, 2_500)).toBeUndefined();
|
||||
expect(aura(healer.id, PASSIVE_TAG, 2_500)?.expiresAt).toBeNull();
|
||||
expect(aura(healer.id, "rom-priest-mage-enlightenment-cooldown", 2_500)).toBeUndefined();
|
||||
expect(aura(PLAYER_AGGRO_ID, PASSIVE_TAG, 2_500)?.expiresAt).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user