// Building prototypes (anything placed on the grid: walls, machines, trees, ...). // // Fields: id, name, sprite (required); description, variants (name -> sprite), // solid (true), max_health (100), stations (tags for recipes), construction // ({ materials, tools, skill, xp }), deconstructible (true), on_interact, vars. buildings: [ { id: "floor", name: "Floor", sprite: "sprites/buildings/floor.png", layer: "floor", solid: false, construction: Some({ materials: [("iron_plate", 1)], tools: ["wrench"], xp: 2 }), }, { id: "dark_floor", name: "Dark floor", sprite: "sprites/buildings/dark_floor.png", layer: "floor", solid: false, construction: Some({ materials: [("iron_plate", 1)], tools: ["wrench"], xp: 2 }), }, { id: "plating", name: "Plating", sprite: "sprites/buildings/plating.png", layer: "floor", solid: false, construction: Some({ materials: [("iron_plate", 1)], tools: ["wrench"], xp: 2 }), }, { id: "window", name: "Window", sprite: "sprites/buildings/window.png", construction: Some({ materials: [("iron_plate", 1)], tools: ["wrench"], xp: 3 }), }, { id: "wall", name: "Wall", sprite: "sprites/buildings/wall.png", max_health: 300, construction: Some({ materials: [("iron_plate", 2)], tools: ["wrench"], xp: 5, skill: Some({ skill: "construction", level: 1 }) }), }, { id: "door", name: "Door", sprite: "sprites/buildings/door_closed.png", variants: { "open": "sprites/buildings/door_open.png" }, construction: Some({ materials: [("iron_plate", 2), ("plank", 1)], tools: ["screwdriver"], xp: 10, skill: Some({ skill: "construction", level: 1 }) }), on_interact: Some("door::toggle"), }, { id: "workbench", name: "Workbench", sprite: "sprites/buildings/workbench.png", stations: ["workbench"], construction: Some({ materials: [("plank", 4)], xp: 10, skill: Some({ skill: "carpentry", level: 1 }) }), }, { id: "furnace", name: "Furnace", sprite: "sprites/buildings/furnace.png", description: "Smelts ore. Fuel it with logs.", variants: { "lit": "sprites/buildings/furnace_lit.png" }, construction: Some({ materials: [("iron_ore", 4), ("log", 1)], xp: 10, skill: Some({ skill: "construction", level: 1 }) }), }, { id: "assembler", name: "Assembler", sprite: "sprites/buildings/assembler.png", description: "Assembles tools from parts.", variants: { "active": "sprites/buildings/assembler_active.png" }, construction: Some({ materials: [("iron_plate", 4), ("plank", 2)], tools: ["screwdriver"], xp: 20, skill: Some({ skill: "construction", level: 1 }) }), }, { id: "table", name: "Table", sprite: "sprites/buildings/table.png", construction: Some({ materials: [("plank", 2)], skill: Some({ skill: "carpentry", level: 1 }), xp: 5 }), }, { id: "vending_machine", name: "Vending machine", sprite: "sprites/buildings/vending.png", description: "Dispenses bread while stock lasts.", deconstructible: false, on_interact: Some("vending::dispense"), vars: { "stock": 5 }, }, { id: "stairs_down", name: "Stairs down", sprite: "sprites/buildings/stairs_down.png", description: "Leads to the level below.", solid: false, deconstructible: false, }, { id: "stairs_up", name: "Stairs up", sprite: "sprites/buildings/stairs_up.png", description: "Leads to the level above.", solid: false, deconstructible: false, }, { id: "tree", name: "Tree", sprite: "sprites/buildings/tree.png", deconstructible: false, on_interact: Some("gather::chop"), vars: { "wood": 3 }, }, { id: "ore_rock", name: "Ore rock", sprite: "sprites/buildings/ore_rock.png", deconstructible: false, on_interact: Some("gather::mine"), vars: { "ore": 5 }, }, ]