diff --git a/modules/horoscope/configure.go b/modules/horoscope/configure.go index cdda46846..ddeb4dc04 100644 --- a/modules/horoscope/configure.go +++ b/modules/horoscope/configure.go @@ -42,3 +42,22 @@ func (this *configureComp) getHoroscope(id int32) (result *cfg.GameHoroscopeData } 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 +} diff --git a/modules/horoscope/core.go b/modules/horoscope/core.go index 9afd643f7..20e223f83 100644 --- a/modules/horoscope/core.go +++ b/modules/horoscope/core.go @@ -1 +1,6 @@ -package horoscope \ No newline at end of file +package horoscope + +//加成类型 +const ( + full int32 = 1 //全员加成 +) diff --git a/modules/horoscope/modelhoroscope.go b/modules/horoscope/modelhoroscope.go index eef581066..aecb077d6 100644 --- a/modules/horoscope/modelhoroscope.go +++ b/modules/horoscope/modelhoroscope.go @@ -6,6 +6,7 @@ import ( "go_dreamfactory/lego/sys/mgo" "go_dreamfactory/modules" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" ) ///星座图 数据组件 @@ -39,3 +40,27 @@ func (this *modelHoroscope) updateInfo(info *pb.DBHoroscope) (err error) { }) 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 +}