维京远征设置boss 难度

This commit is contained in:
meixiongfeng 2022-12-06 17:15:50 +08:00
parent 70f7ab66bd
commit 608b996728
5 changed files with 72 additions and 0 deletions

View File

@ -242,10 +242,12 @@ type (
TriggerMF(session IUserSession, Boosid string) (err error)
}
IViking interface {
CompleteAllLevel(session IUserSession) (code pb.ErrorCode)
CheckUserBaseVikingInfo(uid string) (data []*pb.DBVikingRank) // 查询玩家最佳通关记录
IReddot
}
IHunting interface {
CompleteAllLevel(session IUserSession) (code pb.ErrorCode)
CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) // 查询玩家最佳通关记录
IReddot
}

View File

@ -22,6 +22,8 @@ import (
7bingo:vip,yueka_1,1 // 月卡类型
8bingo:manhero // 获取所有满星满级满觉醒的英雄
9bingo:season,10 赛季塔层数
10bingo:viking // 解锁维京所有难度
11bingo:hunting // 解锁狩猎所有难度
*/
//参数校验
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode) {

View File

@ -166,6 +166,22 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
}
code = module1.(comm.IPagoda).ModifySeasonPagodaFloor(session, int32(num))
this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[0], "N": int32(num)})
} else if len(datas) == 2 && (datas[0] == "viking") { // 解锁远征所有难度
module1, err := this.service.GetModule(comm.ModuleViking)
if err != nil {
return
}
code = module1.(comm.IViking).CompleteAllLevel(session)
this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[1]})
} else if len(datas) == 2 && (datas[0] == "hunting") { // 解锁狩猎所有难度
module1, err := this.service.GetModule(comm.ModuleHunting)
if err != nil {
return
}
code = module1.(comm.IHunting).CompleteAllLevel(session)
this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[1]})
}
}

View File

@ -153,3 +153,29 @@ func (this *Hunting) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (
}
return
}
// 解锁远征所有难度
func (this *Hunting) CompleteAllLevel(session comm.IUserSession) (code pb.ErrorCode) {
list, err := this.modelHunting.getHuntingList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
mapData := make(map[string]interface{}, 0)
// 查配置获取每个Boss的最大难度
for k := range list.Boss {
for i := 1; ; i++ {
conf := this.configure.GetHuntingBossConfigData(k, int32(i))
if conf == nil {
list.Boss[k] = int32(i - 1)
}
}
}
mapData["boss"] = list.Boss
code = this.ModifyHuntingData(session.GetUserId(), mapData)
for k := range list.Boss {
list.Boss[k] += 1
}
session.SendMsg(string(this.GetType()), HuntingGetListResp, &pb.HuntingGetListResp{Data: list})
return
}

View File

@ -158,3 +158,29 @@ func (this *Viking) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (r
}
return
}
// 解锁远征所有难度
func (this *Viking) CompleteAllLevel(session comm.IUserSession) (code pb.ErrorCode) {
list, err := this.modelViking.getVikingList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
mapData := make(map[string]interface{}, 0)
// 查配置获取每个Boss的最大难度
for k := range list.Boss {
for i := 1; ; i++ {
conf := this.configure.GetVikingBossConfigData(k, int32(i))
if conf == nil {
list.Boss[k] = int32(i - 1)
}
}
}
mapData["boss"] = list.Boss
code = this.ModifyVikingData(session.GetUserId(), mapData)
for k := range list.Boss {
list.Boss[k] += 1
}
session.SendMsg(string(this.GetType()), VikingGetListResp, &pb.VikingGetListResp{Data: list})
return
}