aboutsummaryrefslogtreecommitdiff
path: root/skill_plans/construction.md
blob: 17a15339342962c3b625dc3b6fc00cfe6a099dd2 (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
# Construction Skill Plan

## Overview

Construction is a production skill centered around processing logs into planks and assembling furniture. Players gain XP through repetitive crafting at a workbench, with higher-tier logs providing more XP and more valuable outputs.

## Core Loop

1. **Gather logs** via Woodcutting
2. **Process logs into planks** at a workbench (with a saw) or at the sawmill (for credits) or via Plank Make (science mod)
3. **Assemble planks into furniture** at a workbench
4. **Sell furniture** for credits (furniture has higher value than input planks)

## Architecture

### Production System Integration

Construction plugs into the existing unified production system. Recipes use `type: construction`, `station: [workbench]`, and optionally `tool: saw`. The `advanceProduction` function handles the full lifecycle without any construction-specific code.

### Recipe Tiers

**Plank recipes** (4 tiers):
- Regular (Lv1): logs → planks (20 ticks, 5xp)
- Oak (Lv15): oak_logs → oak_planks (20 ticks, 10xp)
- Teak (Lv35): teak_logs → teak_planks (20 ticks, 20xp)
- Mahogany (Lv50): mahogany_logs → mahogany_planks (20 ticks, 30xp)

**Furniture recipes** (7 items across 4 tiers):
- Wooden shelf (Lv4), table (Lv6), chair (Lv8)
- Oak shelf (Lv18), table (Lv20)
- Teak table (Lv38)
- Mahogany table (Lv52)

### Alternative Plank Sources

1. **Sawmill operator** (room 171): Pays credits per log to get planks instantly. Fees: 5/10/20/40 credits. Uses the `sawmill` node action — a custom talk node action that process all logs at once.

2. **Plank Make mod** (Science Lv86): Converts logs to planks at 70% of sawmill cost (3/7/14/28 credits) plus junk cost. Awards both Science XP and Construction XP.

## Player Housing

Houses serve as a private space with a workbench and bank booth. Future expansions will allow adding rooms, furniture placement, and multi-city ownership.

### House Purchase
- Talk to the estate broker at the Construction Site (room 16)
- Cost: 10 credits
- Sets player flag: `owns_house_local_neighborhood: "local_neighborhood"`

### House Access
- Walk north from Construction Site to Local Neighborhood (room 170)
- Use or talk to the Estate Directory
- Enter your house via the directory

### House Rooms
- Room 200: Entrance Hall (charging station)
- Room 201: Workshop (workbench + bank booth)

Rooms are real YAML files in `data/rooms/player_housing/`. The room loader checks this directory as fallback after the main rooms directory.

### Future: Multi-House Support

Each housing area gets a unique player flag:
- `owns_house_local_neighborhood: "local_neighborhood"` → rooms 200-201
- `owns_house_industrial_district: "industrial_district"` → rooms 210-211 (future)
- etc.

The `getOwnedHouseRoom` function maps flag values to room IDs. The directory scans for area-specific flags.

## Files

| File | Purpose |
|------|---------|
| `internal/game/action_production.go` | Added `"construction"` to productionTypes |
| `internal/game/cmd_construct.go` | `doConstruct` command handler |
| `internal/game/cmd_estate_directory.go` | Directory handling + teleport |
| `internal/game/action_talk.go` | Added sawmill node action + `processSawmill` |
| `internal/game/action.go` | Added directory interception in StartAction |
| `internal/game/cmd_look.go` | Added directory handling in doLookTarget |
| `internal/game/science.go` | Added Plank Make mod definition |
| `internal/game/cmd_trigger.go` | Added `triggerPlankMake` handler |
| `internal/game/game.go` | Added `construct`/`make` to command dispatch |
| `internal/action/behavior.go` | Added `Sawmill` field to NodeAction |
| `internal/world/world.go` | Extended LoadRoom to support player_housing dir |
| `internal/player/player.go` | Added `construct_all` option |