diff options
| author | historia <[not public]> | 2026-10-03 19:46:54 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-03 19:46:54 -0400 |
| commit | 3a39a020e4449bc4d6f728ef837cffb9f7bd0c56 (patch) | |
| tree | 9ba1cd5f2aef6ef7c54fdf5b02a780604b5af80b /building_guide/hacking.md | |
| parent | c6d4702c0be4d2b37e1d82ff96265c52847c3f9a (diff) | |
| download | thehouseoficarus-3a39a020e4449bc4d6f728ef837cffb9f7bd0c56.tar.gz | |
feat: new casino game: plinko
Diffstat (limited to 'building_guide/hacking.md')
| -rw-r--r-- | building_guide/hacking.md | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/building_guide/hacking.md b/building_guide/hacking.md index dc4372b..b45363f 100644 --- a/building_guide/hacking.md +++ b/building_guide/hacking.md @@ -1,8 +1,8 @@ ## Hacking -Hacking minigames are played by jacking into terminal objects. Terminals are YAML objects that are registered in Go's `terminalDefs` map. - -**The filename is the ID** (`terminal_basic.yaml` → `terminal_basic`); like all objects, the loader derives the ID from the filename — don't add an `id:` field (see `objects.md`). +Hacking minigames are played by jacking into terminal objects. Terminals are YAML +objects; the filename is the ID (`terminal_basic.yaml` → `terminal_basic`), and +like all objects you should not add an `id:` field (see `objects.md`). ### Terminal Object YAML @@ -13,38 +13,20 @@ description: "A battered terminal with a cracked screen. {28}[Level 1 Hacking]{/ inroom_description: "A {28}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_<name>.yaml` -2. Add an entry to `terminalDefs` in `internal/game/hacking.go` -3. Optionally create a new minigame implementation in `internal/game/hacking_<name>.go` -4. Place the terminal object in a room's `objects:` list - -### Adding a New Minigame +- Terminals have no behavior block; each terminal corresponds to a minigame + registered in the game code -New minigames implement the `HackingMinigame` interface: +### Placing a Terminal -```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: +Add the terminal object to a room's `objects:` list: -```go -type XPBonuser interface { - BonusXP() int -} +```yaml +objects: + - id: terminal_basic ``` - +Adding a brand-new hacking minigame is an engine change, not a world-data change. |
