/** 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; export const DYE_CAULDRON_SLOT_COUNT = 6; /** Deterministic cauldron look lines (hashed from the step transcript). */ export const CAULDRON_FLAVOR_LINES = Object.freeze([ "The liquid is bubbling", "The liquid is sizzling", "The liquid is still", "The liquid is murky", "The liquid is swirling", "The liquid is glowing", "The liquid is fuming", "The liquid is boiling" ]); export const CAULDRON_EMPTY_FLAVOR = "The cauldron is empty"; /** * 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). * Step `insert` is once per ingredient addition; quantity lives in `ingredients`. */ export const ALCHEMY_POTION_DEFINITIONS = Object.freeze({ lesserHealthTonic: Object.freeze({ potionKey: "lesserHealthTonic", displayName: "Lesser health tonic", minAlchemyLevel: 1, color: Object.freeze({ r: 0.95, g: 0.38, b: 0.32 }), fillLevel: 4, ingredients: Object.freeze([ Object.freeze({ key: "thyme", quantity: 1 }), Object.freeze({ key: "mint", quantity: 1 }) ]), steps: Object.freeze([ Object.freeze({ kind: AlchemyStepKind.insert, itemKey: "thyme" }), Object.freeze({ kind: AlchemyStepKind.heat }), Object.freeze({ kind: AlchemyStepKind.insert, itemKey: "mint" }), Object.freeze({ kind: AlchemyStepKind.stir }) ]), effect: Object.freeze({ type: "health-regen", amountPerSecond: 1, durationMs: 10_000 }) }), lesserHasteDraught: Object.freeze({ potionKey: "lesserHasteDraught", displayName: "Lesser haste draught", minAlchemyLevel: 1, color: Object.freeze({ r: 0.45, g: 0.85, b: 0.75 }), fillLevel: 4, ingredients: Object.freeze([ Object.freeze({ key: "mint", quantity: 2 }), Object.freeze({ key: "lavender", quantity: 1 }) ]), steps: Object.freeze([ Object.freeze({ kind: AlchemyStepKind.insert, itemKey: "mint" }), Object.freeze({ kind: AlchemyStepKind.heat }), Object.freeze({ kind: AlchemyStepKind.stir }), Object.freeze({ kind: AlchemyStepKind.insert, itemKey: "lavender" }), Object.freeze({ kind: AlchemyStepKind.cool }) ]), effect: Object.freeze({ type: "stamina-regen", amountPerSecond: 1, durationMs: 10_000 }) }), strengthPotion: Object.freeze({ potionKey: "strengthPotion", displayName: "Strength potion", minAlchemyLevel: 1, color: Object.freeze({ r: 0.82, g: 0.32, b: 0.18 }), fillLevel: 4, ingredients: Object.freeze([ Object.freeze({ key: "thyme", quantity: 3 }), Object.freeze({ key: "nettle", quantity: 2 }) ]), steps: Object.freeze([ Object.freeze({ kind: AlchemyStepKind.insert, itemKey: "thyme" }), Object.freeze({ kind: AlchemyStepKind.stir }), Object.freeze({ kind: AlchemyStepKind.insert, itemKey: "nettle" }), Object.freeze({ kind: AlchemyStepKind.heat }) ]), effect: Object.freeze({ type: "strength-bonus", amount: 5, durationMs: 60_000 }) }), clarityPotion: Object.freeze({ potionKey: "clarityPotion", displayName: "Clarity potion", minAlchemyLevel: 1, color: Object.freeze({ r: 0.55, g: 0.45, b: 0.92 }), fillLevel: 4, ingredients: Object.freeze([ Object.freeze({ key: "rosemary", quantity: 1 }), Object.freeze({ key: "chamomile", quantity: 2 }) ]), steps: Object.freeze([ Object.freeze({ kind: AlchemyStepKind.insert, itemKey: "rosemary" }), Object.freeze({ kind: AlchemyStepKind.cool }), Object.freeze({ kind: AlchemyStepKind.insert, itemKey: "chamomile" }), Object.freeze({ kind: AlchemyStepKind.stir }) ]), effect: Object.freeze({ type: "mind-bonus", amount: 5, durationMs: 60_000 }) }) }); /** * Failure (unstable) potions chosen by hashing the step transcript. */ export const UNSTABLE_POTION_EFFECTS = Object.freeze([ Object.freeze({ effectKey: "stamina-drain", displayName: "Unstable draught", color: { r: 0.55, g: 0.2, b: 0.35 }, fillLevel: 3, effect: Object.freeze({ type: "stamina-drain", amountPerSecond: 1, durationMs: 15_000 }) }), Object.freeze({ effectKey: "glow", displayName: "Unstable draught", color: { r: 0.95, g: 0.9, b: 0.45 }, fillLevel: 3, effect: Object.freeze({ type: "glow", lightRadiusTiles: 2, durationMs: 10_000 }) }), Object.freeze({ effectKey: "shrink", displayName: "Unstable draught", color: { r: 0.7, g: 0.55, b: 0.85 }, fillLevel: 2, effect: Object.freeze({ type: "shrink", scale: 0.5, durationMs: 30_000 }) }), Object.freeze({ effectKey: "blind", displayName: "Unstable draught", color: { r: 0.12, g: 0.12, b: 0.16 }, fillLevel: 3, effect: Object.freeze({ type: "blind", durationMs: 20_000 }) }) ]); export function alchemyPotionDefinition (potionKey) { return ALCHEMY_POTION_DEFINITIONS[potionKey] ?? null; } export function listAlchemyPotions () { return Object.values(ALCHEMY_POTION_DEFINITIONS); }