Add durable recipe discovery and profession crafting

This commit is contained in:
dingo
2026-09-09 13:28:07 -04:00
parent 940a345613
commit b65f3e8562
42 changed files with 2183 additions and 136 deletions
+5 -1
View File
@@ -19,6 +19,7 @@ type Recipe struct {
}
type Balance struct {
Crafting *CraftingContent `yaml:"crafting"`
Combat *CombatContent `yaml:"combat"`
CombatRules *CombatRules `yaml:"combatRules"`
Gathering *GatheringContent `yaml:"gathering"`
@@ -80,12 +81,15 @@ func Parse(data []byte) (Balance, error) {
return b, b.Validate()
}
func (b Balance) Validate() error {
if err := (Catalog{Crafting: b.Crafting, Items: b.Items, Titles: b.Titles, Gathering: b.Gathering}).validateCrafting(); err != nil {
return err
}
if b.CombatRules != nil {
if err := b.CombatRules.Validate(); err != nil {
return err
}
}
if err := (Catalog{Combat: b.Combat, Items: b.Items, Gathering: b.Gathering}).validateCombat(); err != nil {
if err := (Catalog{Crafting: b.Crafting, Combat: b.Combat, Items: b.Items, Gathering: b.Gathering}).validateCombat(); err != nil {
return err
}
if b.Gathering != nil {