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) } }