From c14c2e403c75a913e1a6d962fb6fe64f013adae5 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 1 Jul 2026 22:30:31 -0400 Subject: fix: combat formulas and mob attack types (mobs switch attack styles if safespotting) --- internal/game/sys_science.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'internal/game/sys_science.go') diff --git a/internal/game/sys_science.go b/internal/game/sys_science.go index bded8c4..a616b42 100644 --- a/internal/game/sys_science.go +++ b/internal/game/sys_science.go @@ -25,15 +25,15 @@ const ( ) type ModDef struct { - ID string `yaml:"id"` - Name string `yaml:"name"` - Level int `yaml:"level"` - MaxHit int `yaml:"max_hit"` - BaseXP int `yaml:"base_xp"` - JunkCost map[string]int `yaml:"junk_cost"` - Category ModCategory `yaml:"category"` - Element string `yaml:"element"` - Destination int `yaml:"destination"` + ID string `yaml:"id"` + Name string `yaml:"name"` + Level int `yaml:"level"` + MaxHit int `yaml:"max_hit"` + BaseXP int `yaml:"base_xp"` + JunkCost map[string]int `yaml:"junk_cost"` + Category ModCategory `yaml:"category"` + Element string `yaml:"element"` + Destination int `yaml:"destination"` Sequence []behavior.ModTriggerStep `yaml:"sequence"` } @@ -44,8 +44,7 @@ var modByID map[string]*ModDef func (g *Game) LoadMods() error { dir := filepath.Join(g.DataDir, "modules") AllMods = nil - modByID = make(map[string]*ModDef) - behavior.WalkYAMLDir(dir, func(path, id string, data []byte) error { + if err := behavior.WalkYAMLDir(dir, func(path, id string, data []byte) error { var m ModDef if err := yaml.Unmarshal(data, &m); err != nil { return nil @@ -53,7 +52,9 @@ func (g *Game) LoadMods() error { m.ID = id AllMods = append(AllMods, &m) return nil - }) + }); err != nil { + return err + } modByID = make(map[string]*ModDef, len(AllMods)) for _, m := range AllMods { modByID[m.ID] = m -- cgit v1.2.3