forked from phenom/healer-man
Update Healer Man server
This commit is contained in:
1 parent
35dfdaed61
commit
4fb7a0b9c8
161 files changed
+24618
-529
No files matched your search
@@ -3,9 +3,14 @@ import type { AbilityEffect } from "./abilityCatalog";
|
||||
import { abilitiesForCharacter, preloadAbilityCatalogsForClasses } from "./abilityCatalog";
|
||||
import { cooldownResetCandidates } from "./cooldownReset";
|
||||
import { clearMobRuntimeRegistry, setMobPosition } from "./mobRuntimeRegistry";
|
||||
import { clearPartyRuntimeRegistry, registerPartyRuntimePosition } from "./partyRuntimeRegistry";
|
||||
import {
|
||||
clearPartyRuntimeRegistry,
|
||||
registerPartyRuntimePosition,
|
||||
updatePartyRuntimeTargetVisibility,
|
||||
} from "./partyRuntimeRegistry";
|
||||
import { advanceDungeonPartyCombat, resetPartyRuntimeClock } from "./partyRuntime";
|
||||
import { PLAYER_AURA_ENTITY_ID, useCombatStore } from "./combatStore";
|
||||
import { usePartyStore } from "./partyStore";
|
||||
import { createConfiguredPartyMember, usePartyStore } from "./partyStore";
|
||||
import { ROM_ALL_ABILITIES } from "./romAbilityCatalog";
|
||||
import { romEffectsForCast } from "./romCombatMechanics";
|
||||
import {
|
||||
@@ -65,9 +70,130 @@ describe("RuneWaker Warlock runtime", () => {
|
||||
beforeEach(() => {
|
||||
clearMobRuntimeRegistry();
|
||||
clearPartyRuntimeRegistry();
|
||||
resetPartyRuntimeClock();
|
||||
useCombatStore.setState({ playerPosition: [0, 0, 0] });
|
||||
});
|
||||
|
||||
it("gives the caster Ruthless Judgment's source bonus only below 20% target health", () => {
|
||||
const ruthlessJudgment = ability(498544);
|
||||
const effectsFor = (targetHealthPercent: number) => romEffectsForCast(ruthlessJudgment, {
|
||||
sealStacks: 0,
|
||||
bleedCount: 0,
|
||||
charged: false,
|
||||
mainHandDagger: false,
|
||||
casterMaxHealth: 10_000,
|
||||
targetHealthPercent,
|
||||
});
|
||||
const bonusAuras = (targetHealthPercent: number) => effectsFor(targetHealthPercent).filter((effect) => (
|
||||
effect.kind === "apply-aura" && effect.sourceAuraType === 192 && effect.miscValue === 5
|
||||
));
|
||||
const below = bonusAuras(0.199);
|
||||
expect(below).toHaveLength(1);
|
||||
expect(below[0]).toMatchObject({
|
||||
kind: "apply-aura",
|
||||
recipient: "caster",
|
||||
aura: {
|
||||
disposition: "buff",
|
||||
durationMs: 20_000,
|
||||
modifiers: [expect.objectContaining({
|
||||
kind: "damage",
|
||||
direction: "dealt",
|
||||
attackKind: "spell",
|
||||
operation: "percent",
|
||||
value: 0.05,
|
||||
})],
|
||||
},
|
||||
});
|
||||
expect(bonusAuras(0.2)).toHaveLength(0);
|
||||
expect(bonusAuras(0.8)).toHaveLength(0);
|
||||
|
||||
const sourceDamage = ruthlessJudgment.effects.find((effect) => effect.kind === "damage");
|
||||
expect(effectsFor(0.199).find((effect) => effect.kind === "damage")).toEqual(sourceDamage);
|
||||
expect(effectsFor(0.2).find((effect) => effect.kind === "damage")).toEqual(sourceDamage);
|
||||
});
|
||||
|
||||
it("applies Ruthless Judgment's low-health bonus to the player caster", () => {
|
||||
prepareWarlock("rom-priest");
|
||||
registerTarget();
|
||||
useCombatStore.getState().damageMob(TARGET_ID, 81_000, 900);
|
||||
|
||||
const ruthlessJudgment = ability(498544);
|
||||
expect(useCombatStore.getState().castAbility(ruthlessJudgment.id, {
|
||||
targetActorId: TARGET_ID,
|
||||
now: 1_000,
|
||||
}).ok).toBe(true);
|
||||
const completesAt = useCombatStore.getState().activeCast?.completesAt;
|
||||
expect(completesAt).toBeDefined();
|
||||
finishCast(1_000);
|
||||
|
||||
const bonusAura = useCombatStore.getState().auras.find((aura) => (
|
||||
aura.sourceId === PLAYER_AURA_ENTITY_ID
|
||||
&& aura.targetId === PLAYER_AURA_ENTITY_ID
|
||||
&& aura.definition.name.startsWith("Ruthless Judgment")
|
||||
));
|
||||
expect(bonusAura).toMatchObject({
|
||||
definition: {
|
||||
disposition: "buff",
|
||||
modifiers: [expect.objectContaining({ kind: "damage", direction: "dealt", value: 0.05 })],
|
||||
},
|
||||
});
|
||||
expect(bonusAura?.expiresAt).toBe(completesAt! + 20_000);
|
||||
expect(useCombatStore.getState().auras.some((aura) => (
|
||||
aura.targetId === TARGET_ID && aura.definition.name.startsWith("Ruthless Judgment")
|
||||
))).toBe(false);
|
||||
});
|
||||
|
||||
it("applies Ruthless Judgment's low-health bonus to a companion Warlock caster", () => {
|
||||
useCombatStore.getState().initializeCharacter({ classId: "rom-priest", raceId: "rom-dwarf", level: 80 });
|
||||
usePartyStore.getState().initializeParty("rom-warlock-ruthless-companion", 80,
|
||||
useCombatStore.getState().health, "damage", 2, "rom");
|
||||
const warlock = createConfiguredPartyMember({
|
||||
name: "Ruthless Companion",
|
||||
classId: "rom-warlock",
|
||||
secondaryClassId: "rom-priest",
|
||||
raceId: "rom-dwarf",
|
||||
specialization: "Warlock",
|
||||
role: "damage",
|
||||
}, 80, 0, "rom-warlock-ruthless-companion");
|
||||
const ruthlessJudgment = ability(498544);
|
||||
const pairAbilities = abilitiesForCharacter("rom-warlock", "rom-priest");
|
||||
usePartyStore.setState({
|
||||
command: "attack",
|
||||
members: [{
|
||||
...warlock,
|
||||
cooldowns: Object.fromEntries(pairAbilities
|
||||
.filter((candidate) => candidate.id !== ruthlessJudgment.id)
|
||||
.map((candidate) => [candidate.id, 100_000])),
|
||||
resourcePools: { ...warlock.resourcePools, focus: 100 },
|
||||
resource: 100,
|
||||
}],
|
||||
});
|
||||
useCombatStore.getState().synchronizeActors();
|
||||
registerPartyRuntimePosition(warlock.id, [0, 0, 0]);
|
||||
registerTarget();
|
||||
useCombatStore.getState().damageMob(TARGET_ID, 81_000, 900);
|
||||
updatePartyRuntimeTargetVisibility(warlock.id, TARGET_ID, true);
|
||||
|
||||
advanceDungeonPartyCombat(1_000);
|
||||
advanceDungeonPartyCombat(3_100);
|
||||
|
||||
const bonusAura = useCombatStore.getState().auras.find((aura) => (
|
||||
aura.sourceId === warlock.id
|
||||
&& aura.targetId === warlock.id
|
||||
&& aura.definition.name.startsWith("Ruthless Judgment")
|
||||
));
|
||||
expect(bonusAura).toMatchObject({
|
||||
expiresAt: 23_100,
|
||||
definition: {
|
||||
disposition: "buff",
|
||||
modifiers: [expect.objectContaining({ kind: "damage", direction: "dealt", value: 0.05 })],
|
||||
},
|
||||
});
|
||||
expect(useCombatStore.getState().auras.some((aura) => (
|
||||
aura.targetId === TARGET_ID && aura.definition.name.startsWith("Ruthless Judgment")
|
||||
))).toBe(false);
|
||||
});
|
||||
|
||||
it("converts the RoM Warlock/Warrior Rage pool to psi at 35:1", () => {
|
||||
prepareWarlock("rom-warrior");
|
||||
useCombatStore.setState((state) => ({
|
||||
|
||||
Reference in new issue
Block a user