战斗校验

This commit is contained in:
meixiongfeng 2022-09-26 11:10:33 +08:00
parent b06f43ebdc
commit 5385c292b4
7 changed files with 24 additions and 8 deletions

View File

@ -62,6 +62,7 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
if _hero.SameCount > 1 { //有堆叠的情况
// 克隆一个新的
_hero.SameCount -= 1
_hero.JuexingLv = 0
newHero := this.module.modelHero.CloneNewHero(_hero)
chanegCard = append(chanegCard, newHero)
_heroMap["isOverlying"] = false

View File

@ -132,9 +132,20 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt
// 堆叠情况
if _hero.SameCount > 1 {
_hero.SameCount -= 1
sz := make([]*pb.SkillData, 0)
for _, v := range _hero.NormalSkill {
sz = append(sz, &pb.SkillData{
SkillID: v.SkillID,
SkillLv: v.SkillLv,
})
v.SkillLv = 1
}
newHero := this.module.modelHero.CloneNewHero(_hero)
ChangeList = append(ChangeList, newHero)
_hero.NormalSkill = sz
}
_heroMap := map[string]interface{}{
"normalSkill": _hero.NormalSkill,
"isOverlying": false,
@ -147,6 +158,7 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt
code = pb.ErrorCode_DBError
return
}
/////
this.module.modelHero.ChangeHeroProperty(session, _hero) // 推送属性变化
ChangeList = append(ChangeList, _hero)
session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: ChangeList})

View File

@ -131,6 +131,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
if _hero.SameCount > 1 { //有堆叠的情况
// 克隆一个新的
_hero.SameCount -= 1
newHero := this.module.modelHero.CloneNewHero(_hero)
chanegCard = append(chanegCard, newHero)
}

View File

@ -64,7 +64,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
hunting.Boss[req.BossType] += 1
mapData["boss"] = hunting.Boss
mapData["challengeTime"] = hunting.BossTime
if req.Report != nil && len(req.Report.Info.Redflist) > 0 {
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
sz := make([]*pb.LineUp, 5)
for i, v := range req.Report.Info.Redflist[0].Team {
if v != nil {

View File

@ -102,13 +102,15 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
this.module.Debugf("DispenseRes err:+%v", res)
}
// 加经验
if req.Report != nil && len(req.Report.Info.Redflist) > 0 {
if node.Episodetype != 5 && node.Episodetype != 7 {
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team {
if node.Exp > 0 {
this.module.ModuleHero.AddHeroExp(session, v.Oid, node.Exp)
}
}
}
}
session.SendMsg(string(this.module.GetType()), MainlineChallengeOverResp, &pb.MainlineChallengeOverResp{Data: mainline})
return

View File

@ -109,7 +109,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
}
} else {
// 记录爬塔明细数据
if req.Report != nil && len(req.Report.Info.Redflist) > 0 {
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
sz := make([]*pb.LineUp, 5)
for i, v := range req.Report.Info.Redflist[0].Team {
if v != nil {
@ -129,7 +129,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
}
// 加经验
if req.Report != nil && len(req.Report.Info.Redflist) > 0 {
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
for _, v := range req.Report.Info.Redflist[0].Team {
if conf.Exp > 0 {
this.module.ModuleHero.AddHeroExp(session, v.Oid, conf.Exp)

View File

@ -65,7 +65,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
viking.Boss[req.BossType] += 1
mapData["boss"] = viking.Boss
if req.Report != nil && len(req.Report.Info.Redflist) > 0 {
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
sz := make([]*pb.LineUp, 5)
for i, v := range req.Report.Info.Redflist[0].Team {
if v != nil {