Release Healer Man 0.1.58

This commit is contained in:
phenom committed 2026-09-20 16:46:17 -04:00
1 parent 14e105642c
commit 246b4832b0
38 files changed
+952 -93

No files matched your search

@@ -0,0 +1,59 @@
import { describe, expect, it } from "vitest";
import {
RANDOMIZED_BITE_SIZED_STOCKADES_DUNGEON_ID,
STORMWIND_STOCKADE_DUNGEON_ID,
} from "./dungeonContentSource";
import { DUNGEON_REGISTRY, dungeonDefinitionById } from "./dungeonRegistry";
import { activateDungeonSession } from "./dungeonSession";
import { BITE_SIZED_STOCKADES_BOSS_CANDIDATES } from "./dungeons/biteSizedStockades";
import {
createRandomizedBiteSizedStockadesDefinition,
randomizedBiteSizedCreatureCatalog,
} from "./dungeons/randomizedBiteSizedStockades";
const source = DUNGEON_REGISTRY[STORMWIND_STOCKADE_DUNGEON_ID];
describe("Randomized Bite-Sized Stockades", () => {
it("keeps source geometry and both existing Stockades definitions immutable", () => {
const originalSpawns = source.staticSpawns.map((spawn) => ({ ...spawn }));
const randomized = createRandomizedBiteSizedStockadesDefinition(source, "random-layout-a");
expect(randomized.id).toBe(RANDOMIZED_BITE_SIZED_STOCKADES_DUNGEON_ID);
expect(randomized.navigationLinks).toEqual(source.navigationLinks);
expect(randomized.traversalRamps).toEqual(source.traversalRamps);
expect(randomized.roamingPacks).toEqual([]);
expect(randomized.serverGameObjects.filter((object) => object.id.startsWith("bite-sized-stockades-"))).toHaveLength(2);
expect(source.staticSpawns).toEqual(originalSpawns);
});
it("rerolls every ordinary slot from the complete placed Stockades mob pool", () => {
const catalog = randomizedBiteSizedCreatureCatalog(source);
const mobIds = catalog.filter((candidate) => candidate.kind === "mob").map((candidate) => candidate.entityId);
const observed = new Set<string>();
for (let index = 0; index < 2_000; index += 1) {
const definition = createRandomizedBiteSizedStockadesDefinition(source, `mob-roll-${index}`);
const bossId = definition.bosses[0].id;
for (const spawn of definition.staticSpawns.filter((candidate) => candidate.id !== bossId)) {
expect(mobIds).toContain(spawn.entityId);
observed.add(spawn.entityId);
}
}
expect([...observed].sort()).toEqual([...mobIds].sort());
});
it("reconstructs the same party lineup from a run id and can select every boss", () => {
const first = createRandomizedBiteSizedStockadesDefinition(source, "shared-run");
const second = createRandomizedBiteSizedStockadesDefinition(source, "shared-run");
expect(second.staticSpawns).toEqual(first.staticSpawns);
expect(second.bosses).toEqual(first.bosses);
const bosses = new Set<string>();
for (let index = 0; index < 1_000; index += 1) {
bosses.add(createRandomizedBiteSizedStockadesDefinition(source, `boss-roll-${index}`).bosses[0].id);
}
expect([...bosses].sort()).toEqual(BITE_SIZED_STOCKADES_BOSS_CANDIDATES.map((candidate) => candidate.sourceSpawnId).sort());
expect(activateDungeonSession(RANDOMIZED_BITE_SIZED_STOCKADES_DUNGEON_ID, undefined, { runId: "shared-run" })).toBe(true);
expect(dungeonDefinitionById(RANDOMIZED_BITE_SIZED_STOCKADES_DUNGEON_ID)?.staticSpawns).toEqual(first.staticSpawns);
});
});