From 1b9e2da3b3c438d8dc53d3489725dd5ba0022777 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 11 Jun 2026 04:46:27 -0400 Subject: feat: web client, get/drop updates and fixes --- internal/world/room.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'internal/world/room.go') 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"` -- cgit v1.2.3