diff options
| author | historia <[not public]> | 2026-06-11 04:46:27 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-11 08:58:37 +0000 |
| commit | 1b9e2da3b3c438d8dc53d3489725dd5ba0022777 (patch) | |
| tree | 62264f24420bf4cfaa734942c65cc8dd45ba3d3b /internal/world/room.go | |
| parent | 06c02a697e5daf8832a462de5970dd4c0e13a02c (diff) | |
| download | thehouseoficarus-1b9e2da3b3c438d8dc53d3489725dd5ba0022777.tar.gz | |
feat: web client, get/drop updates and fixes
Diffstat (limited to 'internal/world/room.go')
| -rw-r--r-- | internal/world/room.go | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/internal/world/room.go b/internal/world/room.go index 58fa82b..46fb876 100644 --- a/internal/world/room.go +++ b/internal/world/room.go @@ -73,10 +73,29 @@ type Room struct { Exits map[ExitDir]ExitDef `yaml:"exits"` Objects []RoomObject `yaml:"objects"` Spawns []SpawnDef `yaml:"spawns"` - Mobs []string `yaml:"mobs"` + Mobs []RoomMob `yaml:"mobs"` OnEnter []EnterStep `yaml:"on_enter"` } +type RoomMob struct { + ID string `yaml:"id"` + WanderRooms []int `yaml:"wander_rooms"` + WanderInterval int `yaml:"wander_interval"` +} + +func (rm *RoomMob) UnmarshalYAML(value *yaml.Node) error { + if value.Kind == yaml.ScalarNode { + var s string + if err := value.Decode(&s); err != nil { + return err + } + rm.ID = s + return nil + } + type raw RoomMob + return value.Decode((*raw)(rm)) +} + type EnterStep struct { Message string `yaml:"message"` Condition *action.Condition `yaml:"condition"` |
