Add character levels and permanent player titles

This commit is contained in:
dingo
2026-09-07 07:58:34 -04:00
parent 5a48a3c739
commit bc0ffbbbe5
30 changed files with 1594 additions and 62 deletions
+5
View File
@@ -57,6 +57,8 @@ type Balance struct {
StartingKit map[string]int64 `yaml:"startingKit"`
Recipes map[string]Recipe `yaml:"recipes"`
BandageHealing float64 `yaml:"bandageHealing"`
Progression *Progression `yaml:"progression"`
Titles []Title `yaml:"titles"`
}
func Load() (Balance, error) { return Parse(balance) }
@@ -70,6 +72,9 @@ func Parse(data []byte) (Balance, error) {
return b, b.Validate()
}
func (b Balance) Validate() error {
if err := b.validateProgression(); err != nil {
return err
}
v := reflect.ValueOf(b)
for i := 0; i < v.NumField(); i++ {
f := v.Field(i)