1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-03 19:10:14 +08:00
parent f49c38e6d4
commit 48743209f5

View File

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