diff --git a/comm/imodule.go b/comm/imodule.go index fa30659f3..4dddeeec8 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -93,6 +93,8 @@ type ( ModifyMainlineData(uid string, objId string, data interface{}) (code pb.ErrorCode) // 检查能不能挑战该关卡 CheckChallengeChapter(storyObjId string, uid string, zhangjieID int32) (code pb.ErrorCode) + /// 查询章节ID + GetUsermainLineData(uid string) (mainlineId int32) } //任务 ITask interface { diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index 2363dbf86..26a4f615f 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -132,7 +132,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq for { sz := make([]int32, 0) if cfgDraw.CampPoolStar3 != 0 { - sz = append(sz, cfgDraw.CampPoolStar3) // 3 4 5 性权重 + sz = append(sz, cfgDraw.CampPoolStar3) // 3 4 5 星权重 } if cfgDraw.CampPoolStar4 != 0 { sz = append(sz, cfgDraw.CampPoolStar4) diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index db9da9775..2b2e38843 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -528,28 +528,6 @@ func (this *ModelHero) RemoveUserHeroInfo(session comm.IUserSession) (err error) return } -// 保底抽卡 (参数 卡池id, 返回抽到卡配置id) -func (this *ModelHero) FloorDrawCard(Cardpool int32) (cardId string) { - // _bd, err := this.moduleHero.configure.GetHeroDrawConfig(Cardpool) - // if err == nil && len(_bd) != 0 { - // var _totalW int64 // 总权重 - // var _tmpW int64 // 临时权重 - // for _, v := range _bd { - // _totalW += int64(v.Weight) - // } - // // 随机权重 - // n, _ := rand.Int(rand.Reader, big.NewInt(_totalW)) - // for _, v := range _bd { - // _tmpW += int64(v.Weight) - // if n.Int64() < _tmpW { // 种族保底卡池命中 - // cardId = v.Id - // break - // } - // } - // } - return -} - func (this *ModelHero) CheckPool(drawCount int32, config *cfg.GameGlobalData) (pools string) { if config.BasePool1.S <= drawCount && config.BasePool1.E >= drawCount { return config.BasePool1.P diff --git a/modules/mainline/module.go b/modules/mainline/module.go index 565a7fda4..7b853a96c 100644 --- a/modules/mainline/module.go +++ b/modules/mainline/module.go @@ -5,6 +5,7 @@ import ( "go_dreamfactory/lego/core" "go_dreamfactory/modules" "go_dreamfactory/pb" + "sort" ) type Mainline struct { @@ -110,3 +111,15 @@ func (this *Mainline) CheckChallengeChapter(storyObjId string, uid string, zhang } return } + +func (this *Mainline) GetUsermainLineData(uid string) (mainlineId int32) { + + _szData, err := this.modelMainline.getMainlineList(uid) + if err == nil { + sort.SliceStable(_szData, func(i, j int) bool { // 排序 + return _szData[i].ChapterId > _szData[j].ChapterId + }) + } + + return +}