forked from phenom/healer-man
21 lines
1006 B
TypeScript
21 lines
1006 B
TypeScript
import type { CoaClassId } from "../app/characterCatalog";
|
|
import type { AbilityDefinition, ClassResourceProfile } from "./abilityCatalog";
|
|
import generated from "./generated/coaAbilityRuntimeCatalog.json";
|
|
|
|
interface CoaAbilityRuntimeSnapshot {
|
|
readonly schemaVersion: 1;
|
|
readonly abilitiesByClass: Readonly<Record<CoaClassId, readonly AbilityDefinition[]>>;
|
|
readonly resourcesByClass: Readonly<Record<CoaClassId, ClassResourceProfile>>;
|
|
readonly triggeredAbilitiesBySpellId: Readonly<Record<number, AbilityDefinition>>;
|
|
}
|
|
|
|
const snapshot = generated as unknown as CoaAbilityRuntimeSnapshot;
|
|
|
|
export const COA_RUNTIME_ABILITIES_BY_CLASS = snapshot.abilitiesByClass;
|
|
export const COA_RUNTIME_CLASS_RESOURCES = snapshot.resourcesByClass;
|
|
export const COA_RUNTIME_TRIGGERED_ABILITIES_BY_SPELL_ID = snapshot.triggeredAbilitiesBySpellId;
|
|
|
|
export function coaTriggeredAbilityBySpellId(spellId: number): AbilityDefinition | null {
|
|
return COA_RUNTIME_TRIGGERED_ABILITIES_BY_SPELL_ID[spellId] ?? null;
|
|
}
|