修改任务类型计算规则

This commit is contained in:
wh_zcy 2022-11-23 13:33:38 +08:00
parent 1b70a22ace
commit 8ab33ef3c5
2 changed files with 18 additions and 1 deletions

View File

@ -25,6 +25,7 @@ func (this *ModelRtaskRecord) greatEqualFirstParam(cfg *cfg.GameRdtaskCondiData,
return
}
// 传递参数小于等于配置参数
func (this *ModelRtaskRecord) lessEqualFirstParam(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) {
if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)

View File

@ -162,8 +162,15 @@ func (this *ModuleRtask) initRtaskVerifyHandle() {
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
update: this.modelRtaskRecord.overrideUpdate,
})
case comm.Rtype18:
this.registerVerifyHandle(v.Id, &rtaskCondi{
cfg: typeCfg,
find: this.modelRtaskRecord.greatEqualFirstParam,
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
update: this.modelRtaskRecord.addUpdate,
})
case comm.Rtype7, comm.Rtype12, comm.Rtype13, comm.Rtype14, comm.Rtype15,
comm.Rtype18, comm.Rtype19, comm.Rtype21, comm.Rtype24,
comm.Rtype19, comm.Rtype21, comm.Rtype24,
comm.Rtype26, comm.Rtype27, comm.Rtype28, comm.Rtype38,
comm.Rtype39, comm.Rtype50, comm.Rtype51, comm.Rtype53,
comm.Rtype54, comm.Rtype57, comm.Rtype58, comm.Rtype60,
@ -317,7 +324,16 @@ func (this *ModuleRtask) CheckCondi(uid string, condiId int32) (code pb.ErrorCod
return
}
func (this *ModuleRtask) RemoveCondi(uid string, condiId int32) (err error) {
dr := this.modelRtaskRecord.getRecord(uid)
if dr != nil && dr.Vals != nil {
delete(dr.Vals, condiId)
}
return
}
// 初始化任务条件数据
// Deprecated
func (this *ModuleRtask) InitCondiData(uid string) error {
return this.modelRtaskRecord.initCondiData(uid)
}