forked from phenom/healer-man
Release Healer Man 0.1.21
This commit is contained in:
1 parent
699fc858c9
commit
f6f2375145
210 files changed
+976039
-6247
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { applyDungeonEncounterEffect } from "./DungeonEncounterEffectBridge";
|
||||
import { clearPartyRuntimeRegistry, getPartyRuntimePosition, updatePartyRuntimePosition } from "./partyRuntimeRegistry";
|
||||
import { usePartyStore } from "./partyStore";
|
||||
import { useGameStore } from "./store";
|
||||
|
||||
afterEach(() => {
|
||||
clearPartyRuntimeRegistry();
|
||||
usePartyStore.setState({ members: [] });
|
||||
});
|
||||
|
||||
describe("dungeon encounter effects", () => {
|
||||
it("teleports the player and every current party runtime actor", () => {
|
||||
usePartyStore.getState().initializeParty("encounter-effect-test", 1, 10);
|
||||
const allyId = usePartyStore.getState().members[0].id;
|
||||
updatePartyRuntimePosition(allyId, 0, 0, 0);
|
||||
applyDungeonEncounterEffect({
|
||||
dungeonId: useGameStore.getState().activeDungeonId,
|
||||
encounterId: "test:transition",
|
||||
effect: {
|
||||
kind: "party-teleport",
|
||||
actionId: "cross-threshold",
|
||||
destination: [12, 3, -8],
|
||||
},
|
||||
}, 100);
|
||||
expect(useGameStore.getState().playerPosition).toEqual([12, 3, -8]);
|
||||
expect(getPartyRuntimePosition(allyId)).toEqual([12, 3, -8]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user