Update Healer Man server

This commit is contained in:
phenom committed 2026-09-26 17:51:56 -04:00
1 parent 9c5fb4c614
commit bd073fb00f
113 files changed
+4902 -273

No files matched your search

+30 -2
View File
@@ -4,6 +4,7 @@ import {
RANDOMIZED_BITE_SIZED_STOCKADES_DUNGEON_ID,
} from "../game/dungeonContentSource";
import type { DungeonRunProgress } from "../game/dungeonRunTypes";
import { DEFAULT_DUNGEON_QUEUE_POLICY } from "../game/dungeonQueuePolicy";
import { canStartAnotherBiteSizedDungeon, startAnotherBiteSizedDungeon } from "./biteSizedDungeonRuntime";
import { useOnlineGroupStore } from "./onlineGroupStore";
import { useOnlineSessionStore } from "./onlineSessionStore";
@@ -38,6 +39,29 @@ afterEach(() => {
});
describe("bite-sized replay", () => {
it("does not replay a disabled randomized location", async () => {
const enterDungeon = vi.fn(() => true);
useShellStore.setState({
session: { kind: "offline", ownerId: "local-owner", displayName: "Tester" },
activeDungeonRole: "healer",
enterDungeon,
setNotice: vi.fn(),
});
await expect(startAnotherBiteSizedDungeon(
{ ...progress, dungeonId: RANDOMIZED_BITE_SIZED_STOCKADES_DUNGEON_ID },
{
random: () => 0,
loadPolicy: async () => ({ schemaVersion: 1, disabled: {
regular: [], biteSized: [], randomizedBiteSized: [RANDOMIZED_BITE_SIZED_STOCKADES_DUNGEON_ID],
} }),
createRunId: () => "unused",
contentIsUsable: () => true,
prepareRandomizedContent: vi.fn(),
},
)).resolves.toBe(false);
expect(enterDungeon).not.toHaveBeenCalled();
});
it("starts a fresh local run and treats the local player as party leader", async () => {
const enterDungeon = vi.fn(() => true);
const saveCheckpoint = vi.fn();
@@ -51,12 +75,14 @@ describe("bite-sized replay", () => {
expect(canStartAnotherBiteSizedDungeon()).toBe(true);
await expect(startAnotherBiteSizedDungeon(progress)).resolves.toBe(true);
expect(saveCheckpoint).toHaveBeenCalledWith(null);
expect(enterDungeon).toHaveBeenCalledWith(BITE_SIZED_STOCKADES_DUNGEON_ID, "healer", {
expect(enterDungeon).toHaveBeenCalledWith(expect.stringMatching(/^bite-sized-/), "healer", {
difficultyId: "normal",
bossDifficulty: 1,
freshRun: true,
runId: expect.any(String),
});
expect(enterDungeon).not.toHaveBeenCalledWith(BITE_SIZED_STOCKADES_DUNGEON_ID,
expect.anything(), expect.anything());
});
it("replays randomized mode with a new seed and prepares that seed's creature assets", async () => {
@@ -73,6 +99,7 @@ describe("bite-sized replay", () => {
await expect(startAnotherBiteSizedDungeon(randomizedProgress, {
random: () => 0,
loadPolicy: async () => DEFAULT_DUNGEON_QUEUE_POLICY,
createRunId: () => "next-randomized-seed",
contentIsUsable: () => true,
prepareRandomizedContent,
@@ -114,7 +141,7 @@ describe("bite-sized replay", () => {
await expect(startAnotherBiteSizedDungeon(progress)).resolves.toBe(true);
expect(startActivity).toHaveBeenCalledWith(expect.objectContaining({ ownerId: "leader" }), {
type: "dungeon",
contentId: BITE_SIZED_STOCKADES_DUNGEON_ID,
contentId: expect.stringMatching(/^bite-sized-/),
difficultyId: "normal",
bossDifficulty: 1,
partySize: 4,
@@ -140,6 +167,7 @@ describe("bite-sized replay", () => {
await expect(startAnotherBiteSizedDungeon(
{ ...progress, dungeonId: RANDOMIZED_BITE_SIZED_STOCKADES_DUNGEON_ID },
{ random: () => 0, createRunId: () => "unused-local-seed", contentIsUsable: () => true,
loadPolicy: async () => DEFAULT_DUNGEON_QUEUE_POLICY,
prepareRandomizedContent: vi.fn() },
)).resolves.toBe(true);