1
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"blazing/modules/dict/service"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
)
|
||||
|
||||
@@ -28,7 +27,7 @@ func NewPetFusionMaterialService() *PetFusionMaterialService {
|
||||
}
|
||||
|
||||
// 获取融合材料的特性,返回两个值,一个是指定的特性,另一个是如果配方没找到的情况下,默认的配置
|
||||
func (s *PetFusionMaterialService) Data(Material1 [4]uint32) uint32 {
|
||||
func (s *PetFusionMaterialService) Data(Material1 [4]uint32) int32 {
|
||||
|
||||
fusions := service.NewDictInfoService().GetData("fusion")
|
||||
|
||||
@@ -58,23 +57,23 @@ func (s *PetFusionMaterialService) Data(Material1 [4]uint32) uint32 {
|
||||
//这时候有可能效果是空的,那么这时候就再次查询默认的特性,保证每次必会生成一个数据库有的特性
|
||||
//也许这个时候的特性配方就是随机从数据库中查找一个特性
|
||||
|
||||
if effect == nil {
|
||||
effect2s := service.NewDictInfoService().GetData("effect")
|
||||
for _, v := range effect2s {
|
||||
return gconv.Uint32(v.Value)
|
||||
}
|
||||
// if effect == nil {
|
||||
// effect2s := service.NewDictInfoService().GetData("effect")
|
||||
// for _, v := range effect2s {
|
||||
// return gconv.Uint32(v.Value)
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
r := grand.Intn(4)
|
||||
switch r {
|
||||
case 0:
|
||||
return effect.Trait1Idx
|
||||
return int32(effect.Trait1Idx)
|
||||
case 1:
|
||||
return effect.Trait2Idx
|
||||
return int32(effect.Trait2Idx)
|
||||
case 2:
|
||||
return effect.Trait3Idx
|
||||
return int32(effect.Trait3Idx)
|
||||
case 3:
|
||||
return effect.Trait4Idx
|
||||
return int32(effect.Trait4Idx)
|
||||
}
|
||||
return 0
|
||||
return -1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user