Add spells, weapon abilities, and durable corpse resurrection
This commit is contained in:
@@ -35,6 +35,7 @@ type ItemRequirements struct {
|
||||
Titles []string `json:"titles" yaml:"titles"`
|
||||
}
|
||||
type ItemDefinition struct {
|
||||
WeaponType string `json:"weaponType,omitempty" yaml:"weaponType"`
|
||||
CraftPool []CraftStat `json:"craftPool,omitempty" yaml:"craftPool"`
|
||||
CraftRolls int64 `json:"craftRolls,omitempty" yaml:"craftRolls"`
|
||||
AttackID string `json:"attackId,omitempty" yaml:"attackId"`
|
||||
@@ -48,6 +49,7 @@ type ItemDefinition struct {
|
||||
Modifiers []StatModifier `json:"modifiers" yaml:"modifiers"`
|
||||
}
|
||||
type Catalog struct {
|
||||
Powers *PowerContent `json:"powers,omitempty"`
|
||||
Crafting *CraftingContent `json:"crafting,omitempty"`
|
||||
Combat *CombatContent `json:"combat,omitempty"`
|
||||
Gathering *GatheringContent `json:"gathering,omitempty"`
|
||||
@@ -132,6 +134,9 @@ func (item ItemDefinition) Validate() error {
|
||||
return ValidateModifiers(item.Modifiers)
|
||||
}
|
||||
func (c Catalog) Validate() error {
|
||||
if err := c.validatePowers(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := c.validateCrafting(); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -210,5 +215,5 @@ func DefaultCatalog() (Catalog, error) {
|
||||
if err != nil {
|
||||
return Catalog{}, err
|
||||
}
|
||||
return Catalog{Crafting: b.Crafting, Combat: b.Combat, Gathering: b.Gathering, Version: 1, Titles: b.Titles, Items: b.Items, Stats: *b.Stats}, nil
|
||||
return Catalog{Powers: b.Powers, Crafting: b.Crafting, 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