feat(fight): 调整精灵切换逻辑与属性计算流程

移除 OnOwnerSwitchIn 和 OnOwnerSwitchOut 接口定义及调用逻辑,
简化精灵切换时的效果触发机制。

调整 PetInfo 属性计算方法中 Hp 与 MaxHp 的赋值顺序,
确保初始化时 Hp 值正确设置。
This commit is contained in:
2025-11-08 01:07:37 +08:00
parent 06cd6199b0
commit 28bef2cf98
4 changed files with 8 additions and 19 deletions

View File

@@ -282,7 +282,6 @@ func GenPetInfo(
// ---- 属性计算 ----
p.CalculatePetPane()
p.Hp = p.MaxHp
p.Update(true)

View File

@@ -34,12 +34,13 @@ func (p *PetInfo) CalculatePetPane() {
naxml := xmlres.NatureRootMap[int(p.Nature)]
petxml := xmlres.PetMAP[int(p.ID)]
// 计算各项属性
hp := p.calculatePetHPPanelSize(
p.MaxHp = p.calculatePetHPPanelSize(
uint32(petxml.HP),
p.Dv,
p.Level,
p.Ev[0],
)
p.Hp = p.MaxHp
// * battle_lv: atk(0), def(1), sp_atk(2), sp_def(3), spd(4), accuracy(5)
p.Prop[0] = p.calculatePetPanelSize(
uint32(petxml.Atk),
@@ -81,6 +82,4 @@ func (p *PetInfo) CalculatePetPane() {
naxml.SpeedCorrect,
)
// 设置计算结果
p.MaxHp = hp
}