package object import "thehouseoficarus/internal/behavior" type ObjectSteal struct { Drops []behavior.DropEntry `yaml:"drops,omitempty"` Level int `yaml:"level"` XP int `yaml:"xp"` Speed float64 `yaml:"speed"` GuardMob string `yaml:"guard_mob,omitempty"` } type ObjectDef struct { ID string `yaml:"id"` Name string `yaml:"name"` Aliases []string `yaml:"aliases"` Color string `yaml:"color"` Hidden bool `yaml:"hidden"` InRoomDescription string `yaml:"inroom_description"` RemovalItem string `yaml:"removal_item"` Description behavior.DescList `yaml:"description"` OnUse []behavior.Interaction `yaml:"on_use,omitempty"` Steal *ObjectSteal `yaml:"steal,omitempty"` Gather *behavior.GatherConfig `yaml:"gather,omitempty"` Talk *behavior.TalkConfig `yaml:"talk,omitempty"` Safespot *SafespotConfig `yaml:"safespot,omitempty"` OnLook []behavior.Interaction `yaml:"on_look,omitempty"` } type SafespotConfig struct { Tier int `yaml:"tier"` MaxBlockSize string `yaml:"max_block_size"` MaxOccupants int `yaml:"max_occupants"` UnsafeChance float64 `yaml:"unsafe_chance"` DecayTicks float64 `yaml:"decay_ticks"` DecayChance float64 `yaml:"decay_chance"` RespawnOnHide bool `yaml:"respawn_on_hide"` RespawnTicks float64 `yaml:"respawn_ticks"` Levels []SafespotLevel `yaml:"levels"` } type SafespotLevel struct { Message string `yaml:"message"` DegradeMessage string `yaml:"degrade_message"` } func (d *ObjectDef) IsGatherable() bool { return d.Gather != nil } func (d *ObjectDef) IsTalkable() bool { return d.Talk != nil } func (d *ObjectDef) IsSafespot() bool { return d.Safespot != nil } func (d *ObjectDef) IsInteractable() bool { return d.Gather != nil || d.Talk != nil || d.Safespot != nil } func (d *ObjectDef) BehaviorType() string { switch { case d.Gather != nil: return "gather" case d.Talk != nil: return "talk" case d.Safespot != nil: return "safespot" } return "" }