查询章节ID接口
This commit is contained in:
parent
49f034323d
commit
141113f7cf
@ -93,6 +93,8 @@ type (
|
|||||||
ModifyMainlineData(uid string, objId string, data interface{}) (code pb.ErrorCode)
|
ModifyMainlineData(uid string, objId string, data interface{}) (code pb.ErrorCode)
|
||||||
// 检查能不能挑战该关卡
|
// 检查能不能挑战该关卡
|
||||||
CheckChallengeChapter(storyObjId string, uid string, zhangjieID int32) (code pb.ErrorCode)
|
CheckChallengeChapter(storyObjId string, uid string, zhangjieID int32) (code pb.ErrorCode)
|
||||||
|
/// 查询章节ID
|
||||||
|
GetUsermainLineData(uid string) (mainlineId int32)
|
||||||
}
|
}
|
||||||
//任务
|
//任务
|
||||||
ITask interface {
|
ITask interface {
|
||||||
|
@ -132,7 +132,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
|||||||
for {
|
for {
|
||||||
sz := make([]int32, 0)
|
sz := make([]int32, 0)
|
||||||
if cfgDraw.CampPoolStar3 != 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 {
|
if cfgDraw.CampPoolStar4 != 0 {
|
||||||
sz = append(sz, cfgDraw.CampPoolStar4)
|
sz = append(sz, cfgDraw.CampPoolStar4)
|
||||||
|
@ -528,28 +528,6 @@ func (this *ModelHero) RemoveUserHeroInfo(session comm.IUserSession) (err error)
|
|||||||
return
|
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) {
|
func (this *ModelHero) CheckPool(drawCount int32, config *cfg.GameGlobalData) (pools string) {
|
||||||
if config.BasePool1.S <= drawCount && config.BasePool1.E >= drawCount {
|
if config.BasePool1.S <= drawCount && config.BasePool1.E >= drawCount {
|
||||||
return config.BasePool1.P
|
return config.BasePool1.P
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
|
"sort"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Mainline struct {
|
type Mainline struct {
|
||||||
@ -110,3 +111,15 @@ func (this *Mainline) CheckChallengeChapter(storyObjId string, uid string, zhang
|
|||||||
}
|
}
|
||||||
return
|
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
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user