From 09d325dcf5e779eab5550d3fd3377bde50101428 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 8 Jul 2026 19:59:14 -0400 Subject: feat: unify on use, on look, and on kill. all support same conditions/actions now. --- internal/object/object.go | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'internal/object/object.go') diff --git a/internal/object/object.go b/internal/object/object.go index 47243ad..fb93b98 100644 --- a/internal/object/object.go +++ b/internal/object/object.go @@ -2,37 +2,30 @@ package object import "thehouseoficarus/internal/behavior" -type UseInteraction struct { - Item string `yaml:"item_id"` - Condition *behavior.Condition `yaml:"condition"` - Message string `yaml:"message"` - Action *behavior.NodeAction `yaml:"action"` -} - 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"` + 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"` - UseInteractions []UseInteraction `yaml:"use_interactions"` - Steal *ObjectSteal `yaml:"steal,omitempty"` + 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.NodeAction `yaml:"on_look,omitempty"` + OnLook []behavior.Interaction `yaml:"on_look,omitempty"` } type SafespotConfig struct { -- cgit v1.2.3