aboutsummaryrefslogtreecommitdiff
path: root/internal/object/object.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-21 22:19:17 -0400
committerhistoria <[not public]>2026-06-21 22:19:17 -0400
commita3ae1e6aad696f584d138d9363c05dedff136a65 (patch)
tree81e615f7227bc9d1ec79ceefc7311ecde917b074 /internal/object/object.go
parent84072ffe6365ad57c4976e9272762aa6db41de7e (diff)
downloadthehouseoficarus-a3ae1e6aad696f584d138d9363c05dedff136a65.tar.gz
feat: safespot system implemented
Diffstat (limited to 'internal/object/object.go')
-rw-r--r--internal/object/object.go29
1 files changed, 25 insertions, 4 deletions
diff --git a/internal/object/object.go b/internal/object/object.go
index 826a315..12e5585 100644
--- a/internal/object/object.go
+++ b/internal/object/object.go
@@ -24,15 +24,34 @@ type ObjectDef struct {
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"`
+ Gather *action.GatherConfig `yaml:"gather,omitempty"`
+ Talk *action.TalkConfig `yaml:"talk,omitempty"`
+ Use *action.UseConfig `yaml:"use,omitempty"`
+ Safespot *SafespotConfig `yaml:"safespot,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) IsUsable() bool { return d.Use != nil }
-func (d *ObjectDef) IsInteractable() bool { return d.Gather != nil || d.Talk != nil || d.Use != nil }
+func (d *ObjectDef) IsSafespot() bool { return d.Safespot != nil }
+func (d *ObjectDef) IsInteractable() bool { return d.Gather != nil || d.Talk != nil || d.Use != nil || d.Safespot != nil }
func (d *ObjectDef) BehaviorType() string {
switch {
@@ -42,6 +61,8 @@ func (d *ObjectDef) BehaviorType() string {
return "talk"
case d.Use != nil:
return "use"
+ case d.Safespot != nil:
+ return "safespot"
}
return ""
}