From c705ae942573984784ef501bf8198f61f5206ddd Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 9 Jul 2026 05:27:10 -0400 Subject: refactor: simplify yaml, remove support for old scalar fields --- AGENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'AGENTS.md') diff --git a/AGENTS.md b/AGENTS.md index 9016e73..3da4260 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -39,7 +39,7 @@ File prefixes in `internal/game/`: `game.go/cmd_registry.go/tick.go` (core), `co ## Room Scripting - **`on_enter` steps** (`[]behavior.StepAction`): message + optional `condition` + `delay` + any of the shared `StepAction` effects (`set_global_flags`/`set_player_flags`, `give_item`/`take_item`, `teleport`, `heal`, `credits`, `aps_node`, `broadcast`, `broadcast_global`, `spawn_mob`, `despawn_mob`). Timed steps (any non-zero field triggers the timed path) run as scheduled enter sequences; otherwise messages print synchronously. Conditions snapshotted once at entry. Resumes on reconnect if interrupted. -- **Conditional descriptions** (`description: [{text, condition}]`): first passing variant wins. For objects, if no variant matches the object is absent for that player. Accepts plain string or list. +- **Conditional descriptions** (`description: [{text, condition}]`): first passing variant wins. For objects, if no variant matches the object is absent for that player. - **Exits** carry an `on_traverse:` list of `behavior.Interaction` (same shape as on_use) — first passing entry fires AFTER `p.RoomID` is updated to the destination, so `aps_node`/`teleport` resolve against the new room. `ExitDef.Condition` still gates whether the exit is passable at all; each `on_traverse` entry has its own additional `Condition`. ## Data Files @@ -164,7 +164,7 @@ Full field reference in `item/item.go`. Key fields: equip_slot, weapon_type, att ## Places to Be Careful - `startAction` searches objects first, then mobs. Mobs need `behavior:` on YAML def to be interactable. -- Exits: old `north: 2` still works via custom `UnmarshalYAML`. Same for `RoomMob`. +- Exits use a strict `{room: }` map format. - `checkCondition` is the single condition evaluator — shared across exits, talk, on-enter, on_use/on_look (objects), on_kill (mobs), trigger steps. Every interaction type and every timed step shares one condition language. - Object `hidden: true` = not in room listings but still interactable. - Alias expansion happens before command dispatch and can shadow built-ins. -- cgit v1.2.3