feat(pet): 调整宠物融合逻辑以支持等级加成

在宠物融合过程中引入主副宠物等级之和作为随机因子,
并使用 decimal 库进行浮点数计算以提高精度。
调整概率判断逻辑,使融合结果更符合设计预期。
```
This commit is contained in:
2025-12-04 02:32:31 +08:00
parent 08b7553388
commit 166fbad07f
2 changed files with 6 additions and 5 deletions

View File

@@ -44,7 +44,7 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
natureId = int32(Auxpetinfo.Nature)
}
resid := int(service.NewPetFusionService().Data(Mcatchpetinfo.ID, Auxpetinfo.ID))
resid := int(service.NewPetFusionService().Data(Mcatchpetinfo.ID, Auxpetinfo.ID, Mcatchpetinfo.Level+Auxpetinfo.Level))
if resid == 0 {
//todo失败降低等级