修改任务类型计算规则
This commit is contained in:
parent
1b70a22ace
commit
8ab33ef3c5
@ -25,6 +25,7 @@ func (this *ModelRtaskRecord) greatEqualFirstParam(cfg *cfg.GameRdtaskCondiData,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 传递参数小于等于配置参数
|
||||||
func (this *ModelRtaskRecord) lessEqualFirstParam(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) {
|
func (this *ModelRtaskRecord) lessEqualFirstParam(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) {
|
||||||
if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok {
|
if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok {
|
||||||
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
|
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
|
||||||
|
@ -162,8 +162,15 @@ func (this *ModuleRtask) initRtaskVerifyHandle() {
|
|||||||
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
|
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
|
||||||
update: this.modelRtaskRecord.overrideUpdate,
|
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,
|
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.Rtype26, comm.Rtype27, comm.Rtype28, comm.Rtype38,
|
||||||
comm.Rtype39, comm.Rtype50, comm.Rtype51, comm.Rtype53,
|
comm.Rtype39, comm.Rtype50, comm.Rtype51, comm.Rtype53,
|
||||||
comm.Rtype54, comm.Rtype57, comm.Rtype58, comm.Rtype60,
|
comm.Rtype54, comm.Rtype57, comm.Rtype58, comm.Rtype60,
|
||||||
@ -317,7 +324,16 @@ func (this *ModuleRtask) CheckCondi(uid string, condiId int32) (code pb.ErrorCod
|
|||||||
return
|
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 {
|
func (this *ModuleRtask) InitCondiData(uid string) error {
|
||||||
return this.modelRtaskRecord.initCondiData(uid)
|
return this.modelRtaskRecord.initCondiData(uid)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user