import { ItemCategory } from "./itemCategories.js"; import { MaterialTier, GatherMaterialId } 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+). * IDs 11 / 12 / 25 are cotton fibre / yarn / cloth (see clothItems.js). */ export const CraftingItemId = Object.freeze({ tinderbox: 10, copperOre: 13, bronzeBar: 14, rawMeat: 15, cookedMeat: 16, leather: 17, arrowTip: 18, arrow: 19, bronzeAxe: 20, bronzePickaxe: 21, fishingRod: 22, fishingNet: 23, rawFish: 24, tinOre: 53 }); function stub (itemId, key, displayName, category, extra = {}) { return Object.freeze({ itemId, key, displayName, description: extra.description ?? "An unfinished good awaiting a proper name.", 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.tinderbox]: stub(CraftingItemId.tinderbox, "tinderbox", "Tinderbox", ItemCategory.tool, { stackable: false, maxStackSize: 1, description: "A small kit for striking sparks onto dry tinder." }), [CraftingItemId.copperOre]: Object.freeze({ itemId: CraftingItemId.copperOre, key: "copper-ore", displayName: "Copper ore", description: "Reddish copper ore. Smelt with tin at a furnace into bronze bars.", seedValue: 5, stackable: true, maxStackSize: DEFAULT_STACK, uniqueInstance: false, category: ItemCategory.ingredient, iconKey: "metal", defaultState: "ore", tier: GatherMaterialId.copper, tintFromTier: true }), [CraftingItemId.tinOre]: Object.freeze({ itemId: CraftingItemId.tinOre, key: "tin-ore", displayName: "Tin ore", description: "Pale tin ore. Smelt with copper at a furnace into bronze bars.", seedValue: 5, stackable: true, maxStackSize: DEFAULT_STACK, uniqueInstance: false, category: ItemCategory.ingredient, iconKey: "metal", defaultState: "ore", tier: GatherMaterialId.tin, tintFromTier: true }), [CraftingItemId.bronzeBar]: Object.freeze({ itemId: CraftingItemId.bronzeBar, key: "bronze-bar", displayName: "Bronze bar", description: "A solid bronze bar, ready for the anvil.", seedValue: 4, stackable: true, maxStackSize: DEFAULT_STACK, uniqueInstance: false, category: ItemCategory.intermediate, iconKey: "metal", defaultState: "bar", tier: MaterialTier.bronze, tintFromTier: true }), [CraftingItemId.rawMeat]: stub(CraftingItemId.rawMeat, "raw-meat", "Raw meat", ItemCategory.ingredient, { description: "Fresh meat. Cook at an oven or campfire." }), [CraftingItemId.cookedMeat]: stub(CraftingItemId.cookedMeat, "cooked-meat", "Cooked meat", ItemCategory.food, { description: "Meat roasted until tender." }), [CraftingItemId.leather]: stub(CraftingItemId.leather, "leather", "Leather", ItemCategory.ingredient, { description: "Cured hide, stout enough for armour and straps." }), [CraftingItemId.arrowTip]: stub(CraftingItemId.arrowTip, "arrow-tip", "Arrow tip", ItemCategory.intermediate, { description: "A sharp tip waiting to be fletched onto a shaft." }), [CraftingItemId.arrow]: stub(CraftingItemId.arrow, "arrow", "Arrow", ItemCategory.finished, { description: "A fletched arrow for the bow." }), [CraftingItemId.bronzeAxe]: Object.freeze({ itemId: CraftingItemId.bronzeAxe, key: "bronze-axe", displayName: "Bronze axe", description: "A bronze axe for felling trees.", seedValue: 8, stackable: false, maxStackSize: 1, uniqueInstance: false, category: ItemCategory.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: "A bronze pickaxe for breaking stone and ore.", 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: "A simple rod and line for still waters." }), [CraftingItemId.fishingNet]: stub(CraftingItemId.fishingNet, "fishing-net", "Fishing net", ItemCategory.tool, { stackable: false, maxStackSize: 1, description: "A woven net for scooping fish." }), [CraftingItemId.rawFish]: stub(CraftingItemId.rawFish, "raw-fish", "Raw fish", ItemCategory.ingredient, { description: "A fresh catch. Cook at an oven or campfire." }) });