diff options
| author | historia <[not public]> | 2026-06-10 01:48:28 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-10 01:48:28 -0400 |
| commit | a226d72e51eecb768b13600303f73483118d9104 (patch) | |
| tree | 458d15ef049732c15dacc591a830d3beddbedfde /internal/action/behavior.go | |
| parent | 6a0f3d7a252de4b1741cfe5e1c561412c602becc (diff) | |
| download | thehouseoficarus-a226d72e51eecb768b13600303f73483118d9104.tar.gz | |
feat: implemented janky object interaction model
Diffstat (limited to 'internal/action/behavior.go')
| -rw-r--r-- | internal/action/behavior.go | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/internal/action/behavior.go b/internal/action/behavior.go new file mode 100644 index 0000000..d7f683a --- /dev/null +++ b/internal/action/behavior.go @@ -0,0 +1,68 @@ +package action + +type GatherConfig struct { + Skill string `yaml:"skill"` + Level int `yaml:"level"` + BaseWait int `yaml:"base_wait"` + Tool string `yaml:"tool"` + Success SuccessFormula `yaml:"success"` + GatherMsg string `yaml:"gather_message"` + FailMsg string `yaml:"fail_message"` + Drops []DropEntry `yaml:"drops"` + DepleteDelay int `yaml:"deplete_delay"` + RespawnMsg string `yaml:"respawn_message"` + RespawnBroadcast string `yaml:"respawn_broadcast"` +} + +type SuccessFormula struct { + Base float64 `yaml:"base"` + PerLevel float64 `yaml:"per_level"` + Cap float64 `yaml:"cap"` +} + +type TalkConfig struct { + Nodes map[string]TalkNode `yaml:"nodes"` +} + +type TalkNode struct { + Message string `yaml:"message"` + Options []TalkOption `yaml:"options"` + Action *NodeAction `yaml:"action"` +} + +type TalkOption struct { + Text string `yaml:"text"` + Goto string `yaml:"goto"` + End bool `yaml:"end"` + Condition *Condition `yaml:"condition"` +} + +type NodeAction struct { + SetFlags map[string]any `yaml:"set_flags"` + GiveItem string `yaml:"give_item"` + TakeItem string `yaml:"take_item"` +} + +type Condition struct { + Flag string `yaml:"flag"` + Value any `yaml:"value"` + Not bool `yaml:"not"` + HasItem string `yaml:"has_item"` +} + +type UseConfig struct { + Message string `yaml:"message"` + Wait int `yaml:"wait"` + Consume map[string]int `yaml:"consume"` + Reward DropEntry `yaml:"reward"` + FailMsg string `yaml:"fail_message"` + Success *SuccessFormula `yaml:"success"` + Skill string `yaml:"skill"` + Level int `yaml:"level"` +} + +type ToggleConfig struct { + Message string `yaml:"message"` + SetFlags map[string]any `yaml:"set_flags"` + Check *Condition `yaml:"check"` +} |
