This commit is contained in:
wh_zcy 2022-12-06 18:01:55 +08:00
commit f9b191f173
7 changed files with 123 additions and 1 deletions

View File

@ -219,6 +219,7 @@ type (
// 修改爬塔
IPagoda interface {
ModifyPagodaFloor(session IUserSession, level int32) (code pb.ErrorCode)
ModifySeasonPagodaFloor(session IUserSession, level int32) (code pb.ErrorCode)
CheckUserBasePagodaInfo(uid string) (data *pb.DBPagodaRecord) // 查询玩家最佳通关记录
// Check Rtype84 Rtype85 Rtype86
@ -241,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

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

View File

@ -154,6 +154,34 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
code = module1.(comm.IHero).GetAllMaxHero(session)
this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[1]})
} else if len(datas) == 2 && (datas[0] == "season") { // 赛季塔跳转
module1, err := this.service.GetModule(comm.ModulePagoda)
if err != nil {
return
}
num, err := strconv.Atoi(datas[1])
if err != nil {
code = pb.ErrorCode_ReqParameterError
return
}
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

@ -648,6 +648,13 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (code pb.ErrorCode) {
if err != nil {
return pb.ErrorCode_HeroCreate
}
// 获取满级技能
for _, skill := range hero.NormalSkill {
skillMaxLv := this.configure.GetHeroSkillMaxLvConfig(uint32(skill.SkillID))
if skill.SkillLv < skillMaxLv && skillMaxLv > 0 {
skill.SkillLv = skillMaxLv
}
}
hero.Lv = maxLv
hero.Star = maxStar
hero.JuexingLv = int32(maxJux)
@ -660,6 +667,7 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (code pb.ErrorCode) {
"resonateNum": hero.ResonateNum,
"isOverlying": false,
"sameCount": 1,
"normalSkill": hero.NormalSkill,
}
// 保存数据
err = this.modelHero.ChangeList(session.GetUserId(), hero.Id, _heroMap)
@ -668,6 +676,8 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (code pb.ErrorCode) {
return
}
this.modelHero.PropertyCompute(hero) // 重新计算属性
//推送
session.SendMsg("hero", "change", &pb.HeroChangePush{List: []*pb.DBHero{hero}})
}
}

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

@ -224,3 +224,29 @@ func (this *Pagoda) CheckPagodaMaxFloor(uid string, pagodaType int32) int32 {
}
return 0
}
// 赛季塔跳转
func (this *Pagoda) ModifySeasonPagodaFloor(session comm.IUserSession, level int32) (code pb.ErrorCode) {
expand, err := this.ModuleUser.GetUserExpand(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
if !expand.CompletePagoda { // 普通塔
code = pb.ErrorCode_ReqParameterError
return
} else {
list, _ := this.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
if list.Id != "" {
list.PagodaId = level
mapData := make(map[string]interface{}, 0)
mapData["pagodaId"] = level
code = this.ModifyPagodaData(session.GetUserId(), mapData)
session.SendMsg(string(this.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{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
}