forked from phenom/healer-man
Release Healer Man 0.1.22
This commit is contained in:
1 parent
f6f2375145
commit
7f6001723a
144 files changed
+54107
-690
No files matched your search
@@ -46,6 +46,30 @@ describe("dungeon combat fidelity integration", () => {
|
||||
expect(friendlyResult.reason).toBeUndefined();
|
||||
});
|
||||
|
||||
it("cycles only living enemy targets that are in range and line of sight", () => {
|
||||
for (const [id, position] of [
|
||||
["blocked-near", [2, 0, 0]],
|
||||
["visible", [4, 0, 0]],
|
||||
["too-far", [41, 0, 0]],
|
||||
] as const) {
|
||||
useCombatStore.getState().registerMob(id, { name: id });
|
||||
setMobPosition(id, position);
|
||||
}
|
||||
let blockVisibleTarget = false;
|
||||
registerCombatSpatialProvider({
|
||||
actor: (id) => ({ id, position: getMobPosition(id) ?? [0, 0, 0], yaw: 0 }),
|
||||
hasLineOfSight: (_origin, target) => target[0] !== 2 && (!blockVisibleTarget || target[0] !== 4),
|
||||
projectGroundPoint: (point) => point,
|
||||
});
|
||||
|
||||
expect(useCombatStore.getState().cycleTarget("next", [0, 0, 0], 40)).toBe("visible");
|
||||
expect(useCombatStore.getState().cycleTarget("next", [0, 0, 0], 40)).toBe("visible");
|
||||
|
||||
blockVisibleTarget = true;
|
||||
expect(useCombatStore.getState().cycleTarget("next", [0, 0, 0], 40)).toBeNull();
|
||||
expect(useCombatStore.getState().selectedTargetId).toBeNull();
|
||||
});
|
||||
|
||||
it("applies only the first two direct-damage pushbacks and ignores fully absorbed hits", () => {
|
||||
registerTarget();
|
||||
expect(useCombatStore.getState().castAbility("mage-frostbolt", { now: 1_000 }).ok).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user