import { ItemCategory } from "./itemCategories.js"; import { MaterialTier } from "./materialTiers.js"; import { EquipmentKind } from "./equipmentKinds.js"; const DEFAULT_STACK = 99; /** * Reserved numeric IDs for gathering, crafting, and cooking content (9–25). * Metal ores/bars/pickaxes above bronze live in metalItems.js (35+). */ export const CraftingItemId = Object.freeze({ log: 9, tinderbox: 10, wool: 11, thread: 12, bronzeOre: 13, bronzeBar: 14, rawMeat: 15, cookedMeat: 16, leather: 17, arrowTip: 18, arrow: 19, bronzeAxe: 20, bronzePickaxe: 21, fishingRod: 22, fishingNet: 23, rawFish: 24, cloth: 25 }); function stub (itemId, key, displayName, category, extra = {}) { return Object.freeze({ itemId, key, displayName, description: extra.description ?? "Placeholder — complete this definition when content rules are set.", seedValue: extra.seedValue ?? 1, stackable: extra.stackable ?? true, maxStackSize: extra.maxStackSize ?? DEFAULT_STACK, uniqueInstance: false, category, stub: true, iconKey: extra.iconKey ?? "paper", ...extra }); } /** Minimal defs so recipes and the craft UI can resolve names/icons before art exists. */ export const CRAFTING_ITEM_STUBS = Object.freeze({ [CraftingItemId.log]: stub(CraftingItemId.log, "log", "Log", ItemCategory.ingredient, { description: "Firewood. Drop on the ground and light with a tinderbox (see Crafting stations)." }), [CraftingItemId.tinderbox]: stub(CraftingItemId.tinderbox, "tinderbox", "Tinderbox", ItemCategory.tool, { stackable: false, maxStackSize: 1, description: "Lights campfires from dropped logs." }), [CraftingItemId.wool]: stub(CraftingItemId.wool, "wool", "Wool", ItemCategory.ingredient, { description: "Shorn from sheep. Spin into thread at a spinning wheel." }), [CraftingItemId.thread]: stub(CraftingItemId.thread, "thread", "Thread", ItemCategory.intermediate, { description: "Spun wool. Used at a loom." }), [CraftingItemId.bronzeOre]: Object.freeze({ itemId: CraftingItemId.bronzeOre, key: "bronze-ore", displayName: "Bronze ore", description: "Mined ore. Smelt at a furnace into bars.", seedValue: 2, stackable: true, maxStackSize: DEFAULT_STACK, uniqueInstance: false, category: ItemCategory.ingredient, iconKey: "ore", defaultState: "ore", tier: MaterialTier.bronze, tintFromTier: true }), [CraftingItemId.bronzeBar]: Object.freeze({ itemId: CraftingItemId.bronzeBar, key: "bronze-bar", displayName: "Bronze bar", description: "Smelted metal. Smith at an anvil.", seedValue: 4, stackable: true, maxStackSize: DEFAULT_STACK, uniqueInstance: false, category: ItemCategory.intermediate, iconKey: "bar", defaultState: "bar", tier: MaterialTier.bronze, tintFromTier: true }), [CraftingItemId.rawMeat]: stub(CraftingItemId.rawMeat, "raw-meat", "Raw meat", ItemCategory.ingredient, { description: "Cook at an oven or campfire." }), [CraftingItemId.cookedMeat]: stub(CraftingItemId.cookedMeat, "cooked-meat", "Cooked meat", ItemCategory.food, { description: "Cooked food. Eating rules TBD." }), [CraftingItemId.leather]: stub(CraftingItemId.leather, "leather", "Leather", ItemCategory.ingredient, { description: "Dropped from certain mobs. Craft leather goods at a leatherworking station." }), [CraftingItemId.arrowTip]: stub(CraftingItemId.arrowTip, "arrow-tip", "Arrow tip", ItemCategory.intermediate, { description: "Smithed tip. Fletch into arrows at a crafting bench." }), [CraftingItemId.arrow]: stub(CraftingItemId.arrow, "arrow", "Arrow", ItemCategory.finished, { description: "Ammunition for bows." }), [CraftingItemId.bronzeAxe]: stub(CraftingItemId.bronzeAxe, "bronze-axe", "Bronze axe", ItemCategory.tool, { stackable: false, maxStackSize: 1, description: "Woodcutting tool.", iconKey: "axe", defaultState: "axe", tintFromTier: true, equipment: Object.freeze({ slot: "weapon", tier: MaterialTier.bronze, kind: EquipmentKind.axeTool }) }), [CraftingItemId.bronzePickaxe]: Object.freeze({ itemId: CraftingItemId.bronzePickaxe, key: "bronze-pickaxe", displayName: "Bronze pickaxe", description: "Mining tool. Bronze may be equipped at any Mining level.", seedValue: 8, stackable: false, maxStackSize: 1, uniqueInstance: false, category: ItemCategory.tool, iconKey: "pickaxe", defaultState: "pickaxe", tintFromTier: true, equipment: Object.freeze({ slot: "weapon", tier: MaterialTier.bronze, kind: EquipmentKind.pickaxeTool }) }), [CraftingItemId.fishingRod]: stub(CraftingItemId.fishingRod, "fishing-rod", "Fishing rod", ItemCategory.tool, { stackable: false, maxStackSize: 1, description: "Fishing tool." }), [CraftingItemId.fishingNet]: stub(CraftingItemId.fishingNet, "fishing-net", "Fishing net", ItemCategory.tool, { stackable: false, maxStackSize: 1, description: "Fishing tool." }), [CraftingItemId.rawFish]: stub(CraftingItemId.rawFish, "raw-fish", "Raw fish", ItemCategory.ingredient, { description: "Caught fish. Cook like raw meat." }), [CraftingItemId.cloth]: stub(CraftingItemId.cloth, "cloth", "Cloth", ItemCategory.intermediate, { description: "Woven fabric. Tailor into clothing at a loom." }) });