Update Healer Man server
This commit is contained in:
1 parent
15a5254380
commit
9d7e0e2f9e
71 files changed
+3490
-81
No files matched your search
@@ -1,4 +1,6 @@
|
||||
import { useCombatStore } from "./combatStore";
|
||||
import type { BiteSizedRunSelection } from "../../shared/bite-sized-layouts.mjs";
|
||||
import { preparedBiteSizedRunSelection } from "../app/biteSizedLayoutContent";
|
||||
import { releaseDungeonGltfCache } from "./dungeonAssetCache";
|
||||
import { clearDungeonRuntimeCaches } from "./dungeonRuntimeReset";
|
||||
import { clearMobRuntimeRegistry } from "./mobRuntimeRegistry";
|
||||
@@ -11,6 +13,7 @@ import {
|
||||
dungeonCanEnter,
|
||||
dungeonDefinitionById,
|
||||
prepareDungeonSessionDefinition,
|
||||
legacyBiteSizedRunSelection,
|
||||
type DungeonId,
|
||||
} from "./dungeonRegistry";
|
||||
import type { WorldSpawn } from "./dungeonTypes";
|
||||
@@ -32,6 +35,7 @@ import { useDungeonSimulationStore } from "./dungeonSimulationStore";
|
||||
import { dungeonRouteDefinition } from "./dungeonRoutes";
|
||||
|
||||
export interface DungeonSessionOptions {
|
||||
readonly biteSizedSelection?: BiteSizedRunSelection;
|
||||
readonly bossDifficulty?: number;
|
||||
readonly gameMode?: GameMode;
|
||||
readonly spawn?: WorldSpawn;
|
||||
@@ -63,8 +67,11 @@ export function activateDungeonSession(
|
||||
const testingSource = bossTestingSourceDungeonId(dungeonId);
|
||||
const testing = Boolean(testingSource && options.gmTestMode && options.bossTest?.sourceDungeonId === testingSource);
|
||||
const dungeonSimulation = Boolean(options.dungeonSimulation && options.gmTestMode && dungeonRouteDefinition(dungeonId));
|
||||
const suppliedSelection = options.biteSizedSelection ?? options.runProgress?.biteSizedSelection
|
||||
?? (options.preserveCharacter ? useDungeonRunStore.getState().progress?.biteSizedSelection : undefined)
|
||||
?? (options.runId ? preparedBiteSizedRunSelection(dungeonId, options.runId) : undefined);
|
||||
if (!definition || (!testing && !dungeonSimulation && !dungeonCanEnter(dungeonId))
|
||||
|| !dungeonContentIsUsable(testing ? testingSource! : dungeonId)) {
|
||||
|| !dungeonContentIsUsable(testing ? testingSource! : suppliedSelection?.spot.sourceDungeonId ?? dungeonId)) {
|
||||
return false;
|
||||
}
|
||||
if ((difficultyId !== undefined && !definition.difficultyVariants.some((variant) => variant.id === difficultyId))
|
||||
@@ -78,7 +85,15 @@ export function activateDungeonSession(
|
||||
options.runProgress, options.legacyResume, bossDifficulty, options.runId);
|
||||
}
|
||||
const runSeed = useDungeonRunStore.getState().progress?.id ?? options.runId ?? "catalog-template";
|
||||
definition = prepareDungeonSessionDefinition(dungeonId, runSeed) ?? definition;
|
||||
const legacySelection = options.runProgress && !options.runProgress.biteSizedSelection
|
||||
? legacyBiteSizedRunSelection(dungeonId, runSeed) : undefined;
|
||||
definition = prepareDungeonSessionDefinition(dungeonId, runSeed,
|
||||
suppliedSelection ?? legacySelection ?? preparedBiteSizedRunSelection(dungeonId, runSeed),
|
||||
difficultyId ?? definition.defaultDifficultyId) ?? definition;
|
||||
const progress = useDungeonRunStore.getState().progress;
|
||||
if (progress && definition.biteSizedSelection) useDungeonRunStore.setState({ progress: {
|
||||
...progress, biteSizedSelection: definition.biteSizedSelection, ...(options.gmTestMode ? { timed: false } : {}),
|
||||
} });
|
||||
activateDungeonEncounterDefinitions(
|
||||
dungeonId,
|
||||
definition.encounters ?? [],
|
||||
@@ -159,5 +174,6 @@ export function restartActiveDungeonSession(): boolean {
|
||||
preserveCharacter: true,
|
||||
bossDifficulty: game.activeBossDifficulty,
|
||||
encounterSnapshots,
|
||||
biteSizedSelection: useDungeonRunStore.getState().progress?.biteSizedSelection,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user