From 48743209f5b60c23af7aa74f0beb846020cbda43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Tue, 3 Feb 2026 19:10:14 +0800 Subject: [PATCH] 1 --- modules/config/service/pet_fusion_service.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/config/service/pet_fusion_service.go b/modules/config/service/pet_fusion_service.go index 093e0b21..b2759db1 100644 --- a/modules/config/service/pet_fusion_service.go +++ b/modules/config/service/pet_fusion_service.go @@ -4,7 +4,6 @@ import ( "blazing/cool" "blazing/modules/config/model" - "github.com/alpacahq/alpacadecimal" "github.com/gogf/gf/v2/database/gdb" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/util/grand" @@ -29,13 +28,17 @@ func NewPetFusionService() *PetFusionService { //获取主副精灵融合的id,如果不存在,那就给一个保底的id func (s *PetFusionService) Data(p1, p2, rand uint32) uint32 { - rand = uint32(alpacadecimal.NewFromInt(int64(rand)).Mul(alpacadecimal.NewFromFloat(0.5)).IntPart()) + + if !grand.Meet(int((rand)/2), 100) { + return 0 + + } pet := s.getData(p1, p2) for _, v := range pet { rr := grand.Intn(100) - if rr < int(v.Probability+int32(rand)) { + if rr < int(v.Probability) { return uint32(v.ResultPetID) } }