aboutsummaryrefslogtreecommitdiff
path: root/building_guide/construction.md
blob: fef4a7bcaedb82ec23acd24f24be946a94ab17f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
## Construction

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`).

### Required Objects

**Workbench** (`data/objects/workbench.yaml`) — the station where construction happens:

```yaml
name: workbench
color: "AC"
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** (`data/objects/estate_directory.yaml`) — terminal for homeowners:

```yaml
name: Estate Directory
color: "27"
description:
  - text: "A holographic terminal displaying property records."
inroom_description: "An estate directory terminal stands in the center of the neighborhood."
```

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.

### Tools

**Saw** (`data/items/tools/saw.yaml`) — required for log-to-plank recipes:

```yaml
name: saw
color: "98"
description: "A sharp-toothed saw for cutting planks from logs at a workbench."
tool:
  type: saw
value: 30
```

### Planks (4 tiers)

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."
```

| 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 |

### Furniture

Furniture recipes consume planks at the workbench (no saw needed):

```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
```

```yaml
# 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
```

```yaml
# 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
```

| 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 |

### NPCs

**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:
            messages:
                - "Welcome! I'm selling housing plots for 10 credits. Interested?"
            options:
                - 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: "Thanks!"
                  goto: start
        goodbye:
            messages:
                - "Come back anytime!"
```

**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

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: "A modest but welcoming entrance hall."
exits:
  south: 170
  north: 201
objects:
  - id: workbench
```

Ownership is tracked via player flags. The Estate Directory scans character files for flags
like `owns_house_local_neighborhood` to show registered homeowners.