Complete player stats inventory and Control content editors
This commit is contained in:
@@ -31,7 +31,9 @@ func (w *World) orderedCharacters() []*Character {
|
||||
}
|
||||
|
||||
func (w *World) restoreProgression(c *Character) error {
|
||||
if c.StatsVersion < 0 || c.StatsVersion > 1 { return errors.New("unsupported character stats version") }
|
||||
if c.StatsVersion < 0 || c.StatsVersion > 1 {
|
||||
return errors.New("unsupported character stats version")
|
||||
}
|
||||
if c.View.Level == 0 {
|
||||
c.View.Level = 1
|
||||
}
|
||||
@@ -45,7 +47,9 @@ func (w *World) restoreProgression(c *Character) error {
|
||||
c.View.StatPoints += (c.View.Level - 1) * (w.Balance.Progression.StatPointsPerLevel - rules.StatPointsPerLevel)
|
||||
}
|
||||
// Preserve any older, more generous grant curve rather than deleting points.
|
||||
if rules.StatPointsPerLevel < w.Balance.Progression.StatPointsPerLevel { rules.StatPointsPerLevel = w.Balance.Progression.StatPointsPerLevel }
|
||||
if rules.StatPointsPerLevel < w.Balance.Progression.StatPointsPerLevel {
|
||||
rules.StatPointsPerLevel = w.Balance.Progression.StatPointsPerLevel
|
||||
}
|
||||
rules.StaminaPerLevel = w.Balance.Progression.StaminaPerLevel
|
||||
rules.VitalPointsPerChoice = w.Balance.Progression.VitalPointsPerChoice
|
||||
c.Progression = &rules
|
||||
@@ -69,6 +73,11 @@ func (w *World) restoreProgression(c *Character) error {
|
||||
if c.View.Titles == nil {
|
||||
c.View.Titles = []p.TitleAward{}
|
||||
}
|
||||
for i := range c.View.Titles {
|
||||
if c.View.Titles[i].Effects.Modifiers == nil {
|
||||
c.View.Titles[i].Effects.Modifiers = []p.StatModifier{}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user