diff --git a/modules/library/comp_configure.go b/modules/library/comp_configure.go index dcca4b8d5..6b9f12e19 100644 --- a/modules/library/comp_configure.go +++ b/modules/library/comp_configure.go @@ -15,6 +15,7 @@ const ( game_libraryhistory = "game_libraryhistory.json" // 往事id 对应的奖励 game_libraryfavor = "game_libraryfavor.json" // 英雄好感度升级所需的经验 game_librarystory = "game_librarystory.json" // 羁绊id对应剧情奖励 + game_favornum = "game_favornum.json" // 羁绊id对应经验 ) ///配置管理基础组件 @@ -31,16 +32,17 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp game_libraryhistory: cfg.NewGameLibraryHistory, game_libraryfavor: cfg.NewGameLibraryFavor, game_librarystory: cfg.NewGameLibraryStory, + game_favornum: cfg.NewGameFavorNum, }) this.fetter = make(map[int64]*cfg.GameLibraryFetterData, 0) configure.RegisterConfigure(game_libraryfetter, cfg.NewGameLibraryFetter, this.SetLibraryFetter) - // _data := this.GetLibraryStory(101) - // fmt.Printf("%v", _data) - // _data1 := this.GetLibraryFavor(2) - // fmt.Printf("%v", _data1) + _data := this.GetFavorNum("10016") + fmt.Printf("%v", _data) + _data1 := this.GetLibraryFavor(3) + fmt.Printf("%v", _data1) // _data2 := this.GetLibraryHistory("350011") // fmt.Printf("%v", _data2) return @@ -90,10 +92,12 @@ func (this *configureComp) GetLibraryHero(hid string) (data *cfg.GameLibraryHero return } -func (this *configureComp) GetLibraryFavor(id int32) (data *cfg.GameLibraryFavorData) { +func (this *configureComp) GetLibraryFavor(star int32) (data []int32) { if v, err := this.GetConfigure(game_libraryfavor); err == nil { if configure, ok := v.(*cfg.GameLibraryFavor); ok { - data = configure.Get(id) + for _, v := range configure.GetDataList() { + data = append(data, v.Expneed) + } } } else { log.Errorf("GetLibraryFavor conf err:%v", err) @@ -122,3 +126,15 @@ func (this *configureComp) GetLibraryStory(fid int32) (data *cfg.GameLibraryStor } return } + +// 获取羁绊英雄经验数据 +func (this *configureComp) GetFavorNum(cid string) (data *cfg.GameFavorNumData) { + if v, err := this.GetConfigure(game_favornum); err == nil { + if configure, ok := v.(*cfg.GameFavorNum); ok { + data = configure.Get(cid) + } + } else { + log.Errorf("GetLibraryStory conf err:%v", err) + } + return +}