diff --git a/common/contrib/drivers/mysql/go.mod b/common/contrib/drivers/mysql/go.mod index ff4bf07ad..b9ec4508c 100644 --- a/common/contrib/drivers/mysql/go.mod +++ b/common/contrib/drivers/mysql/go.mod @@ -1,6 +1,6 @@ module blazing/contrib/drivers/mysql -go 1.18 +go 1.20 require ( github.com/gogf/gf/contrib/drivers/mysql/v2 v2.6.3 diff --git a/common/contrib/drivers/pgsql/go.mod b/common/contrib/drivers/pgsql/go.mod index 127f4380a..e6a0699cb 100644 --- a/common/contrib/drivers/pgsql/go.mod +++ b/common/contrib/drivers/pgsql/go.mod @@ -1,6 +1,6 @@ module blazing/contrib/drivers/pgsql -go 1.18 +go 1.20 require ( github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.8.0 diff --git a/common/contrib/files/local/go.mod b/common/contrib/files/local/go.mod index c6f2608b7..b8f4a7cbe 100644 --- a/common/contrib/files/local/go.mod +++ b/common/contrib/files/local/go.mod @@ -1,6 +1,6 @@ module blazing/contrib/files/local -go 1.18 +go 1.20 require github.com/gogf/gf/v2 v2.8.0 diff --git a/common/contrib/files/pngcm/go.mod b/common/contrib/files/pngcm/go.mod index cb07c89ae..a97c9dcff 100644 --- a/common/contrib/files/pngcm/go.mod +++ b/common/contrib/files/pngcm/go.mod @@ -1,6 +1,6 @@ module blazing/contrib/files/pngcm -go 1.18 +go 1.20 require github.com/gogf/gf/v2 v2.8.0 diff --git a/common/go.mod b/common/go.mod index 310cee50e..bffcfa51b 100644 --- a/common/go.mod +++ b/common/go.mod @@ -1,6 +1,6 @@ module blazing/common -go 1.19 +go 1.20 require github.com/panjf2000/gnet v1.6.7 diff --git a/common/utils/bitset/go.mod b/common/utils/bitset/go.mod index 2a2afd41f..834457b3a 100644 --- a/common/utils/bitset/go.mod +++ b/common/utils/bitset/go.mod @@ -1,5 +1,5 @@ module github.com/pointernil/bitset32 -go 1.19 +go 1.20 require github.com/bits-and-blooms/bitset v1.5.0 // direct diff --git a/common/utils/cronex/go.mod b/common/utils/cronex/go.mod index ba50653fa..69834affd 100644 --- a/common/utils/cronex/go.mod +++ b/common/utils/cronex/go.mod @@ -1,6 +1,6 @@ module github.com/antlabs/cronex -go 1.19 +go 1.20 require github.com/antlabs/timer v0.1.4 diff --git a/common/utils/limit/go.mod b/common/utils/limit/go.mod index fed5e3c10..f291a2948 100644 --- a/common/utils/limit/go.mod +++ b/common/utils/limit/go.mod @@ -1,5 +1,5 @@ module github.com/xiaoqidun/limit -go 1.18 +go 1.20 require golang.org/x/time v0.8.0 diff --git a/common/utils/lockfree-1.1.3/go.mod b/common/utils/lockfree-1.1.3/go.mod index dc0488872..100084b9e 100644 --- a/common/utils/lockfree-1.1.3/go.mod +++ b/common/utils/lockfree-1.1.3/go.mod @@ -1,6 +1,6 @@ module github.com/bruceshao/lockfree -go 1.18 +go 1.20 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/logic/go.mod b/logic/go.mod index 5cfe8113c..6fc3443ff 100644 --- a/logic/go.mod +++ b/logic/go.mod @@ -1,6 +1,6 @@ module blazing/logic -go 1.19 +go 1.20 require ( github.com/antlabs/timer v0.1.4 diff --git a/logic/service/fight/input.go b/logic/service/fight/input.go index 868f96b1c..bb07a14f8 100644 --- a/logic/service/fight/input.go +++ b/logic/service/fight/input.go @@ -6,6 +6,7 @@ import ( "blazing/common/utils" "blazing/cool" "blazing/modules/blazing/model" + "blazing/modules/blazing/service" "fmt" "blazing/logic/service/common" @@ -171,16 +172,54 @@ func (f *FightC) initplayer(c common.PlayerI) (*input.Input, errorcode.ErrorCode if len(meetpet) == 0 { initmeetpet() } - for i, v := range meetpet { - v1 := v - if len(in.AllPet) > 2 { - break - } + r := service.NewMELEEService().Def() + + for i, v := range r { + + if v.Lv == 0 { + v.Lv = 100 + + } + // var effect int + // if len(v.Effect) > 0 { + // effect = int(v.Effect[0]) + // } + + pet := model.GenPetInfo(int(v.MonID), 24, int(v.Nature), int(v.Effect[0]), int(v.Lv), nil) + if v.Color != nil { + pet.ShinyInfo = append(pet.ShinyInfo, *v.Color) + + } + if len(v.Prop) == 5 { + + pet.Prop = [5]uint32(v.Prop) + + } + if len(v.SKill) != 0 { + + for i := 0; i < 4; i++ { + if v.SKill[i] != 0 { + pet.SkillList[i].ID = v.SKill[i] + } + + } + + } + pet.CatchTime = c.GetInfo().UserID + uint32(i)*1000000 + pet.Cure() + in.AllPet = append(in.AllPet, info.CreateBattlePetEntity(*pet, f.rand)) - v1.CatchTime = c.GetInfo().UserID + uint32(i)*1000000 - v1.Cure() - in.AllPet = append(in.AllPet, info.CreateBattlePetEntity(v1, f.rand)) } + // for i, v := range meetpet { + // v1 := v + // if len(in.AllPet) > 2 { + // break + // } + + // v1.CatchTime = c.GetInfo().UserID + uint32(i)*1000000 + // v1.Cure() + // in.AllPet = append(in.AllPet, info.CreateBattlePetEntity(v1, f.rand)) + // } //in.AllPet = in.AllPet[:3] default: diff --git a/login/go.mod b/login/go.mod index 289f80a9b..417ba12c4 100644 --- a/login/go.mod +++ b/login/go.mod @@ -1,6 +1,6 @@ module blazing/login -go 1.19 +go 1.20 require ( github.com/gogf/gf/contrib/nosql/redis/v2 v2.8.0 diff --git a/modules/blazing/model/melee.go b/modules/blazing/model/melee.go index 0a17ff7bf..d2e38de7b 100644 --- a/modules/blazing/model/melee.go +++ b/modules/blazing/model/melee.go @@ -32,7 +32,7 @@ type MeleeConfig struct { Nature uint32 `gorm:"not null;default:0;comment:'BOSS属性-性格'" json:"nature"` SKill []uint32 `gorm:"type:jsonb;not null;default:'[]';comment:'BOSS技能'" json:"skill"` Effect []uint32 `gorm:"type:jsonb;not null;default:'[]';comment:'BOSS特性'" json:"effect"` - Color string `gorm:"not null;default:'0';comment:'BOSS颜色'" json:"color"` + Color *string `gorm:"comment:'BOSS颜色'" json:"color"` IsEnable uint32 `gorm:"not null;default:0;comment:'是否启用'" json:"is_enable"` // ISMELEE uint32 `gorm:"not null;default:0;comment:'是否乱斗配置'" json:"is_melee"` @@ -82,10 +82,7 @@ type MeleeConfig struct { // MeleeConfigEX 扩展BOSS配置模型(用于前端/业务层的数组格式解析) type MeleeConfigEX struct { MeleeConfig - Color GlowFilter `json:"color"` - ISboss uint32 `gorm:"not null;default:0;comment:'是否是Boss'" json:"is_boss"` - - ISgift uint32 `gorm:"not null;default:0;comment:'是否是礼物'" json:"is_gif"` + Color *GlowFilter `json:"color"` } // TableName 指定MeleeConfig对应的数据库表名 diff --git a/modules/blazing/service/melee.go b/modules/blazing/service/melee.go index cc40c2b38..7a74cc630 100644 --- a/modules/blazing/service/melee.go +++ b/modules/blazing/service/melee.go @@ -16,3 +16,14 @@ func NewMELEEService() *MELEEService { }, } } +func (s *MELEEService) Def() []model.MeleeConfigEX { + + var pets []model.MeleeConfigEX + m := cool.DBM(s.Model) + + m.OrderRandom().Limit(3).Scan(&pets) + + return pets + // return ret.Interface().([]model.PetFusion) + +} diff --git a/modules/blazing/service/pet_fusion_material_service.go b/modules/blazing/service/pet_fusion_material_service.go index 9acb400a2..e59806b8e 100644 --- a/modules/blazing/service/pet_fusion_material_service.go +++ b/modules/blazing/service/pet_fusion_material_service.go @@ -49,10 +49,10 @@ func (s *PetFusionMaterialService) Data(Material1 [4]uint32) uint32 { var effect *model.PetFusionMaterial //一个特性应该是唯一的,但是我们要获取默认随机特性 condition := g.Map{ - "material1": fusions[Material1[0]].ID, - "material2": fusions[Material1[1]].ID, - "material3": fusions[Material1[2]].ID, - "material4": fusions[Material1[3]].ID, + "material1": Material1[0], + "material2": Material1[1], + "material3": Material1[2], + "material4": Material1[3], "is_enable": 1, } m.Where(condition).Cache(gdb.CacheOption{ diff --git a/modules/dict/go.mod b/modules/dict/go.mod index 03a2b0ce0..a577e7509 100644 --- a/modules/dict/go.mod +++ b/modules/dict/go.mod @@ -1,6 +1,6 @@ module blazing/modules/dict -go 1.18 +go 1.20 require github.com/gogf/gf/v2 v2.8.0 diff --git a/modules/go.mod b/modules/go.mod index 8e6527ef9..0580c335f 100644 --- a/modules/go.mod +++ b/modules/go.mod @@ -1,6 +1,6 @@ module blazing/modules -go 1.19 +go 1.20 require ( ) diff --git a/modules/space/go.mod b/modules/space/go.mod index f95928b68..6f84d34f9 100644 --- a/modules/space/go.mod +++ b/modules/space/go.mod @@ -1,6 +1,6 @@ module blazing/modules/space -go 1.18 +go 1.20 require github.com/gogf/gf/v2 v2.8.0 diff --git a/modules/task/go.mod b/modules/task/go.mod index 54110b998..efd8428e0 100644 --- a/modules/task/go.mod +++ b/modules/task/go.mod @@ -1,6 +1,6 @@ module blazing/modules/task -go 1.18 +go 1.20 require ( github.com/gogf/gf/v2 v2.8.0