狩猎优化
This commit is contained in:
parent
7a0858de04
commit
8195cb6a76
@ -91,7 +91,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mapData["challengeTime"] = enchant.BossTime
|
mapData["bossTime"] = enchant.BossTime
|
||||||
mapData["boss"] = enchant.Boss
|
mapData["boss"] = enchant.Boss
|
||||||
code = this.module.ModifyEnchantData(session.GetUserId(), mapData)
|
code = this.module.ModifyEnchantData(session.GetUserId(), mapData)
|
||||||
session.SendMsg(string(this.module.GetType()), EnchantChallengeOverResp, &pb.EnchantChallengeOverResp{Data: enchant})
|
session.SendMsg(string(this.module.GetType()), EnchantChallengeOverResp, &pb.EnchantChallengeOverResp{Data: enchant})
|
||||||
|
@ -52,13 +52,11 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallen
|
|||||||
}
|
}
|
||||||
value, ok := hunting.Boss[req.BossType]
|
value, ok := hunting.Boss[req.BossType]
|
||||||
if !ok { // 类型校验
|
if !ok { // 类型校验
|
||||||
hunting.Boss[req.BossType] = 0
|
hunting.Boss[req.BossType] = 1
|
||||||
}
|
}
|
||||||
if value < req.Difficulty {
|
if value < req.Difficulty {
|
||||||
if value+1 != req.Difficulty {
|
code = pb.ErrorCode_HuntingLvErr
|
||||||
code = pb.ErrorCode_HuntingLvErr
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{
|
code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{
|
||||||
|
@ -61,14 +61,14 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
|
|||||||
}
|
}
|
||||||
value, ok := hunting.Boss[req.BossType]
|
value, ok := hunting.Boss[req.BossType]
|
||||||
if !ok { // 类型校验
|
if !ok { // 类型校验
|
||||||
hunting.Boss[req.BossType] = 0
|
hunting.Boss[req.BossType] = 1
|
||||||
}
|
}
|
||||||
if value < req.Difficulty {
|
if value == req.Difficulty {
|
||||||
if value+1 != req.Difficulty {
|
|
||||||
code = pb.ErrorCode_HuntingLvErr
|
|
||||||
return
|
|
||||||
}
|
|
||||||
newChallenge = true
|
newChallenge = true
|
||||||
|
} else if value < req.Difficulty {
|
||||||
|
code = pb.ErrorCode_HuntingLvErr
|
||||||
|
return
|
||||||
}
|
}
|
||||||
// 校验门票数量够不够
|
// 校验门票数量够不够
|
||||||
if code = this.module.ConsumeRes(session, []*cfg.Gameatn{costRes}, true); code != pb.ErrorCode_Success {
|
if code = this.module.ConsumeRes(session, []*cfg.Gameatn{costRes}, true); code != pb.ErrorCode_Success {
|
||||||
@ -104,10 +104,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
|
|||||||
mapData["boss"] = hunting.Boss
|
mapData["boss"] = hunting.Boss
|
||||||
|
|
||||||
}
|
}
|
||||||
for k := range hunting.Boss {
|
|
||||||
hunting.Boss[k] += 1
|
mapData["bossTime"] = hunting.BossTime
|
||||||
}
|
|
||||||
mapData["challengeTime"] = hunting.BossTime
|
|
||||||
code = this.module.ModifyHuntingData(session.GetUserId(), mapData)
|
code = this.module.ModifyHuntingData(session.GetUserId(), mapData)
|
||||||
session.SendMsg(string(this.module.GetType()), HuntingChallengeOverResp, &pb.HuntingChallengeOverResp{Data: hunting})
|
session.SendMsg(string(this.module.GetType()), HuntingChallengeOverResp, &pb.HuntingChallengeOverResp{Data: hunting})
|
||||||
|
|
||||||
|
@ -173,9 +173,7 @@ func (this *Hunting) CompleteAllLevel(session comm.IUserSession) (code pb.ErrorC
|
|||||||
}
|
}
|
||||||
mapData["boss"] = list.Boss
|
mapData["boss"] = list.Boss
|
||||||
code = this.ModifyHuntingData(session.GetUserId(), mapData)
|
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})
|
session.SendMsg(string(this.GetType()), HuntingGetListResp, &pb.HuntingGetListResp{Data: list})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user