任务类型整理2

This commit is contained in:
wh_zcy 2023-05-24 17:20:31 +08:00
parent e73b025e95
commit ef0363f78b
3 changed files with 27 additions and 19 deletions

View File

@ -635,7 +635,12 @@ const (
Rtype159 TaskType = 159 //主线第X章关卡全部达到三星
Rtype160 TaskType = 160 //主线总星数达到X星
Rtype161 TaskType = 161 //在自动战斗过程中完成另一场战斗
Rtype162 TaskType = 162 //收藏X件攻击套装部件(激活一个套装部位+1)
Rtype163 TaskType = 163 //收藏X件防御套装部件(激活一个套装部位+1)
Rtype164 TaskType = 164 //收藏X件辅助套装部件(激活一个套装部位+1)
Rtype165 TaskType = 165 //铁匠铺收藏X件收藏品
Rtype166 TaskType = 166 //铁匠铺图鉴收藏总计达到X个
Rtype167 TaskType = 167 //铁匠铺收藏积分达到X分
Rtype168 TaskType = 168 //完成功夫大师挑战塔第X层
Rtype169 TaskType = 169 //触发指定套装的套装效果
Rtype170 TaskType = 170 //获得指定材料X个

View File

@ -17,7 +17,6 @@ func (this *apiComp) Rtest(session comm.IUserSession, req *pb.RtaskTestReq) (cod
if req.CondiId != 0 {
if code = this.moduleRtask.CheckCondi(session.GetUserId(), req.CondiId); code != pb.ErrorCode_Success {
rsp.Flag = false
return
}
} else if req.GroupId != 0 {
// 获取当前玩家

View File

@ -24,13 +24,14 @@ var _ comm.IRtask = (*ModuleRtask)(nil)
// 限定条件
type rtaskCondHandle struct {
condId int32 //任务条件配置ID
verify verifyHandle //校验任务条件
condId int32 //任务条件配置ID
verify verifyHandle //校验任务条件
update updateDataHandle //更新任务数据
}
// 任务参数校验
type verifyHandle func(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (bool, error)
// 任务数据更新
type updateDataHandle func(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData, vals ...int32) error
@ -110,24 +111,24 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle
}
handles = append(handles, handle)
this.registerVerifyHandle(v.Id, handle)
case comm.Rtype18:
handle := &rtaskCondHandle{
condId: v.Id,
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
update: this.modelRtaskRecord.addUpdate,
}
handles = append(handles, handle)
this.registerVerifyHandle(v.Id, handle)
case comm.Rtype7, comm.Rtype12, comm.Rtype13, comm.Rtype14, comm.Rtype15,
comm.Rtype19, comm.Rtype21, comm.Rtype24,
comm.Rtype18, comm.Rtype19, comm.Rtype24,
comm.Rtype26, comm.Rtype27, comm.Rtype28, comm.Rtype38,
comm.Rtype39, comm.Rtype51, comm.Rtype53,
comm.Rtype54, comm.Rtype57, comm.Rtype60,
comm.Rtype62, comm.Rtype64, comm.Rtype88, comm.Rtype104,
comm.Rtype96, comm.Rtype105, comm.Rtype128, comm.Rtype130, comm.Rtype131,
comm.Rtype62, comm.Rtype64, comm.Rtype87, comm.Rtype88, comm.Rtype89, comm.Rtype90,
comm.Rtype91, comm.Rtype92, comm.Rtype94, comm.Rtype95, comm.Rtype97, comm.Rtype104,
comm.Rtype96, comm.Rtype98, comm.Rtype99, comm.Rtype102, comm.Rtype103, comm.Rtype105,
comm.Rtype106, comm.Rtype108, comm.Rtype113, comm.Rtype114, comm.Rtype115, comm.Rtype116,
comm.Rtype117, comm.Rtype118, comm.Rtype119, comm.Rtype120, comm.Rtype121, comm.Rtype123,
comm.Rtype128, comm.Rtype130, comm.Rtype131, comm.Rtype132, comm.Rtype135,
comm.Rtype141, comm.Rtype142, comm.Rtype143, comm.Rtype144, comm.Rtype145, comm.Rtype146,
comm.Rtype147, comm.Rtype149, comm.Rtype153, comm.Rtype154, comm.Rtype155, comm.Rtype156,
comm.Rtype171, comm.Rtype186, comm.Rtype187:
comm.Rtype147, comm.Rtype148, comm.Rtype149, comm.Rtype152, comm.Rtype153, comm.Rtype154,
comm.Rtype155, comm.Rtype156, comm.Rtype161, comm.Rtype162, comm.Rtype163, comm.Rtype164,
comm.Rtype165, comm.Rtype166, comm.Rtype167,
comm.Rtype171, comm.Rtype172, comm.Rtype173, comm.Rtype175, comm.Rtype177,
comm.Rtype181, comm.Rtype182, comm.Rtype183, comm.Rtype184, comm.Rtype185, comm.Rtype186, comm.Rtype187:
handle := &rtaskCondHandle{
condId: v.Id,
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
@ -152,7 +153,9 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle
handles = append(handles, handle)
this.registerVerifyHandle(v.Id, handle)
case comm.Rtype109:
case comm.Rtype109, comm.Rtype122, comm.Rtype124, comm.Rtype125, comm.Rtype126,
comm.Rtype127, comm.Rtype129, comm.Rtype133, comm.Rtype134, comm.Rtype158,
comm.Rtype159, comm.Rtype160:
handle := &rtaskCondHandle{
condId: v.Id,
verify: this.modelRtaskRecord.verifyFirstEqualParam,
@ -176,7 +179,8 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle
comm.Rtype42, comm.Rtype43,
comm.Rtype46, comm.Rtype47,
comm.Rtype52, comm.Rtype55, comm.Rtype56,
comm.Rtype65, comm.Rtype66, comm.Rtype67, comm.Rtype68, comm.Rtype70, comm.Rtype140:
comm.Rtype65, comm.Rtype66, comm.Rtype67, comm.Rtype68, comm.Rtype70, comm.Rtype140,
comm.Rtype168, comm.Rtype169, comm.Rtype170, comm.Rtype174, comm.Rtype179, comm.Rtype180:
handle := &rtaskCondHandle{
condId: v.Id,
verify: this.modelRtaskRecord.verifyGreatEqual,