羁绊剧情奖励

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)
if len(favorConf.Favorlv) < l {
if favorConf.Favorlv[l] > _heroFetter.Favorlv { // 等级不够
_len := len(_heroFetter.History)
if len(favorConf.Favorlv) < _len {
if favorConf.Favorlv[_len] > _heroFetter.Favorlv { // 等级不够
code = pb.ErrorCode_LibraryLvReward
return
}
@ -57,26 +57,25 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe
var res []*cfg.Gameatn
if v == req.History {
switch iPos {
case 1:
if iPos == 0 {
res = append(res, favorConf.BiographyReward1...)
case 2:
} else if iPos == 1 {
res = append(res, favorConf.BiographyReward2...)
case 3:
} else if iPos == 2 {
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
}
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)

View File

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