fix(fight): 修正空变更导致的潜在逻辑问题

This commit is contained in:
1
2025-12-02 02:50:20 +00:00
parent b000747536
commit e694848c0d
2 changed files with 17 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ import (
"blazing/logic/service/player"
"blazing/modules/blazing/model"
"blazing/modules/blazing/service"
"github.com/shopspring/decimal"
)
func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result *pet.PetFusionInfo, err errorcode.ErrorCode) {
@@ -50,7 +52,10 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
}
effect := int(service.NewPetFusionMaterialService().Data(data.Item1))
r := model.GenPetInfo(resid, -1, int(natureId), effect, -1, 1)
dv1 := decimal.NewFromInt(2).Div(decimal.NewFromInt(3)).Mul(decimal.NewFromInt(int64(Mcatchpetinfo.Dv)))
dv2 := decimal.NewFromInt(1).Div(decimal.NewFromInt(3)).Mul(decimal.NewFromInt(int64(Auxpetinfo.Dv)))
dv := dv1.Add(dv2).Add(decimal.NewFromInt(1)).IntPart()
r := model.GenPetInfo(resid, int(dv), int(natureId), effect, -1, 1)
c.Service.Pet.PetAdd(*r)
c.Pet_del(Auxpetinfo.CatchTime)
c.Pet_del(Mcatchpetinfo.CatchTime)