aboutsummaryrefslogtreecommitdiff
path: root/internal/object/object.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-08 19:59:14 -0400
committerhistoria <[not public]>2026-07-08 19:59:14 -0400
commit09d325dcf5e779eab5550d3fd3377bde50101428 (patch)
treea433be903aabbf1d2eadce2aacdac12a9eb8dde0 /internal/object/object.go
parent9184377301c2604e003f36426788c032fb0ca524 (diff)
downloadthehouseoficarus-09d325dcf5e779eab5550d3fd3377bde50101428.tar.gz
feat: unify on use, on look, and on kill. all support same conditions/actions now.
Diffstat (limited to 'internal/object/object.go')
-rw-r--r--internal/object/object.go33
1 files changed, 13 insertions, 20 deletions
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 {