This commit is contained in:
liwei 2023-07-07 09:59:33 +08:00
commit f0bae825b4
5 changed files with 41 additions and 14 deletions

View File

@ -120,7 +120,7 @@ type (
CheckJuexingHeroNum(uid string, juexingLv int32, star int32) int32
// 获取所有满星满级满觉醒的英雄
GetAllMaxHero(session IUserSession) (errdata *pb.ErrorData)
GetAllMaxHero(session IUserSession, bTalent bool) (errdata *pb.ErrorData)
// 教习登记
RegisterInstructor(session IUserSession, heroOid []string, registerId int32) (errdata *pb.ErrorData)

View File

@ -198,7 +198,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
errdata = module1.(comm.IHero).GetAllMaxHero(session)
errdata = module1.(comm.IHero).GetAllMaxHero(session, false)
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[0]},
@ -528,6 +528,25 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
log.Field{Key: "param", Value: datas[0]},
log.Field{Key: "res", Value: res},
)
} else if len(datas) == 1 && (datas[0] == "godlike") { // 一键超神
module1, err := this.service.GetModule(comm.ModuleHero)
if err != nil {
return
}
errdata = module1.(comm.IHero).GetAllMaxHero(session, true)
module1, err = this.service.GetModule(comm.ModuleMline)
if err != nil {
return
}
errdata = module1.(comm.IMline).ModifyMlineDataByNanduID(session, 1101208)
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[0]},
)
}
}
}

View File

@ -21,7 +21,7 @@ func (this *apiComp) Complete(session comm.IUserSession, req *pb.GuidanceComplet
err error
ok bool
)
if gourmet, err = this.module.modelGuidance.getUserGourmet(session.GetUserId()); err == nil {
if gourmet, err = this.module.modelGuidance.getUserGourmet(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),

View File

@ -491,6 +491,9 @@ func (this *configureComp) GMGetTalentByHeroId(hid string) (data []*cfg.GameHero
}
}
}
err = comm.NewNotFoundConfErr(moduleName, hero_talent, hid)
if len(data) == 0 {
err = comm.NewNotFoundConfErr(moduleName, hero_talent, hid)
}
return
}

View File

@ -644,7 +644,10 @@ func (this *Hero) CheckJuexingHeroNum(uid string, juexingLv int32, star int32) i
}
// 获取所有满星满级满觉醒的英雄
func (this *Hero) GetAllMaxHero(session comm.IUserSession) (errdata *pb.ErrorData) {
func (this *Hero) GetAllMaxHero(session comm.IUserSession, bTalent bool) (errdata *pb.ErrorData) {
if bTalent {
this.modelTalent.CleanAllHeroTalent(session.GetUserId())
}
data := this.modelHero.module.configure.GetHeroConfigData()
var (
changeHero []*pb.DBHero
@ -703,20 +706,22 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (errdata *pb.ErrorDat
"juexProperty": hero.JuexProperty,
}
if true { // 满天赋
if bTalent { // 满天赋
//var talent *pb.DBHeroTalent
talnet, _ := this.modelTalent.GetHerotalent(session.GetUserId())
this.modelTalent.CleanAllHeroTalent(session.GetUserId())
//talent, _ := this.modelTalent.GetHerotalent(session.GetUserId())
talent, _ := this.modelTalent.CreateHeroTalent(session.GetUserId(), hero.HeroID)
data, err := this.configure.GMGetTalentByHeroId(hero.HeroID)
if err == nil {
for _, v := range talnet {
if v.HeroId == hero.HeroID {
for _, v2 := range data {
v.Talent[v2.Skillid] = 1
}
}
for _, v := range data {
talent.Talent[v.Skillid] = 1
}
}
update := make(map[string]interface{}, 0)
update["talent"] = talent.Talent
if err = this.modelTalent.ChangeHeroTalent(talent, update); err != nil {
this.Errorf("update failed :%v", err)
}
// talent.Talent[req.TalentID] = 1
// update := make(map[string]interface{}, 0)
// update["talent"] = talent.Talent