diff options
| author | historia <[not public]> | 2026-06-25 15:40:48 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-25 15:40:48 -0400 |
| commit | abd612c15799f604e671e83dc7c410ed2b44185f (patch) | |
| tree | 0597ca92350de73aac2a7cf26b2f2d6595dac0cc /internal/world/hazard.go | |
| parent | 2725e2927a1595c7b100d942d1f14146252adeb7 (diff) | |
| download | thehouseoficarus-abd612c15799f604e671e83dc7c410ed2b44185f.tar.gz | |
slop refactor
Diffstat (limited to 'internal/world/hazard.go')
| -rw-r--r-- | internal/world/hazard.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/world/hazard.go b/internal/world/hazard.go index 1361cff..ac2a6a6 100644 --- a/internal/world/hazard.go +++ b/internal/world/hazard.go @@ -5,8 +5,8 @@ import ( "os" "path/filepath" - "thehouseoficarus/internal/action" "gopkg.in/yaml.v3" + "thehouseoficarus/internal/behavior" ) // HazardDef describes an environmental threat attached to a room (a sandstorm, @@ -29,7 +29,7 @@ type HazardDef struct { MaxHit int `yaml:"max_hit"` Speed float64 `yaml:"speed"` // ticks between hazard rolls WarnMessage string `yaml:"warn_message"` - HitMessage string `yaml:"hit_message"` // accepts a single %d for damage + HitMessage string `yaml:"hit_message"` // accepts a single %d for damage MissMessage string `yaml:"miss_message"` RequiredItem string `yaml:"required_item"` // equipped item that negates the hazard } @@ -38,7 +38,7 @@ type HazardDef struct { func (w *World) LoadHazard(id string) (*HazardDef, error) { w.hazardMu.Lock() if w.hazardPathIndex == nil { - w.hazardPathIndex = action.BuildPathIndex(filepath.Join(w.dataDir, "hazards")) + w.hazardPathIndex = behavior.BuildPathIndex(filepath.Join(w.dataDir, "hazards")) } if def, ok := w.hazardDefs[id]; ok { w.hazardMu.Unlock() @@ -70,7 +70,7 @@ func (w *World) HazardIndex() map[string]bool { w.hazardMu.Lock() defer w.hazardMu.Unlock() if w.hazardPathIndex == nil { - w.hazardPathIndex = action.BuildPathIndex(filepath.Join(w.dataDir, "hazards")) + w.hazardPathIndex = behavior.BuildPathIndex(filepath.Join(w.dataDir, "hazards")) } ids := make(map[string]bool, len(w.hazardPathIndex)) for id := range w.hazardPathIndex { |
