Update Healer Man server
This commit is contained in:
1 parent
cc3b2fa4d5
commit
daa417ec17
46 files changed
+1334
-172
No files matched your search
@@ -21,6 +21,12 @@ import { withWowClassicEncounterBatchTwo } from "./wowClassicEncounterBatchTwoCa
|
||||
import { withWowClassicEncounterBatchThree } from "./wowClassicEncounterBatchThreeCatalog";
|
||||
import { withWowTbcEncounterBatchTwoContent } from "./wowTbcEncounterBatchTwoCatalog";
|
||||
import { withWowDungeonEnvironment } from "./wowDungeonEnvironment";
|
||||
import {
|
||||
BITE_SIZED_STOCKADES_DUNGEON_ID,
|
||||
STORMWIND_STOCKADE_DUNGEON_ID,
|
||||
dungeonContentSourceId,
|
||||
} from "./dungeonContentSource";
|
||||
import { createBiteSizedStockadesDefinition } from "./dungeons/biteSizedStockades";
|
||||
|
||||
export { DEFAULT_DUNGEON_ID } from "./dungeonDefaults";
|
||||
|
||||
@@ -177,7 +183,7 @@ function applyDungeonContentAdapters(definition: DungeonDefinition): DungeonDefi
|
||||
);
|
||||
}
|
||||
|
||||
const dungeonRegistryEntries: readonly (readonly [string, DungeonDefinition])[] = [
|
||||
const sourceDungeonRegistryEntries: readonly (readonly [string, DungeonDefinition])[] = [
|
||||
[authoredWailingCaverns.id, authoredWailingCaverns],
|
||||
[FORSAKEN_ABBEY_DEFINITION.id, FORSAKEN_ABBEY_DEFINITION],
|
||||
...RUNEWAKER_DUNGEON_DEFINITIONS.map((definition) => [definition.id, definition] as const),
|
||||
@@ -186,13 +192,21 @@ const dungeonRegistryEntries: readonly (readonly [string, DungeonDefinition])[]
|
||||
.map((definition) => [definition.id, definition] as const),
|
||||
];
|
||||
|
||||
const adaptedSourceEntries = sourceDungeonRegistryEntries.map(
|
||||
([id, definition]) => [id, applyDungeonContentAdapters(definition)] as const,
|
||||
);
|
||||
const adaptedSourceRegistry = Object.fromEntries(adaptedSourceEntries) as Readonly<Record<string, DungeonDefinition>>;
|
||||
const stockadesDefinition = adaptedSourceRegistry[STORMWIND_STOCKADE_DUNGEON_ID];
|
||||
if (!stockadesDefinition) throw new Error("Stormwind Stockade is required for its bite-sized variant.");
|
||||
|
||||
const biteSizedStockadesTemplate = createBiteSizedStockadesDefinition(stockadesDefinition, "catalog-template");
|
||||
const dungeonRegistryEntries: readonly (readonly [string, DungeonDefinition])[] = [
|
||||
...adaptedSourceEntries,
|
||||
[biteSizedStockadesTemplate.id, biteSizedStockadesTemplate],
|
||||
];
|
||||
|
||||
export const DUNGEON_REGISTRY: Readonly<Record<string, DungeonDefinition>> = Object.freeze(
|
||||
Object.fromEntries(dungeonRegistryEntries.map(
|
||||
([id, definition]) => [
|
||||
id,
|
||||
applyDungeonContentAdapters(definition),
|
||||
] as const,
|
||||
)),
|
||||
Object.fromEntries(dungeonRegistryEntries),
|
||||
);
|
||||
|
||||
export type DungeonId = string;
|
||||
@@ -201,6 +215,7 @@ export const DUNGEON_DEFINITIONS = Object.freeze(Object.values(DUNGEON_REGISTRY)
|
||||
|
||||
// Test rooms are session-only definitions; the shipped dungeon catalog stays immutable.
|
||||
const bossTestingDefinitions = new Map<string, { definition: DungeonDefinition; sourceDungeonId: string }>();
|
||||
const sessionDungeonDefinitions = new Map<string, DungeonDefinition>();
|
||||
|
||||
export function registerBossTestingDungeon(definition: DungeonDefinition, sourceDungeonId: string): void {
|
||||
if (!definition.id.startsWith("boss-testing:") || !DUNGEON_REGISTRY[sourceDungeonId]) {
|
||||
@@ -218,8 +233,19 @@ export function clearBossTestingDungeons(): void {
|
||||
bossTestingDefinitions.clear();
|
||||
}
|
||||
|
||||
/** Materializes seeded variants after a run id exists; ordinary dungeons keep their catalog definition. */
|
||||
export function prepareDungeonSessionDefinition(id: string, seed: string): DungeonDefinition | null {
|
||||
if (id !== BITE_SIZED_STOCKADES_DUNGEON_ID) return dungeonDefinitionById(id);
|
||||
const definition = createBiteSizedStockadesDefinition(stockadesDefinition, seed);
|
||||
sessionDungeonDefinitions.set(id, definition);
|
||||
return definition;
|
||||
}
|
||||
|
||||
export function dungeonDefinitionById(id: string): DungeonDefinition | null {
|
||||
return bossTestingDefinitions.get(id)?.definition ?? DUNGEON_REGISTRY[id] ?? null;
|
||||
return bossTestingDefinitions.get(id)?.definition
|
||||
?? sessionDungeonDefinitions.get(id)
|
||||
?? DUNGEON_REGISTRY[id]
|
||||
?? null;
|
||||
}
|
||||
|
||||
export function requireDungeonDefinition(id: string): DungeonDefinition {
|
||||
@@ -239,7 +265,7 @@ export function dungeonIsEnabled(id: string): boolean {
|
||||
const definition = dungeonDefinitionById(id);
|
||||
if (!definition) return false;
|
||||
|
||||
const configured = (availability.enabled as Readonly<Record<string, boolean>>)[id];
|
||||
const configured = (availability.enabled as Readonly<Record<string, boolean>>)[dungeonContentSourceId(id)];
|
||||
if (definition.expansion !== "runewaker") return configured === true;
|
||||
if (!dungeonPackagePassesOfflineGate(definition)) return false;
|
||||
if (configured !== undefined) return configured;
|
||||
|
||||
Reference in new issue
Block a user