羁绊剧情奖励

This commit is contained in:
meixiongfeng 2023-05-08 10:18:01 +08:00
parent 95ba9c3983
commit 33784184b7
2 changed files with 23 additions and 23 deletions

View File

@ -46,9 +46,9 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe
} }
} }
// 等级规则校验 // 等级规则校验
l := len(_heroFetter.History) _len := len(_heroFetter.History)
if len(favorConf.Favorlv) < l { if len(favorConf.Favorlv) < _len {
if favorConf.Favorlv[l] > _heroFetter.Favorlv { // 等级不够 if favorConf.Favorlv[_len] > _heroFetter.Favorlv { // 等级不够
code = pb.ErrorCode_LibraryLvReward code = pb.ErrorCode_LibraryLvReward
return return
} }
@ -57,26 +57,25 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe
var res []*cfg.Gameatn var res []*cfg.Gameatn
if v == req.History { if v == req.History {
switch iPos { if iPos == 0 {
case 1:
res = append(res, favorConf.BiographyReward1...) res = append(res, favorConf.BiographyReward1...)
case 2: } else if iPos == 1 {
res = append(res, favorConf.BiographyReward2...) res = append(res, favorConf.BiographyReward2...)
case 3: } else if iPos == 2 {
res = append(res, favorConf.BiographyReward3...) res = append(res, favorConf.BiographyReward3...)
} }
if len(res) > 0 {
if code = this.module.DispenseRes(session, res, true); code != pb.ErrorCode_Success {
return
}
} else {
this.module.Errorf("领取奖励配置错误:%d", req.History)
code = pb.ErrorCode_LibraryLvReward
return
}
break break
} }
if len(res) > 0 {
if code = this.module.DispenseRes(session, res, true); code != pb.ErrorCode_Success {
return
}
} else {
this.module.Errorf("领取奖励配置错误:%d", req.History)
code = pb.ErrorCode_LibraryLvReward
return
}
} }
_heroFetter.History = append(_heroFetter.History, req.History) _heroFetter.History = append(_heroFetter.History, req.History)

View File

@ -75,18 +75,19 @@ func (this *ModuleSys) AutoActivate(session comm.IUserSession, cids []string) bo
break break
} }
} }
for k, v := range list.Cond { for k, v := range list.Cond {
if k == cid && v != 0 { if k == cid && v != 0 {
list.Cond[cid] = 1
szOpen = append(szOpen, cid)
break break
} }
} }
list.Cond[cid] = 1
szOpen = append(szOpen, cid)
} }
this.modelSys.ChangeOpenCondData(session.GetUserId(), map[string]interface{}{ if len(szOpen) > 0 {
"cond": list.Cond, this.modelSys.ChangeOpenCondData(session.GetUserId(), map[string]interface{}{
}) "cond": list.Cond,
})
}
// 推送变化 // 推送变化
session.SendMsg(string(this.GetType()), "open", &pb.SysFuncOpnePush{ session.SendMsg(string(this.GetType()), "open", &pb.SysFuncOpnePush{
Cid: szOpen, Cid: szOpen,