Add ranged combat area effects and admin-authored mobs
This commit is contained in:
@@ -35,6 +35,7 @@ type ItemRequirements struct {
|
||||
Titles []string `json:"titles" yaml:"titles"`
|
||||
}
|
||||
type ItemDefinition struct {
|
||||
AttackID string `json:"attackId,omitempty" yaml:"attackId"`
|
||||
ID string `json:"id" yaml:"id"`
|
||||
Name string `json:"name" yaml:"name"`
|
||||
Description string `json:"description" yaml:"description"`
|
||||
@@ -45,6 +46,7 @@ type ItemDefinition struct {
|
||||
Modifiers []StatModifier `json:"modifiers" yaml:"modifiers"`
|
||||
}
|
||||
type Catalog struct {
|
||||
Combat *CombatContent `json:"combat,omitempty"`
|
||||
Gathering *GatheringContent `json:"gathering,omitempty"`
|
||||
Version int64 `json:"version"`
|
||||
Titles []Title `json:"titles"`
|
||||
@@ -124,6 +126,9 @@ func (item ItemDefinition) Validate() error {
|
||||
return ValidateModifiers(item.Modifiers)
|
||||
}
|
||||
func (c Catalog) Validate() error {
|
||||
if err := c.validateCombat(); err != nil {
|
||||
return err
|
||||
}
|
||||
if c.Gathering != nil {
|
||||
if err := c.Gathering.Validate(); err != nil {
|
||||
return err
|
||||
@@ -196,5 +201,5 @@ func DefaultCatalog() (Catalog, error) {
|
||||
if err != nil {
|
||||
return Catalog{}, err
|
||||
}
|
||||
return Catalog{Gathering: b.Gathering, Version: 1, Titles: b.Titles, Items: b.Items, Stats: *b.Stats}, nil
|
||||
return Catalog{Combat: b.Combat, Gathering: b.Gathering, Version: 1, Titles: b.Titles, Items: b.Items, Stats: *b.Stats}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user