forked from phenom/healer-man
Update Healer Man server
This commit is contained in:
1 parent
4fb7a0b9c8
commit
4c768fbec6
24 files changed
+654
-22
No files matched your search
@@ -124,6 +124,85 @@ describe("WoW Shaman Maelstrom Weapon combat runtime", () => {
|
||||
))).toBe(true);
|
||||
});
|
||||
|
||||
it("uses the off-hand speed for Shaman off-hand auto-attack Maelstrom rolls", () => {
|
||||
setMaelstromRank(3);
|
||||
useCombatStore.setState((state) => ({
|
||||
inventory: state.inventory.map((item) => item.instanceId === OFF_HAND_WEAPON_ID
|
||||
? { ...item, stats: { ...item.stats, meleeWeapon: { ...item.stats.meleeWeapon!, speedMs: 2_000 } } }
|
||||
: item),
|
||||
gearStats: { ...state.gearStats, hitRating: 10_000, expertiseRating: 10_000 },
|
||||
autoAttackTargetId: TARGET_ID,
|
||||
nextAutoAttackAt: 1_000,
|
||||
nextOffhandAutoAttackAt: 1_000,
|
||||
}));
|
||||
const mainHandRoll = (now: number) => stableCombatUnit(
|
||||
`${PLAYER_AURA_ENTITY_ID}:auto:${TARGET_ID}:${now}:wow335-shaman-maelstrom-weapon`,
|
||||
);
|
||||
const offHandRoll = (now: number) => stableCombatUnit(
|
||||
`${PLAYER_AURA_ENTITY_ID}:offhand-auto:${TARGET_ID}:${now}:wow335-shaman-maelstrom-weapon`,
|
||||
);
|
||||
const now = Array.from({ length: 50_000 }, (_, index) => 1_000 + index)
|
||||
.find((candidate) => mainHandRoll(candidate) >= 0.2
|
||||
&& offHandRoll(candidate) >= 0.2 && offHandRoll(candidate) < 0.4)!;
|
||||
expect(now).toBeDefined();
|
||||
|
||||
useCombatStore.getState().tick(0.1, now);
|
||||
|
||||
const offhandEvents = useCombatStore.getState().combatEvents.filter((event) => (
|
||||
event.kind === "damage" && event.abilityId === "player-auto-attack-offhand"
|
||||
));
|
||||
expect(offhandEvents, JSON.stringify(offhandEvents)).toHaveLength(1);
|
||||
expect(mainHandRoll(now)).toBeGreaterThanOrEqual(0.2);
|
||||
expect(offHandRoll(now)).toBeLessThan(0.4);
|
||||
expect(maelstromAura(), JSON.stringify({
|
||||
now,
|
||||
roll: offHandRoll(now),
|
||||
rank: useCombatStore.getState().talentRanks["talent-2057"],
|
||||
weapon: useCombatStore.getState().inventory.find((item) => item.instanceId === OFF_HAND_WEAPON_ID)?.stats.meleeWeapon,
|
||||
offhandEvents,
|
||||
})).toMatchObject({ stacks: 1 });
|
||||
});
|
||||
|
||||
it("resolves Stormstrike's hands independently and uses each weapon speed for Maelstrom", () => {
|
||||
setMaelstromRank(3);
|
||||
useCombatStore.setState((state) => ({
|
||||
talentRanks: { ...state.talentRanks, "talent-901": 1 },
|
||||
inventory: state.inventory.map((item) => item.instanceId === OFF_HAND_WEAPON_ID
|
||||
? { ...item, stats: { ...item.stats, meleeWeapon: { ...item.stats.meleeWeapon!, speedMs: 2_000 } } }
|
||||
: item),
|
||||
gearStats: { ...state.gearStats, hitRating: 10_000, expertiseRating: 10_000 },
|
||||
}));
|
||||
const stormstrike = shamanAbility("Stormstrike");
|
||||
const mainHandRoll = (now: number) => stableCombatUnit(
|
||||
`${PLAYER_AURA_ENTITY_ID}:${stormstrike.id}:${TARGET_ID}:${now}:direct:main-hand:wow335-shaman-maelstrom-weapon`,
|
||||
);
|
||||
const offHandRoll = (now: number) => stableCombatUnit(
|
||||
`${PLAYER_AURA_ENTITY_ID}:${stormstrike.id}:${TARGET_ID}:${now}:direct:off-hand:wow335-shaman-maelstrom-weapon`,
|
||||
);
|
||||
const now = Array.from({ length: 50_000 }, (_, index) => 1_000 + index)
|
||||
.find((candidate) => mainHandRoll(candidate) >= 0.2
|
||||
&& offHandRoll(candidate) >= 0.2 && offHandRoll(candidate) < 0.4)!;
|
||||
expect(now).toBeDefined();
|
||||
|
||||
cast(stormstrike.id, now);
|
||||
|
||||
const hitEvents = useCombatStore.getState().combatEvents.filter((event) => (
|
||||
event.kind === "damage" && event.abilityId === stormstrike.id && event.effectiveAmount > 0
|
||||
));
|
||||
expect(hitEvents, JSON.stringify(useCombatStore.getState().combatEvents.filter((event) => (
|
||||
event.kind === "damage" && event.abilityId === stormstrike.id
|
||||
)))).toHaveLength(2);
|
||||
expect(mainHandRoll(now)).toBeGreaterThanOrEqual(0.2);
|
||||
expect(offHandRoll(now)).toBeLessThan(0.4);
|
||||
expect(maelstromAura(), JSON.stringify({
|
||||
now,
|
||||
roll: offHandRoll(now),
|
||||
rank: useCombatStore.getState().talentRanks["talent-2057"],
|
||||
weapon: useCombatStore.getState().inventory.find((item) => item.instanceId === OFF_HAND_WEAPON_ID)?.stats.meleeWeapon,
|
||||
hitEvents,
|
||||
})).toMatchObject({ stacks: 1 });
|
||||
});
|
||||
|
||||
it("adds one stack per proc, refreshes the 30-second duration, and caps at five", () => {
|
||||
setMaelstromRank(3);
|
||||
const lavaLash = shamanAbility("Lava Lash");
|
||||
|
||||
Reference in new issue
Block a user