条件过滤

This commit is contained in:
meixiongfeng 2023-06-20 14:50:09 +08:00
parent 218f1d5665
commit a0393cfc02
2 changed files with 15 additions and 9 deletions

View File

@ -743,7 +743,7 @@ func (this *ModuleBase) FormatRes(res []*cfg.Gameatn) (ret []*cfg.Gameatn) {
} }
} }
for k, v := range attrs { for k, v := range attrs {
if v >= 0 { if v > 0 {
ret = append(ret, &cfg.Gameatn{ ret = append(ret, &cfg.Gameatn{
A: "attr", A: "attr",
T: k, T: k,
@ -753,7 +753,7 @@ func (this *ModuleBase) FormatRes(res []*cfg.Gameatn) (ret []*cfg.Gameatn) {
} }
for k, v := range items { for k, v := range items {
if v >= 0 { if v > 0 {
ret = append(ret, &cfg.Gameatn{ ret = append(ret, &cfg.Gameatn{
A: "item", A: "item",
T: k, T: k,

View File

@ -79,22 +79,28 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
} }
// 是否是精益打造 // 是否是精益打造
if req.Quality > 0 { if req.Quality > 0 {
if len(reelcfg.RefineCos) > 0 {
costRes = append(costRes, reelcfg.RefineCos...) costRes = append(costRes, reelcfg.RefineCos...)
}
bQuality = true bQuality = true
} }
// 校验是不是装备定制打造 // 校验是不是装备定制打造
if req.SuiteId != 0 { if req.SuiteId != 0 {
if req.Position == -1 { if req.Position == -1 {
if len(reelcfg.CustomizedCos1) > 0 {
if errdata = this.module.CheckRes(session, reelcfg.CustomizedCos1); errdata != nil { if errdata = this.module.CheckRes(session, reelcfg.CustomizedCos1); errdata != nil {
return return
} }
costRes = append(costRes, reelcfg.CustomizedCos1...) costRes = append(costRes, reelcfg.CustomizedCos1...)
}
} else { } else {
if len(reelcfg.CustomizedCos2) > 0 {
if errdata = this.module.CheckRes(session, reelcfg.CustomizedCos2); errdata != nil { if errdata = this.module.CheckRes(session, reelcfg.CustomizedCos2); errdata != nil {
return return
} }
costRes = append(costRes, reelcfg.CustomizedCos2...) costRes = append(costRes, reelcfg.CustomizedCos2...)
} }
}
// 随机权重 获取等级 // 随机权重 获取等级
index := this.module.modelStove.GetRandEquipLv(reelcfg.CustomizedLvDistribution) index := this.module.modelStove.GetRandEquipLv(reelcfg.CustomizedLvDistribution)
if int32(len(reelcfg.CustomizedLv)) > index { if int32(len(reelcfg.CustomizedLv)) > index {