溢出经验转金币

This commit is contained in:
wh_zcy 2023-07-03 17:26:16 +08:00
parent 5b3f3e0ac5
commit 316905d7f7

View File

@ -267,12 +267,21 @@ func (this *ModelUser) ChangeLevel(event interface{}, next func(event interface{
nextLvConf = this.module.configure.GetPlayerlvConf(curLv + 1) nextLvConf = this.module.configure.GetPlayerlvConf(curLv + 1)
} }
// 最大等级经验封顶 if nextLvConf == nil {
curLvConf := this.module.configure.GetPlayerlvConf(curLv) curLvConf := this.module.configure.GetPlayerlvConf(curLv)
if curExp > int64(curLvConf.Exp) { reward := this.module.globalConf.OverexpReward
if nextLvConf == nil { var gold int32
curExp = int64(curLvConf.Exp) if curExp < int64(curLvConf.Exp) {
gold = int32(curExp) * reward
} else {
yu := int32(curExp) - curLvConf.Exp
gold = yu * reward
} }
this.module.DispenseRes(ul.session, []*cfg.Gameatn{{A: "attr", T: "gold", N: gold}}, true)
curExp = int64(curLvConf.Exp)
} }
// 等级有递增时再更新 // 等级有递增时再更新