Files
healer-man/src/game/manastormInstalledCatalog.ts
T
2026-08-14 15:56:39 -04:00

194 lines
6.0 KiB
TypeScript

import runtimeSnapshot from "./generated/manastormRuntimeCatalog.json";
import affixSnapshot from "./generated/manastormAffixes.json";
import { INSTALLED_MANASTORM_STAGES } from "./manastormInstalledStages";
import type {
ManastormCatalogLike,
ManastormCatalogAffixLike,
ManastormCatalogModifierLike,
ManastormCatalogMessageLike,
} from "./manastorm";
interface InstalledRuntimeSnapshot {
readonly schemaVersion: 2;
readonly catalogId: string;
readonly modeId: number;
readonly defaultModeId: number;
readonly modeIds?: readonly number[];
readonly maximumLevel: number;
readonly modes?: readonly {
readonly modeId: number;
readonly key: string;
readonly maximumLevel: number;
readonly modifiers: readonly (readonly number[])[];
readonly messages: readonly {
readonly progressionValue: number;
readonly groupId: number;
readonly title: string;
readonly description: string;
readonly iconReference?: string;
}[];
}[];
readonly encounters: readonly {
readonly encounterId: number;
readonly name: string;
readonly creatureId: number;
readonly mapIds: readonly number[];
readonly modeIds: readonly number[];
readonly sourceRowIds: readonly string[];
}[];
readonly encounterSources: readonly {
readonly role: string;
readonly path: string;
readonly sha256: string;
}[];
readonly sourceRows?: readonly {
readonly sourceRecordId: number;
readonly mapId: number;
readonly modeId: number;
readonly encounterId: number;
readonly scalars: readonly number[];
}[];
readonly encounterModesByMap: readonly {
readonly mapId: number;
readonly modeIds: readonly number[];
}[];
readonly modifiers: readonly (readonly number[])[];
readonly groupModifiers: readonly (readonly number[])[];
readonly messages: readonly {
readonly progressionValue: number;
readonly groupId: number;
readonly title: string;
readonly description: string;
readonly iconReference?: string;
}[];
}
const installed = runtimeSnapshot as InstalledRuntimeSnapshot;
const modeId = installed.modeId;
const modes = installed.modes ?? [{
modeId,
key: "leveling",
maximumLevel: installed.maximumLevel,
modifiers: installed.modifiers,
messages: installed.messages,
}];
const modifiers: readonly ManastormCatalogModifierLike[] = modes.flatMap(
(mode) => mode.modifiers.map(
([level, ...tuning]) => ({ modeId: mode.modeId, level, tuning }),
),
);
const groupModifiers = installed.groupModifiers.map(([playerCount, ...multipliers]) => ({
playerCount,
modeId,
sourceModeId: modeId,
appliesToModeIds: installed.modeIds ?? [modeId],
multipliers,
}));
const messages: readonly ManastormCatalogMessageLike[] = modes.flatMap(
(mode) => mode.messages.map((message) => ({
modeId: mode.modeId,
progressionValue: message.progressionValue,
groupId: message.groupId,
title: message.title,
description: message.description,
...(message.iconReference ? { iconReference: message.iconReference } : {}),
})),
);
const affixes: readonly ManastormCatalogAffixLike[] = affixSnapshot.affixes.map((affix) => ({
id: affix.id,
name: affix.name,
description: affix.description,
unlockLevel: affix.unlockLevel,
modeIds: affix.modeIds,
iconReference: affix.iconReference,
trigger: affix.trigger as ManastormCatalogAffixLike["trigger"],
spellId: affix.spellId,
sourceRecordIds: affix.sourceRecordIds,
sourceReportId: affixSnapshot.sourceReportId,
sourceSpellDbcSha256: affixSnapshot.spellDbcSha256,
}));
const rewardCadenceSource = "Ascension Manastorm observable reward cadence; amounts are local balance substitutions.";
const rewards = Object.freeze([
{
id: "installed-leveling-milestone",
modeIds: [0],
claimPolicy: "repeatable",
milestoneEvery: 5,
currencyId: "bedlamBullions",
currencyBase: 5,
currencyPerLevel: 0.1,
cacheId: "leveling-manastorm-cache",
provenance: { fidelity: "authored-observable-cadence", source: rewardCadenceSource },
},
{
id: "installed-leveling-clear",
modeIds: [0],
claimPolicy: "repeatable",
currencyId: "bonzoBolts",
currencyBase: 2,
currencyPerLevel: 0.5,
cacheId: "leveling-manastorm-cache",
provenance: { fidelity: "authored-observable-cadence", source: rewardCadenceSource },
},
{
id: "installed-leveling-first-clear",
modeIds: [0],
claimPolicy: "first-clear",
currencyId: "bonzoBolts",
currencyBase: 1,
currencyPerLevel: 0.1,
provenance: { fidelity: "authored-observable-cadence", source: rewardCadenceSource },
},
{
id: "installed-endgame-milestone",
modeIds: [2],
claimPolicy: "repeatable",
milestoneEvery: 5,
currencyId: "bedlamBullions",
currencyBase: 5,
currencyPerLevel: 0.1,
cacheId: "endgame-manastorm-cache",
cachePolicy: "accumulating-chance",
provenance: { fidelity: "authored-observable-cadence", source: rewardCadenceSource },
},
{
id: "installed-endgame-clear",
modeIds: [2],
claimPolicy: "repeatable",
currencyId: "bonzoBolts",
currencyBase: 3,
currencyPerLevel: 0.5,
cacheId: "endgame-manastorm-cache",
cachePolicy: "accumulating-chance",
provenance: { fidelity: "authored-observable-cadence", source: rewardCadenceSource },
},
{
id: "installed-endgame-first-clear",
modeIds: [2],
claimPolicy: "first-clear",
currencyId: "bedlamBullions",
currencyBase: 1,
currencyPerLevel: 0.05,
provenance: { fidelity: "authored-observable-cadence", source: rewardCadenceSource },
},
] as const);
/**
* Runtime view of the installed client snapshot. Shipping stage packages are
* joined to authoritative encounter/creature identities and reviewed package
* anchors by manastormInstalledStages; incomplete joins remain excluded.
*/
export const INSTALLED_MANASTORM_RUNTIME_CATALOG: ManastormCatalogLike = Object.freeze({
id: installed.catalogId,
modeId,
modeIds: installed.modeIds ?? [modeId],
maximumLevel: installed.maximumLevel,
modifiers,
groupModifiers,
messages,
affixes,
rewards,
stages: INSTALLED_MANASTORM_STAGES,
});