forked from phenom/healer-man
Update class mechanics, stat rulesets, and CoA reference catalogs
This commit is contained in:
1 parent
b16821e92e
commit
39458d5de6
221 files changed
+2584962
-568
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import type { RomClassId } from "../app/characterCatalog";
|
||||
import compactGearCurves from "./generated/romNativeGearCurves.generated.json";
|
||||
import { normalizeRomNativeGearStats, type RomNativeGearStats } from "./romNativeStatsTypes";
|
||||
|
||||
export type RomNativeGearSlot =
|
||||
| "head" | "neck" | "shoulder" | "back" | "chest" | "wrist" | "hands" | "waist" | "legs" | "feet"
|
||||
| "finger" | "trinket" | "main-hand" | "off-hand" | "ranged";
|
||||
|
||||
interface CompactCurveCatalog {
|
||||
readonly status: string;
|
||||
readonly profiles: Readonly<Record<string, Readonly<Record<string, readonly (unknown | { readonly stats?: unknown })[]>>>>;
|
||||
}
|
||||
|
||||
const catalog = compactGearCurves as unknown as CompactCurveCatalog;
|
||||
export const ROM_NATIVE_GEAR_REFERENCE_STATUS = catalog.status;
|
||||
export const ROM_NATIVE_GEAR_REFERENCE_CLASSES = Object.freeze(Object.keys(catalog.profiles) as RomClassId[]);
|
||||
|
||||
/** Returns only compact, source-selected native reference values; unsupported class/slot pairs have no payload. */
|
||||
export function romNativeGearReference(
|
||||
classId: RomClassId,
|
||||
slot: RomNativeGearSlot,
|
||||
level: number,
|
||||
): RomNativeGearStats | null {
|
||||
const curve = catalog.profiles[classId]?.[slot];
|
||||
if (!curve) return null;
|
||||
const safeLevel = Math.max(1, Math.min(79, Math.trunc(Number.isFinite(level) ? level : 1)));
|
||||
const entry = curve[safeLevel - 1];
|
||||
const raw = entry && typeof entry === "object" && "stats" in entry ? entry.stats : entry;
|
||||
return normalizeRomNativeGearStats(raw) ?? null;
|
||||
}
|
||||
Reference in new issue
Block a user