This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user