From 3a58125d14bb307f861b38c6c5b0a63babde7e08 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 19 Jun 2026 13:28:06 -0400 Subject: feat: all skills kind of implemented, random prototype content added --- worldbuilding_guide/README.md | 2 + worldbuilding_guide/bank.md | 68 ++++++++++++ worldbuilding_guide/construction.md | 208 ++++++++++++++++++++++++++++++++++++ worldbuilding_guide/hacking.md | 71 ++++++++++++ worldbuilding_guide/index.md | 4 + 5 files changed, 353 insertions(+) create mode 100644 worldbuilding_guide/bank.md create mode 100644 worldbuilding_guide/construction.md create mode 100644 worldbuilding_guide/hacking.md (limited to 'worldbuilding_guide') diff --git a/worldbuilding_guide/README.md b/worldbuilding_guide/README.md index b6f6de8..97cf43b 100644 --- a/worldbuilding_guide/README.md +++ b/worldbuilding_guide/README.md @@ -22,4 +22,6 @@ The House of Icarus is data-driven. Everything — rooms, items, mobs, objects, | [Toggles](toggles.md) | Player toggle options (tiny_map, xp_drops, automap, etc.) | | [Search](search.md) | The search command and searchable items | | [Hidden Objects](hidden_objects.md) | Hidden interactive objects | +| [Bank](bank.md) | Bank system — deposit, withdraw, browse, bank booth placement | +| [Construction](construction.md) | Construction skill — planks, furniture, houses, sawmill, Plank Make | | [Tips](tips.md) | Practical tips for building a world | diff --git a/worldbuilding_guide/bank.md b/worldbuilding_guide/bank.md new file mode 100644 index 0000000..0a5ec88 --- /dev/null +++ b/worldbuilding_guide/bank.md @@ -0,0 +1,68 @@ +# Bank System + +The bank system allows players to store items permanently, freeing up inventory space. + +## Objects + +### bank_booth + +A bank terminal that players can interact with. Has no special behavior — the `bank` command checks for any `bank_booth` object in the room. + +```yaml +id: bank_booth +name: bank booth +color: "226" +description: "..." +inroom_description: "A bank booth is set into the wall." +``` + +To place a bank booth in a room, add it to the room's `objects:` list: + +```yaml +objects: + - id: bank_booth +``` + +## Commands + +| Command | Description | +|---------|-------------| +| `bank` | Opens bank interface (requires bank booth in room) | +| `use bank` | Same as `bank` | + +### Bank Interface Commands + +| Command | Description | +|---------|-------------| +| `deposit ` | Move item from inventory to bank | +| `deposit all` | Deposit entire inventory | +| `withdraw ` | Move item from bank to inventory | +| `browse` / `list` | Show bank contents | +| `leave` | Exit bank interface | + +## Implementation + +### Session State + +`StateBank` (defined in `internal/net/server.go`) is the session state for the bank interface. Input is routed through `handleBankInput` in `internal/game/cmd_bank.go`. + +### Player Storage + +Bank items are stored in the `Player.Bank` field (`map[int]*InventorySlot`), saved in character YAML. Bank slots are sequential and reuse freed slots. There is no slot limit. + +### Command Dispatch + +- `bank` is classified as `ClassActive` in `classifyCommand()` +- `bank` case in `executeCommand()` calls `doBank(sess)` +- `doUse()` checks for `"bank"` or `"bank booth"` targets and routes to `doBank()` +- `doBank()` checks for a `bank_booth` object in the current room +- `handleBankInput()` dispatches deposit/withdraw/browse/leave commands + +### Data Files + +| File | Purpose | +|------|---------| +| `data/objects/bank_booth.yaml` | Bank booth object definition | +| `data/help/bank.yaml` | Help topic for the bank system | + +Default bank booth locations: Town Square (room 1), Forge (room 12). diff --git a/worldbuilding_guide/construction.md b/worldbuilding_guide/construction.md new file mode 100644 index 0000000..799057a --- /dev/null +++ b/worldbuilding_guide/construction.md @@ -0,0 +1,208 @@ +# Construction Skill + +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. + +## Skill + +- Skill name: `construction` +- Abbreviation: `con` +- Level range: 1-99 +- XP table: RSC standard + +## Commands + +| Command | Description | +|---------|-------------| +| `construct` / `make` | Open construction menu at a workbench | +| `construct ` | Build a specific item | +| `construct ` | Build multiple of an item | + +## Objects + +### workbench + +The primary construction station. Placed in rooms to enable construction. + +```yaml +id: workbench +name: workbench +color: "172" +description: "A sturdy wooden workbench..." +inroom_description: "A workbench stands against the wall..." +``` + +### 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. + +```yaml +id: estate_directory +name: Estate Directory +color: "39" +description: "A holographic terminal displaying property records..." +inroom_description: "An estate directory terminal..." +``` + +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 + +### saw + +Required tool for cutting logs into planks at the workbench. + +```yaml +id: saw +name: saw +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 | + +### Furniture (sellables) + +| 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 | + +## Recipes + +All recipes use `type: construction` and `station: [workbench]`. Log-to-plank recipes additionally require `tool: saw`. + +Example plank recipe: +```yaml +id: construct_oak_planks +type: construction +level: 15 +xp: 10 +wait: 20 +station: [workbench] +tool: saw +consume: + - items: [oak_logs] + qty: 1 +output: oak_planks +message: "You saw the oak logs into sturdy oak planks." +``` + +Example furniture recipe: +```yaml +id: construct_wooden_table +type: construction +level: 6 +xp: 25 +wait: 6 +station: [workbench] +consume: + - items: [planks] + qty: 3 +output: wooden_table +message: "You build a sturdy wooden table." +``` + +## NPCs + +### estate_broker + +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. + +```yaml +id: estate_broker +name: estate broker +behavior: estate_broker_talk +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_metal. + +```go +{ID: "plank_make", Name: "Plank Make", Level: 86, BaseXP: 90.0, + JunkCost: map[string]int{"naturejunk": 5, "solarjunk": 1, "scrap_metal": 1}, + Category: ModUtility, TargetType: "inventory"}, +``` + +Usage: `trigger plank make` (all logs) or `trigger plank make ` (specific). + +## Player Houses + +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. + +House room files follow the same format as world rooms: +```yaml +id: 200 +name: "Player House: Entrance Hall" +description: "..." +exits: + south: 170 + north: 201 +objects: + - id: charging_station +``` + +The room loader (`World.LoadRoom`) checks `data/rooms/.yaml` first, then falls back to `data/rooms/player_housing/.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"}, +``` + +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) | +| `data/recipes/construct_planks.yaml` - `construct_mahogany_table.yaml` | Construction recipes (11 recipes) | +| `data/mobs/estate_broker.yaml` | Estate broker mob | +| `data/mobs/sawmill_operator.yaml` | Sawmill operator mob | +| `data/behaviors/estate_broker_talk.yaml` | Broker talk behavior | +| `data/behaviors/sawmill_operator_talk.yaml` | Sawmill operator talk behavior | +| `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 | diff --git a/worldbuilding_guide/hacking.md b/worldbuilding_guide/hacking.md new file mode 100644 index 0000000..6f9bf9a --- /dev/null +++ b/worldbuilding_guide/hacking.md @@ -0,0 +1,71 @@ +## Hacking + +Hacking minigames are played by jacking into terminal objects. Terminals are YAML objects that are registered in Go's `terminalDefs` map. + +### Terminal Object YAML + +```yaml +id: terminal_basic +name: basic terminal +color: "40" +description: "A battered terminal with a cracked screen. {40}[Level 1 Hacking]{/}" +inroom_description: "A {40}basic terminal{/} hums quietly against the wall." +``` + +- `id` must match a key in `terminalDefs` (Go code in `internal/game/hacking.go`) +- `name` is used for matching in the `jack` command +- `color` controls the display color +- `description` is shown when examining the terminal +- `inroom_description` is shown in room listings +- No `behavior` field — terminals are registered in Go, not YAML behaviors + +### Adding a New Terminal + +1. Create an object YAML file in `data/objects/terminal_.yaml` +2. Add an entry to `terminalDefs` in `internal/game/hacking.go` +3. Optionally create a new minigame implementation in `internal/game/hacking_.go` +4. Place the terminal object in a room's `objects:` list + +### Adding a New Minigame + +New minigames implement the `HackingMinigame` interface: + +```go +type HackingMinigame interface { + Init(level int) string + HandleInput(input string) (output string, done bool, won bool) + Name() string +} +``` + +Optionally implement `XPBonuser` for bonus XP: + +```go +type XPBonuser interface { + BonusXP() int +} +``` + +### Agility Courses + +Agility courses are defined in `data/courses/.yaml`. Each course defines a sequence of obstacle rooms with specific verbs. + +```yaml +id: "vent_shaft" +name: "Ventilation Shaft Course" +required_level: 1 +start_room: 200 +completion_xp: 40 +obstacles: + - room_id: 201 + verb: scramble + ticks_per_phase: 2 + xp: 8 + fail_damage: [1, 2] + messages: + - "You approach the corroded ventilation wall..." + - "You find footholds in the rusted panels and begin to climb..." + - "You scramble up the wall and haul yourself onto the ledge!" +``` + +Each obstacle room should have an `on_enter` message telling the player which verb to use, and a `down` exit back to the course hub. diff --git a/worldbuilding_guide/index.md b/worldbuilding_guide/index.md index e19c207..9f721cb 100644 --- a/worldbuilding_guide/index.md +++ b/worldbuilding_guide/index.md @@ -8,3 +8,7 @@ | An interactive object (rock, lever, door) | `data/objects/.yaml` | | A behavior (mining, dialog, toggle) | `data/behaviors/.yaml` | | A shared drop table | `data/drops/.yaml` | +| A crafting recipe | `data/recipes/.yaml` | +| A help topic | `data/help/.yaml` | +| An agility course | `data/courses/.yaml` | +| A player house | `data/rooms/player_housing/.yaml` | -- cgit v1.2.3