掠夺刷新消耗

This commit is contained in:
meixiongfeng 2024-01-29 19:00:01 +08:00
parent d64dc44390
commit 1cd99f6b05
2 changed files with 18 additions and 3 deletions

View File

@ -59,7 +59,7 @@ func (this *apiComp) Develop(session comm.IUserSession, req *pb.PlunderDevelopRe
return
}
list.Develop[req.Cid] = 1
list.Develop[req.Cid] = conf.Type
update["develop"] = list.Develop
this.module.modelPlunder.changePlunderData(session.GetUserId(), update)

View File

@ -3,6 +3,7 @@ package plunder
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
)
func (this *apiComp) RefreshCheck(session comm.IUserSession, req *pb.PlunderRefreshReq) (errdata *pb.ErrorData) {
@ -14,6 +15,7 @@ func (this *apiComp) Refresh(session comm.IUserSession, req *pb.PlunderRefreshRe
var (
err error
list *pb.DBPlunder
freeCount int32
)
if errdata = this.RefreshCheck(session, req); errdata != nil {
return
@ -26,6 +28,19 @@ func (this *apiComp) Refresh(session comm.IUserSession, req *pb.PlunderRefreshRe
}
return
}
// 获取技能
for k, v := range list.Develop {
if v == 101 {
if r, e := this.module.configure.getPlunderDevelopById(k); e == nil {
freeCount += r.BuffID
}
}
}
if list.Refresh > freeCount {
if errdata = this.module.ConsumeRes(session, []*cfg.Gameatn{this.module.ModuleTools.GetGlobalConf().PlunderPvpRemake}, true); errdata != nil {
return
}
}
// 刷新货物
list.Source, err = this.module.modelPlunder.refreshGoodsInfo()
list.Setout = []int32{}