aboutsummaryrefslogtreecommitdiff
path: root/building_guide/construction.md
diff options
context:
space:
mode:
Diffstat (limited to 'building_guide/construction.md')
-rw-r--r--building_guide/construction.md307
1 files changed, 150 insertions, 157 deletions
diff --git a/building_guide/construction.md b/building_guide/construction.md
index dd63fd7..fef4a7b 100644
--- a/building_guide/construction.md
+++ b/building_guide/construction.md
@@ -1,216 +1,209 @@
-# Construction Skill
+## Construction
-The Construction skill allows players to process logs into planks and assemble planks into furniture at a workbench. Higher-tier logs produce more valuable planks and furniture.
+The Construction skill lets players saw logs into planks and assemble planks into furniture at a
+workbench. Recipes live on the output item's YAML via the `craft:` block — just like every other
+crafting skill (see `recipes.md`).
-> **Filenames are IDs.** The item/object YAML shown below have no `id:` field — each file's name is its ID (e.g. `construct_oak_planks.yaml` → `construct_oak_planks`). See `items.md` / `objects.md`.
+### Required Objects
-## Skill
-
-- Skill name: `construction`
-- Abbreviation: `con`
-- Level range: 1-99
-- XP table: classic standard
-
-## Commands
-
-| Command | Description |
-|---------|-------------|
-| `construct` / `make` | Open construction menu at a workbench |
-| `construct <item>` | Build a specific item |
-| `construct <qty> <item>` | Build multiple of an item |
-
-## Objects
-
-### workbench
-
-The primary construction station. Placed in rooms to enable construction.
+**Workbench** (`data/objects/workbench.yaml`) — the station where construction happens:
```yaml
name: workbench
color: "AC"
-description: "A sturdy wooden workbench..."
-inroom_description: "A workbench stands against the wall..."
+description:
+ - text: "A sturdy wooden workbench covered in sawdust, nails, and blueprints."
+inroom_description: "A workbench stands against the wall, cluttered with tools and wood shavings."
```
-### estate_directory
-
-A terminal that shows registered homeowners and lets them enter their house. Handled entirely in Go code (`internal/game/cmd_estate_directory.go`), not via YAML behaviors.
+**Estate Directory** (`data/objects/estate_directory.yaml`) — terminal for homeowners:
```yaml
name: Estate Directory
color: "27"
-description: "A holographic terminal displaying property records..."
-inroom_description: "An estate directory terminal..."
+description:
+ - text: "A holographic terminal displaying property records."
+inroom_description: "An estate directory terminal stands in the center of the neighborhood."
```
-When a player looks at the directory, it scans `data/players/characters/*.yaml` for the `owns_house_local_neighborhood` player flag and lists all homeowners. When a player uses or talks to the directory and owns a house, they can teleport to their house entrance room.
-
-## Tools
+The directory is handled by Go code: when a player looks at or uses it, it scans character
+YAML files for the `owns_house_local_neighborhood` player flag and lets homeowners teleport
+into their house.
-### saw
+### Tools
-Required tool for cutting logs into planks at the workbench.
+**Saw** (`data/items/tools/saw.yaml`) — required for log-to-plank recipes:
```yaml
name: saw
-tool_type: saw
+color: "98"
+description: "A sharp-toothed saw for cutting planks from logs at a workbench."
+tool:
+ type: saw
value: 30
```
-## Items
-
### Planks (4 tiers)
-| Item ID | Name | Level | Value | Made From |
-|---------|------|-------|-------|-----------|
-| `planks` | planks | 1 | 20 | logs |
-| `oak_planks` | oak planks | 15 | 40 | oak_logs |
-| `teak_planks` | teak planks | 35 | 80 | teak_logs |
-| `mahogany_planks` | mahogany planks | 50 | 120 | mahogany_logs |
+Recipes on each plank item convert logs into planks at the workbench with a saw:
+
+```yaml
+# data/items/materials/planks.yaml
+name: planks
+color: "89"
+value: 20
+craft:
+ - type: construction
+ level: 1
+ xp: 5
+ ticks_per_cycle: 20
+ station: [workbench]
+ tool: saw
+ ingredients:
+ - items: [logs]
+ quantity: 1
+ success_message: "You saw the logs into %n."
+```
+
+```yaml
+# data/items/materials/oak_planks.yaml
+name: oak planks
+color: "66"
+value: 40
+craft:
+ - type: construction
+ level: 15
+ xp: 10
+ ticks_per_cycle: 20
+ station: [workbench]
+ tool: saw
+ ingredients:
+ - items: [oak_logs]
+ quantity: 1
+ success_message: "You saw the oak logs into %n."
+```
-### Furniture (sellables)
+| Item | Level | Logs → | Value |
+|------|-------|--------|-------|
+| `planks` | 1 | `logs` | 20 |
+| `oak_planks` | 15 | `oak_logs` | 40 |
+| `teak_planks` | 35 | `teak_logs` | 80 |
+| `mahogany_planks` | 50 | `mahogany_logs` | 120 |
-| Item ID | Level | Planks Required |
-|---------|-------|-----------------|
-| `wooden_shelf` | 4 | 2 planks |
-| `wooden_table` | 6 | 3 planks |
-| `wooden_chair` | 8 | 2 planks |
-| `oak_shelf` | 18 | 2 oak planks |
-| `oak_table` | 20 | 3 oak planks |
-| `teak_table` | 38 | 3 teak planks |
-| `mahogany_table` | 52 | 3 mahogany planks |
+### Furniture
-## Recipes
+Furniture recipes consume planks at the workbench (no saw needed):
-All recipes use `type: construction` and `station: [workbench]`. Log-to-plank recipes additionally require `tool: saw`.
+```yaml
+# data/items/misc/wooden_chair.yaml
+name: wooden chair
+color: "82"
+value: 35
+craft:
+ - type: construction
+ level: 8
+ xp: 30
+ ticks_per_cycle: 6
+ station: [workbench]
+ ingredients:
+ - items: [planks]
+ quantity: 2
+```
-Example plank recipe:
```yaml
-type: construction
-level: 15
-xp: 10
-wait: 20
-station: [workbench]
-tool: saw
-consume:
- - items: [oak_logs]
- quantity: 1
-output: oak_planks
-message: "You saw the oak logs into sturdy oak planks."
+# data/items/misc/wooden_table.yaml
+name: wooden table
+color: "82"
+value: 50
+craft:
+ - type: construction
+ level: 6
+ xp: 25
+ ticks_per_cycle: 6
+ station: [workbench]
+ ingredients:
+ - items: [planks]
+ quantity: 3
```
-Example furniture recipe:
```yaml
-type: construction
-level: 6
-xp: 25
-wait: 6
-station: [workbench]
-consume:
- - items: [planks]
- quantity: 3
-output: wooden_table
-message: "You build a sturdy wooden table."
+# data/items/misc/oak_table.yaml
+name: oak table
+color: "5E"
+value: 100
+craft:
+ - type: construction
+ level: 20
+ xp: 50
+ ticks_per_cycle: 6
+ station: [workbench]
+ ingredients:
+ - items: [oak_planks]
+ quantity: 3
```
-## NPCs
+| Item | Level | Planks | XP |
+|------|-------|--------|----|
+| `wooden_shelf` | 4 | 2 planks | 15 |
+| `wooden_table` | 6 | 3 planks | 25 |
+| `wooden_chair` | 8 | 2 planks | 30 |
+| `oak_shelf` | 18 | 2 oak planks | 35 |
+| `oak_table` | 20 | 3 oak planks | 50 |
+| `teak_table` | 38 | 3 teak planks | 75 |
+| `mahogany_table` | 52 | 3 mahogany planks | 100 |
-### estate_broker
+### NPCs
-Located in room 16 (Construction Site). Talk behavior sells a house plot for 10 credits via `cost` + `set_player_flags`. Sets `owns_house_local_neighborhood: "local_neighborhood"` on purchase.
+**Estate Broker** — sells a house plot for 10 credits. Talk node action uses `credits` (negative = charge) and `set_player_flags`:
```yaml
name: estate broker
+protected: true
+unique: true
talk:
nodes:
start:
- message: "\"Interested in a house?\""
+ messages:
+ - "Welcome! I'm selling housing plots for 10 credits. Interested?"
options:
- - text: "\"How much?\""
- goto: offer
- - text: "\"No thanks.\""
- offer:
- message: "\"10 credits for a plot.\""
- action:
- cost: 10
- set_player_flags:
- owns_house_local_neighborhood: "local_neighborhood"
+ - text: "Yes, I'd like to buy a house."
+ condition:
+ player_flag: owns_house_local_neighborhood
+ not: true
+ action:
+ credits: -10
+ set_player_flags:
+ owns_house_local_neighborhood: local_neighborhood
+ goto: purchased
+ - text: "No thanks."
+ goto: goodbye
+ purchased:
+ messages:
+ - "The plot is yours. Use the Estate Directory to enter."
options:
- - text: "\"Deal!\""
-unique: true
-```
-
-### sawmill_operator
-
-Located in room 171 (Lumberyard). Talk behavior processes all logs in inventory into planks for a credit fee. Uses the `sawmill: true` node action which triggers `processSawmill()` in `internal/game/action_talk.go`.
-
-Fees: regular (5cr), oak (10cr), teak (20cr), mahogany (40cr).
-
-## Science Mod: Plank Make
-
-Level 86 Science utility mod that converts logs to planks at 70% of sawmill cost. Uses naturejunk, solarjunk, and scrap.
-
-```go
-{ID: "plank_make", Name: "Plank Make", Level: 86, BaseXP: 90.0,
- JunkCost: map[string]int{"naturejunk": 5, "solarjunk": 1, "scrap": 1},
- Category: ModUtility, TargetType: "inventory"},
+ - text: "Thanks!"
+ goto: start
+ goodbye:
+ messages:
+ - "Come back anytime!"
```
-Usage: `trigger plank make` (all logs) or `trigger plank make <log type>` (specific).
-
-## Player Houses
+**Sawmill Operator** — converts logs to planks for credits via dialog. Fees per log: regular (5cr), oak (10cr), teak (20cr), mahogany (40cr). Use option conditions with `any_of` + `has_item` to gate the "process my logs" choice.
-Player houses are real YAML rooms stored in `data/rooms/player_housing/`. Each house area (e.g. Local Neighborhood) has entrance + workshop rooms with unique room IDs in the 200+ range.
+### Player Houses
+Player houses are real YAML rooms in `data/rooms/player_housing/`. Each area has entrance + workshop rooms.
House room files follow the same format as world rooms:
+
```yaml
name: "Player House: Entrance Hall"
-description: "..."
+description: "A modest but welcoming entrance hall."
exits:
south: 170
north: 201
objects:
- - id: charging_station
-```
-
-The room loader (`World.LoadRoom`) checks `data/rooms/<id>.yaml` first, then falls back to `data/rooms/player_housing/<id>.yaml`.
-
-Ownership is tracked via player flags (e.g. `owns_house_local_neighborhood: "local_neighborhood"`). The Estate Directory scans character YAML files for these flags.
-
-## Implementation
-
-### Production Integration
-
-Construction is added to `productionTypes` in `action_production.go`:
-```go
-"construction": {"construct", "constructing"},
+ - id: workbench
```
-This enables automatic support through the unified production system (`advanceProduction`, `startProductionFromRecipe`, etc.).
-
-### Command
-
-`cmd_construct.go` follows the same pattern as `cmd_craft.go`, using per-recipe `Station` and `Tool` checks. Station: `workbench`, Tool: `saw` (for plank recipes only).
-
-### Option
-
-`construct_all` (OptBool, default false): Auto-start construction when only one product is available.
-
-## Data File Summary
-
-| Path | Purpose |
-|------|---------|
-| `data/objects/workbench.yaml` | Workbench station object |
-| `data/objects/estate_directory.yaml` | Directory terminal object |
-| `data/items/saw.yaml` | Saw tool |
-| `data/items/planks.yaml` - `mahogany_planks.yaml` | Plank items (4 tiers) |
-| `data/items/wooden_shelf.yaml` - `mahogany_table.yaml` | Furniture items (7 items) |
-| Item YAMLs with `craft:` blocks (planks, furniture) | Construction recipes — inline on output item YAML |
-| `data/mobs/estate_broker.yaml` | Estate broker mob (talk inline) |
-| `data/mobs/sawmill_operator.yaml` | Sawmill operator mob (talk inline) |
-| `data/rooms/16.yaml` | Construction Site (updated) |
-| `data/rooms/170.yaml` | Local Neighborhood |
-| `data/rooms/171.yaml` | Lumberyard |
-| `data/rooms/player_housing/200.yaml` | Player house entrance |
-| `data/rooms/player_housing/201.yaml` | Player house workshop |
-| `data/help/construct.yaml` | Help topic |
+Ownership is tracked via player flags. The Estate Directory scans character files for flags
+like `owns_house_local_neighborhood` to show registered homeowners.