Add ranged combat area effects and admin-authored mobs
This commit is contained in:
@@ -19,6 +19,8 @@ type Recipe struct {
|
||||
}
|
||||
|
||||
type Balance struct {
|
||||
Combat *CombatContent `yaml:"combat"`
|
||||
CombatRules *CombatRules `yaml:"combatRules"`
|
||||
Gathering *GatheringContent `yaml:"gathering"`
|
||||
GatheringRules *GatheringRules `yaml:"gatheringRules"`
|
||||
Version int `yaml:"version"`
|
||||
@@ -78,6 +80,14 @@ func Parse(data []byte) (Balance, error) {
|
||||
return b, b.Validate()
|
||||
}
|
||||
func (b Balance) Validate() error {
|
||||
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 {
|
||||
return err
|
||||
}
|
||||
if b.Gathering != nil {
|
||||
if err := b.Gathering.Validate(); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user