Add campaign shell and map generation recovery
This commit is contained in:
@@ -3,6 +3,7 @@ import { describe, expect, it } from "vitest";
|
||||
import { sampleContentPack } from "@/data/sampleContentPack";
|
||||
|
||||
import {
|
||||
addSecretDoorFallback,
|
||||
expandLevelFromExit,
|
||||
getUnresolvedExits,
|
||||
initializeDungeonLevel,
|
||||
@@ -84,4 +85,17 @@ describe("dungeon state", () => {
|
||||
}),
|
||||
).toThrow("already connected");
|
||||
});
|
||||
|
||||
it("adds a fallback secret exit when progression stalls", () => {
|
||||
const levelState = initializeDungeonLevel({ content: sampleContentPack });
|
||||
const room = levelState.rooms["room.level1.start"]!;
|
||||
|
||||
room.exits = [];
|
||||
|
||||
const fallback = addSecretDoorFallback(levelState);
|
||||
|
||||
expect(fallback.levelState.secretDoorUsed).toBe(true);
|
||||
expect(fallback.room.id).toBe("room.level1.start");
|
||||
expect(fallback.exit.exitType).toBe("secret");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user