获取指定装备接口

This commit is contained in:
meixiongfeng 2023-02-21 14:50:06 +08:00
parent 45e97a5927
commit d6a8833394
5 changed files with 18 additions and 12 deletions

View File

@ -6,7 +6,7 @@
"star": 3,
"race": 1,
"id": "35006",
"weight": 1000
"weight": 10000
},
{
"key": 2,

View File

@ -153,6 +153,13 @@ type (
GetActionableEquipments(uid string) (code pb.ErrorCode, eruips []*pb.DB_Equipment)
//获取可用套装 (铁匠铺使用)
GetActionableSuit(uid string) (code pb.ErrorCode, Suit []int32)
// 随机获得一件N级的装备装备
/*
suiteId: 套装id
pos: 位置(-1 表示随机位置 大于0 表示获得指定位置 )
lv: 装备等级
*/
GetForgeEquip(suiteId int32, pos int32, lv int32) (eruip *pb.DB_Equipment, code pb.ErrorCode)
}
IMainline interface {
ModifyMainlineDataByNanduID(uid string, nandu, id int32) (code pb.ErrorCode)

View File

@ -136,12 +136,9 @@ func (this *configureComp) SetHeroDrawConfig() {
err error
)
if v, err = this.GetConfigure(hero_drawcard); err == nil {
if _configure, ok := v.(*cfg.GameDrawCard); !ok {
err = fmt.Errorf("%T no is *cfg.Game_drawCard", v)
return
} else {
if _configure, ok := v.(*cfg.GameDrawCard); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
this.drawCardCfg = make(map[string]map[int32][]*cfg.GameDrawCardData, 0)
for _, v := range _configure.GetDataList() {
if _, ok := this.drawCardCfg[v.CardPoolType]; !ok {
this.drawCardCfg[v.CardPoolType] = make(map[int32][]*cfg.GameDrawCardData, 0)
@ -151,13 +148,15 @@ func (this *configureComp) SetHeroDrawConfig() {
}
this.drawCardCfg[v.CardPoolType][v.Star] = append(this.drawCardCfg[v.CardPoolType][v.Star], v)
}
}
} else {
err = fmt.Errorf("%T no is *cfg.Game_drawCard", v)
}
this.hlock.Unlock()
this.module.Debug("update cfg.Game_drawCard over")
return
}
}
err = fmt.Errorf("%T no is *cfg.Game_drawCard", v)
return
}
func (this *configureComp) GetPollByType(poosType string) map[int32][]*cfg.GameDrawCardData {
return this.drawCardCfg[poosType]
}

View File

@ -26,12 +26,12 @@ func (this *apiComp) AtlasAward(session comm.IUserSession, req *pb.SmithyAtlasAw
return
}
conf := this.module.configure.GetSmithyAtlasLvConf(atlas.Reward)
conf := this.module.configure.GetSmithyAtlasLvConf(atlas.Award)
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
nexLv := this.module.configure.GetSmithyAtlasLvConf(atlas.Reward + 1)
nexLv := this.module.configure.GetSmithyAtlasLvConf(atlas.Award + 1)
if nexLv == nil { //满级
code = pb.ErrorCode_SmithyAtlasMaxLv
return

View File

@ -34,7 +34,7 @@ func (this *modelAtlas) getSmithyAtlasList(uid string) (result *pb.DBAtlas, err
result.Id = primitive.NewObjectID().Hex()
result.Uid = uid
result.Atlas = make(map[string]*pb.ForgeData, 0)
result.Reward = 1 // 初始1级
result.Award = 1 // 初始1级
this.Add(uid, result)
err = nil
}