/** Cauldron action / step kinds (authoritative recipe language). */ export const AlchemyStepKind = Object.freeze({ heat: "heat", cool: "cool", stir: "stir", insert: "insert" }); export const POTION_MAX_STACK = 16; export const POTION_FILL_LEVELS = Object.freeze([1, 2, 3, 4, 5]); export const CAULDRON_SLOT_COUNT = 4; /** * Known successful potions. Ingredient `key` matches item def keys (resolved to itemId at runtime). * A potion may never use more than 4 unique ingredients (ratio units). */ export const ALCHEMY_POTION_DEFINITIONS = Object.freeze({ greenDraught: Object.freeze({ potionKey: "greenDraught", displayName: "Green draught", minAlchemyLevel: 1, color: Object.freeze({ r: 0.25, g: 0.72, b: 0.35 }), fillLevel: 4, ingredients: Object.freeze([ Object.freeze({ key: "green-herb", quantity: 2 }), Object.freeze({ key: "apple", quantity: 1 }) ]), steps: Object.freeze([ Object.freeze({ kind: AlchemyStepKind.heat }), Object.freeze({ kind: AlchemyStepKind.insert, itemKey: "green-herb" }), Object.freeze({ kind: AlchemyStepKind.stir }), Object.freeze({ kind: AlchemyStepKind.insert, itemKey: "apple" }), Object.freeze({ kind: AlchemyStepKind.cool }) ]), effect: Object.freeze({ type: "heal", amount: 5 }) }) }); /** * Failure (unstable) potions chosen by hashing the step transcript. * Effects are stubs for later systems. */ export const UNSTABLE_POTION_EFFECTS = Object.freeze([ Object.freeze({ effectKey: "slow", displayName: "Unstable draught (sluggish)", color: { r: 0.45, g: 0.35, b: 0.55 }, fillLevel: 3, effect: { type: "slow", durationMs: 60_000 } }), Object.freeze({ effectKey: "harm", displayName: "Unstable draught (bitter)", color: { r: 0.7, g: 0.2, b: 0.15 }, fillLevel: 2, effect: { type: "damage", amount: 4 } }), Object.freeze({ effectKey: "blind", displayName: "Unstable draught (murky)", color: { r: 0.15, g: 0.15, b: 0.2 }, fillLevel: 3, effect: { type: "blind", durationMs: 30_000 } }), Object.freeze({ effectKey: "queasy", displayName: "Unstable draught (queasy)", color: { r: 0.55, g: 0.65, b: 0.2 }, fillLevel: 2, effect: { type: "queasy", durationMs: 45_000 } }) ]); export function alchemyPotionDefinition (potionKey) { return ALCHEMY_POTION_DEFINITIONS[potionKey] ?? null; } export function listAlchemyPotions () { return Object.values(ALCHEMY_POTION_DEFINITIONS); }