1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-07 10:47:19 -05:00

updated d2hero.HeroStatsState

This commit is contained in:
M. Sz 2020-12-16 17:01:26 +01:00
parent 69fc4d30e4
commit dfb3e2705a

View File

@ -10,23 +10,28 @@ type HeroStatsState struct {
Level int `json:"level"` Level int `json:"level"`
Experience int `json:"experience"` Experience int `json:"experience"`
Strength int `json:"strength"`
Energy int `json:"energy"`
Dexterity int `json:"dexterity"`
Vitality int `json:"vitality"` Vitality int `json:"vitality"`
// there are stats and skills points remaining to add. Energy int `json:"energy"`
StatPoints int `json:"statPoints"` Strength int `json:"strength"`
SkillPoints int `json:"skillPoints"` Dexterity int `json:"dexterity"`
Health int `json:"health"` AttackRating int `json:"attackRating"`
MaxHealth int `json:"maxHealth"` DefenseRating int `json:"defenseRating"`
Mana int `json:"mana"`
MaxMana int `json:"maxMana"` MaxStamina int `json:"maxStamina"`
Stamina float64 `json:"-"` // only MaxStamina is saved, Stamina gets reset on entering world Health int `json:"health"`
MaxStamina int `json:"maxStamina"` MaxHealth int `json:"maxHealth"`
Mana int `json:"mana"`
MaxMana int `json:"maxMana"`
FireResistance int `json:"fireResistance"`
ColdResistance int `json:"coldResistance"`
LightningResistance int `json:"lightningResistance"`
PoisonResistance int `json:"poisonResistance"`
// values which are not saved/loaded(computed) // values which are not saved/loaded(computed)
NextLevelExp int `json:"-"` Stamina float64 `json:"-"` // only MaxStamina is saved, Stamina gets reset on entering world
NextLevelExp int `json:"-"`
} }
// CreateHeroStatsState generates a running state from a hero stats. // CreateHeroStatsState generates a running state from a hero stats.
@ -39,8 +44,6 @@ func (f *HeroStateFactory) CreateHeroStatsState(heroClass d2enum.Hero, classStat
Dexterity: classStats.InitDex, Dexterity: classStats.InitDex,
Vitality: classStats.InitVit, Vitality: classStats.InitVit,
Energy: classStats.InitEne, Energy: classStats.InitEne,
StatPoints: 0,
SkillPoints: 0,
MaxHealth: classStats.InitVit * classStats.LifePerVit, MaxHealth: classStats.InitVit * classStats.LifePerVit,
MaxMana: classStats.InitEne * classStats.ManaPerEne, MaxMana: classStats.InitEne * classStats.ManaPerEne,