上传星座图代码

This commit is contained in:
liwei1dao 2022-11-01 19:09:06 +08:00
parent f4b5178996
commit e783f1adee
3 changed files with 50 additions and 1 deletions

View File

@ -42,3 +42,22 @@ func (this *configureComp) getHoroscope(id int32) (result *cfg.GameHoroscopeData
} }
return return
} }
//查询阵容表
func (this *configureComp) getHoroscopebylv(grow, lv int32) (result *cfg.GameHoroscopeData, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(game_horoscope); err != nil {
this.module.Errorln(err)
} else {
for _, v := range v.(*cfg.GameHoroscope).GetDataMap() {
if v.GrowType == grow && v.Lv == lv {
result = v
return
}
}
}
err = fmt.Errorf("No found Horoscope grow:%d lv:%d", grow, lv)
return
}

View File

@ -1 +1,6 @@
package horoscope package horoscope
//加成类型
const (
full int32 = 1 //全员加成
)

View File

@ -6,6 +6,7 @@ import (
"go_dreamfactory/lego/sys/mgo" "go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
) )
///星座图 数据组件 ///星座图 数据组件
@ -39,3 +40,27 @@ func (this *modelHoroscope) updateInfo(info *pb.DBHoroscope) (err error) {
}) })
return return
} }
//计算英雄属性
func (this *modelHoroscope) computeHeroNumeric(hero *pb.DBHero) (err error) {
var (
info *pb.DBHoroscope
node *cfg.GameHoroscopeData
)
if info, err = this.queryInfo(hero.Uid); err != nil {
return
}
for k, v := range info.Nodes {
if node, err = this.module.configure.getHoroscopebylv(k, v); err != nil {
return
}
switch node.AddGroup {
case full: //全员加成
// for _, v := range node.Upgrade {
// }
break
}
}
return
}