打造一次升多级情况

This commit is contained in:
meixiongfeng 2023-05-10 10:30:53 +08:00
parent d0fed35a83
commit 72867cea6e

View File

@ -237,29 +237,35 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
stove.Data[req.ReelId].Value += req.Count
stove.Forge[req.ReelId] += req.Count
// 可能存在一次升多级的情况
// 检查是否提升了熟练度等级
nextProficiency := this.module.configure.GetSmithyProficileData(req.ReelId, stove.Data[req.ReelId].Lv+1)
if nextProficiency != nil && nextProficiency.Proficiency <= stove.Data[req.ReelId].Value { // 提升熟练度
stove.Data[req.ReelId].Lv += 1
for {
nextProficiency := this.module.configure.GetSmithyProficileData(req.ReelId, stove.Data[req.ReelId].Lv+1)
if nextProficiency != nil && nextProficiency.Proficiency <= stove.Data[req.ReelId].Value { // 提升熟练度
stove.Data[req.ReelId].Lv += 1
// 校验是否解锁了新的图纸
if nextProficiency.Type == comm.SmithyReelType3 {
stove.Data[nextProficiency.Value1] = &pb.Mastery{
Lv: 1,
Value: 0,
// 校验是否解锁了新的图纸
if nextProficiency.Type == comm.SmithyReelType3 {
stove.Data[nextProficiency.Value1] = &pb.Mastery{
Lv: 1,
Value: 0,
}
}
}
// 是否解锁新套装
if nextProficiency.Type == comm.SmithyReelType4 {
if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
rst.SuiteId = append(rst.SuiteId, nextProficiency.Value1)
// 是否解锁新套装
if nextProficiency.Type == comm.SmithyReelType4 {
if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
rst.SuiteId = append(rst.SuiteId, nextProficiency.Value1)
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{
"suiteId": rst.SuiteId,
})
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{
"suiteId": rst.SuiteId,
})
}
}
} else {
break
}
}
update["data"] = stove.Data
update["forge"] = stove.Forge // 打造次数