diff options
Diffstat (limited to 'worldbuilding_guide/objects.md')
| -rw-r--r-- | worldbuilding_guide/objects.md | 95 |
1 files changed, 86 insertions, 9 deletions
diff --git a/worldbuilding_guide/objects.md b/worldbuilding_guide/objects.md index 1c1aebb..a7da5e6 100644 --- a/worldbuilding_guide/objects.md +++ b/worldbuilding_guide/objects.md @@ -1,39 +1,116 @@ ## Objects -Object defined — links to a behavior: +Objects interact with the world through **inline behavior configs** under +`gather:`, `talk:`, or `use:` keys. There is no separate behavior +directory — everything goes directly in the object's YAML. + +Gathering object (mining): ```yaml id: copper_rock name: copper rock color: "178" # xterm-256 color index (0-255) -behavior: mine_copper +gather: + skill: mining + level: 1 + xp: 17 + base_wait: 8 + tools: + - pickaxe + success: + base: 0.40 + per_level: 0.01 + cap: 0.95 + gather_message: "You swing your pickaxe at the rock..." + fail_message: "You chip away but get nothing useful." + drops: + - item_id: copper_ore + weight: 90 + depletes: true + message: "You manage to mine some {178}copper ore{/}." + - table: gem_table + weight: 10 + depletes: false + message: "You spot a glint of something valuable!" + respawn_timer: 50 + respawn_broadcast: "A glint of copper catches your eye from some {name}." ``` -Tree object: +Tree object (woodcutting with shared depletion): ```yaml id: oak_tree name: oak tree color: "113" -behavior: chop_oak +gather: + skill: woodcutting + level: 15 + xp: 37 + base_wait: 6 + tools: + - axe + success: + base: 0.40 + per_level: 0.01 + cap: 0.90 + gather_message: "You swing your axe at the oak tree..." + fail_message: "You swing but get no logs." + drops: + - item_id: oak_logs + weight: 100 + depletes: false + message: "You get some {113}oak logs{/}." + respawn_timer: 14 + deplete_timer: 45 + nest_chance: 256 + respawn_broadcast: "An {name} grows back." ``` -Color accepts xterm-256 indices with optional modifiers (`bold`, `dim`, `underline`) and gradients (`g:196,82`). In ANSI mode, extended colors downgrade to the nearest ANSI color. +Color accepts xterm-256 indices with optional modifiers (`bold`, `dim`, `underline`) +and gradients (`g:196,82`). In ANSI mode, extended colors downgrade to the nearest +ANSI color. -Hidden object — doesn't appear in room's object list, only discoverable via description or experimentation: +Object interaction (gate, lever — uses `use_interactions:` key): ```yaml id: iron_gate name: iron gate -behavior: iron_gate_toggle hidden: true description: "A heavy iron gate set into the north wall." +use_interactions: + - condition: + flag: gate_open + value: true + not: true + message: "You push the heavy iron gate open." + action: + set_flags: + gate_open: true ``` -Decorative object (no behavior): +Decorative object (no behavior keys — just a name/description): ```yaml id: lumby_fountain name: town fountain description: "Clear water sparkles in the sunlight." ``` +Talk object (NPC conversations — uses `talk:` key): +```yaml +id: tool_shed +name: Tool Shed +description: "A small shed with an open window." +talk: + nodes: + start: + message: "\"Welcome to the tool shed!\"" + options: + - text: "\"What do you have?\"" + goto: shop + - text: "\"Goodbye.\"" + end: true +``` + +See the [Talk section of behaviors](behaviors.md#talk-dialog-trees) for the full +dialog tree format. See [Stealable Objects](#stealable-objects) for theft mechanics. + --- ## Use Interactions @@ -90,7 +167,7 @@ use_interactions: | Field | Type | Description | | ----------- | ---------- | ------------------------------------------------ | | `item` | string | Item ID that triggers this interaction | -| `condition` | Condition | Optional condition (same as exits/talk/toggle) | +| `condition` | Condition | Optional condition (same as exits/talk/use_interactions) | | `message` | string | Message shown to the player | | `action` | NodeAction | Optional actions (same as talk node actions) | |
