fix: 修正宠物面板计算参数
This commit is contained in:
@@ -651,7 +651,7 @@ func GenPetInfo(
|
||||
}
|
||||
|
||||
// ---- 属性计算 ----
|
||||
p.CalculatePetPane(true)
|
||||
p.CalculatePetPane(0)
|
||||
|
||||
p.Update(false)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package model
|
||||
|
||||
import (
|
||||
"blazing/common/data/xmlres"
|
||||
"blazing/common/utils"
|
||||
)
|
||||
|
||||
// 实现获取等级范围内可学习的技能
|
||||
@@ -32,26 +33,30 @@ func (c *PetInfo) calculatePetPanelSize(base, ev uint32, natureCorrect float64)
|
||||
}
|
||||
|
||||
// 计算生成面板,只允许第一次生成超过100,比如boss,不允许额外超过
|
||||
func (p *PetInfo) CalculatePetPane(frist bool) {
|
||||
if !frist {
|
||||
func (p *PetInfo) CalculatePetPane(limit uint32) {
|
||||
// if !frist {
|
||||
|
||||
if p.Level > 100 {
|
||||
// if p.Level > 100 {
|
||||
|
||||
oldlveel := p.Level
|
||||
p.Level = 100
|
||||
defer func() {
|
||||
p.Level = oldlveel
|
||||
}()
|
||||
}
|
||||
// oldlveel := p.Level
|
||||
// p.Level = 100
|
||||
// defer func() {
|
||||
// p.Level = oldlveel
|
||||
// }()
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
naxml := xmlres.NatureRootMap[int(p.Nature)]
|
||||
petxml := xmlres.PetMAP[int(p.ID)]
|
||||
// 计算各项属性
|
||||
level := p.Level
|
||||
if limit > 0 {
|
||||
level = utils.Min(p.Level, 100)
|
||||
}
|
||||
p.MaxHp = p.calculatePetHPPanelSize(
|
||||
uint32(petxml.HP),
|
||||
p.Dv,
|
||||
p.Level,
|
||||
level,
|
||||
p.Ev[0],
|
||||
)
|
||||
p.Hp = p.MaxHp
|
||||
|
||||
Reference in New Issue
Block a user