| 1 | import { SkillId } from "./skills.js"; |
| 2 | |
| 3 | /** Placeable or fixed world stations that gate recipes (blocks / ground objects later). */ |
| 4 | export const CraftingStationId = Object.freeze({ |
| 5 | furnace: "furnace", |
| 6 | spinningWheel: "spinning-wheel", |
| 7 | loom: "loom", |
| 8 | anvil: "anvil", |
| 9 | leatherworkingStation: "leatherworking-station", |
| 10 | craftingBench: "crafting-bench", |
| 11 | woodworkingBench: "woodworking-bench", |
| 12 | oven: "oven", |
| 13 | fireplace: "fireplace" |
| 14 | }); |
| 15 | |
| 16 | /** How long a player-lit campfire stays usable (ms). */ |
| 17 | export const FIREPLACE_DURATION_MS = 10 * 60 * 1000; |
| 18 | |
| 19 | /** Fixed craft action duration at any station (ms). */ |
| 20 | export const CRAFT_DURATION_MS = 2000; |
| 21 | |
| 22 | export const CRAFTING_STATION_DEFINITIONS = Object.freeze({ |
| 23 | [CraftingStationId.furnace]: Object.freeze({ |
| 24 | stationId: CraftingStationId.furnace, |
| 25 | displayName: "Furnace", |
| 26 | skillId: SkillId.smithing, |
| 27 | description: "Smelt gathered ore into metal bars." |
| 28 | }), |
| 29 | [CraftingStationId.spinningWheel]: Object.freeze({ |
| 30 | stationId: CraftingStationId.spinningWheel, |
| 31 | displayName: "Spinning wheel", |
| 32 | skillId: SkillId.tailoring, |
| 33 | description: "Spin wool (from shorn sheep) into thread." |
| 34 | }), |
| 35 | [CraftingStationId.loom]: Object.freeze({ |
| 36 | stationId: CraftingStationId.loom, |
| 37 | displayName: "Loom", |
| 38 | skillId: SkillId.tailoring, |
| 39 | description: "Weave cloth garments." |
| 40 | }), |
| 41 | [CraftingStationId.anvil]: Object.freeze({ |
| 42 | stationId: CraftingStationId.anvil, |
| 43 | displayName: "Anvil", |
| 44 | skillId: SkillId.smithing, |
| 45 | description: "Smith metal items from bars." |
| 46 | }), |
| 47 | [CraftingStationId.leatherworkingStation]: Object.freeze({ |
| 48 | stationId: CraftingStationId.leatherworkingStation, |
| 49 | displayName: "Leatherworking station", |
| 50 | skillId: SkillId.leatherworking, |
| 51 | description: "Craft leather armour and goods." |
| 52 | }), |
| 53 | [CraftingStationId.craftingBench]: Object.freeze({ |
| 54 | stationId: CraftingStationId.craftingBench, |
| 55 | displayName: "Crafting bench", |
| 56 | skillId: SkillId.crafting, |
| 57 | description: "Assemble finished parts (handles + pickaxe/axe heads, later similar kits)." |
| 58 | }), |
| 59 | [CraftingStationId.woodworkingBench]: Object.freeze({ |
| 60 | stationId: CraftingStationId.woodworkingBench, |
| 61 | displayName: "Woodworking bench", |
| 62 | skillId: SkillId.crafting, |
| 63 | description: "Shape logs into handles and other wood components." |
| 64 | }), |
| 65 | [CraftingStationId.oven]: Object.freeze({ |
| 66 | stationId: CraftingStationId.oven, |
| 67 | displayName: "Oven", |
| 68 | skillId: SkillId.cooking, |
| 69 | description: "Cook raw meat; low Cooking risks burning the food." |
| 70 | }), |
| 71 | [CraftingStationId.fireplace]: Object.freeze({ |
| 72 | stationId: CraftingStationId.fireplace, |
| 73 | displayName: "Campfire", |
| 74 | skillId: SkillId.cooking, |
| 75 | description: "Portable cooking like an oven but a higher burn chance.", |
| 76 | portable: true, |
| 77 | maxPerTile: 1, |
| 78 | durationMs: FIREPLACE_DURATION_MS |
| 79 | }) |
| 80 | }); |
| 81 | |
| 82 | export function craftingStationDefinition (stationId) |
| 83 | { |
| 84 | return CRAFTING_STATION_DEFINITIONS[stationId] ?? null; |
| 85 | } |