diff options
| author | historia <[not public]> | 2026-06-24 20:58:25 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-24 20:58:25 -0400 |
| commit | 9d4b799db4868bcab291b83599ff088763cd4ed6 (patch) | |
| tree | 252f0fcc779acf35243983d643d6399ee2e0cd0b /internal/world/room.go | |
| parent | d25638d98fe63efdeab570ef77e6a6a97f2d7a60 (diff) | |
| download | thehouseoficarus-9d4b799db4868bcab291b83599ff088763cd4ed6.tar.gz | |
feat: new type of non-violent 'combat': work
Diffstat (limited to 'internal/world/room.go')
| -rw-r--r-- | internal/world/room.go | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/internal/world/room.go b/internal/world/room.go index 752ec41..2441c30 100644 --- a/internal/world/room.go +++ b/internal/world/room.go @@ -48,6 +48,8 @@ type ExitDef struct { Room int `yaml:"room"` Condition *action.Condition `yaml:"condition"` BlockedMessage string `yaml:"blocked_message"` + SetFlags map[string]any `yaml:"set_flags"` + SetPlayerFlags map[string]any `yaml:"set_player_flags"` } func (e *ExitDef) UnmarshalYAML(value *yaml.Node) error { @@ -67,11 +69,18 @@ type Room struct { ID int `yaml:"id"` Name string `yaml:"name"` Description string `yaml:"description"` + Descriptions []RoomDesc `yaml:"descriptions,omitempty"` Exits map[ExitDir]ExitDef `yaml:"exits"` Objects []RoomObject `yaml:"objects"` ItemSpawns []SpawnDef `yaml:"item_spawns"` Mobs []RoomMob `yaml:"mobs"` OnEnter []EnterStep `yaml:"on_enter"` + Hazard string `yaml:"hazard"` +} + +type RoomDesc struct { + Text string `yaml:"text"` + Condition *action.Condition `yaml:"condition"` } type RoomMob struct { @@ -94,8 +103,19 @@ func (rm *RoomMob) UnmarshalYAML(value *yaml.Node) error { } type EnterStep struct { - Message string `yaml:"message"` - Condition *action.Condition `yaml:"condition"` + Message string `yaml:"message"` + Condition *action.Condition `yaml:"condition"` + Delay int `yaml:"delay"` + SetFlags map[string]any `yaml:"set_flags"` + SetPlayerFlags map[string]any `yaml:"set_player_flags"` +} + +// IsTimed reports whether the step carries cutscene semantics: a tick delay or +// a flag mutation. A room whose qualifying on_enter steps are all non-timed is +// printed synchronously; any timed step turns the sequence into a scheduled +// cutscene. +func (e EnterStep) IsTimed() bool { + return e.Delay > 0 || len(e.SetFlags) > 0 || len(e.SetPlayerFlags) > 0 } type RoomObject struct { |
