From 0ea4eec5dd2122c6704216971eb1249276297867 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 19 Jun 2026 18:20:26 -0400 Subject: shop fixes, 'toggle' completely removed, movement speed increased --- internal/object/object.go | 48 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) (limited to 'internal/object/object.go') diff --git a/internal/object/object.go b/internal/object/object.go index 8c4c752..4d8db69 100644 --- a/internal/object/object.go +++ b/internal/object/object.go @@ -10,18 +10,38 @@ type UseInteraction struct { } type ObjectDef struct { - ID string `yaml:"id"` - Name string `yaml:"name"` - Color string `yaml:"color"` - BehaviorID string `yaml:"behavior"` - Hidden bool `yaml:"hidden"` - InRoomDescription string `yaml:"inroom_description"` - RemovalItem string `yaml:"removal_item"` - Description string `yaml:"description"` - UseInteractions []UseInteraction `yaml:"use_interactions"` - StealTable string `yaml:"steal_table"` - StealLevel int `yaml:"steal_level"` - StealXP int `yaml:"steal_xp"` - StealSpeed float64 `yaml:"steal_speed"` - GuardMob string `yaml:"guard_mob"` + ID string `yaml:"id"` + Name string `yaml:"name"` + Color string `yaml:"color"` + Hidden bool `yaml:"hidden"` + InRoomDescription string `yaml:"inroom_description"` + RemovalItem string `yaml:"removal_item"` + Description string `yaml:"description"` + UseInteractions []UseInteraction `yaml:"use_interactions"` + StealTable string `yaml:"steal_table"` + StealLevel int `yaml:"steal_level"` + StealXP int `yaml:"steal_xp"` + StealSpeed float64 `yaml:"steal_speed"` + GuardMob string `yaml:"guard_mob"` + + Gather *action.GatherConfig `yaml:"gather,omitempty"` + Talk *action.TalkConfig `yaml:"talk,omitempty"` + Use *action.UseConfig `yaml:"use,omitempty"` +} + +func (d *ObjectDef) IsGatherable() bool { return d.Gather != nil } +func (d *ObjectDef) IsTalkable() bool { return d.Talk != nil } +func (d *ObjectDef) IsUsable() bool { return d.Use != nil } +func (d *ObjectDef) IsInteractable() bool { return d.Gather != nil || d.Talk != nil || d.Use != nil } + +func (d *ObjectDef) BehaviorType() string { + switch { + case d.Gather != nil: + return "gather" + case d.Talk != nil: + return "talk" + case d.Use != nil: + return "use" + } + return "" } -- cgit v1.2.3