任务:修复任务很多问题

This commit is contained in:
luying
2022-04-29 18:13:02 +08:00
parent c063b2d135
commit b4deba6cb0
4 changed files with 15 additions and 9 deletions

View File

@@ -586,10 +586,7 @@ export class CheckSingleTask {
}
case TASK_TYPE.ROLE_SCROLL_ACTIVE: // 21. 名将谱激活x武将
{
let { scrollActive } = param;
if(scrollActive) {
result = { inc: 1 };
}
result = { inc: 1 };
break;
}
case TASK_TYPE.FRIEND_NUM: // 34. 拥有x名好友
@@ -1159,9 +1156,9 @@ export class CheckSingleTask {
}).length;
if(oldUnlockSeCnt < dicTaskParam[1] && newUnlockSeCnt >= dicTaskParam[1]) {
result = { inc: -1 };
} else if (oldUnlockSeCnt >= dicTaskParam[1] && newUnlockSeCnt < dicTaskParam[1]) {
result = { inc: 1 };
} else if (oldUnlockSeCnt >= dicTaskParam[1] && newUnlockSeCnt < dicTaskParam[1]) {
result = { inc: -1 };
}
break;
}

View File

@@ -59,11 +59,20 @@ export default class UserTaskRec extends BaseModel {
return rec;
}
public static async recordTaskRec(roleId: string, type: number, taskType: number, group: string, records?: string[]) {
let condition = this.getRefreshCondition(type);
let rec: UserTaskRecType = await UserTaskRecModel.findOneAndUpdate({ roleId, group, taskType, ...condition }, { $setOnInsert: { code: genCode(8), received: [] }, $set: { records: records||[] } }, { new: true, upsert: true }).lean();
return rec;
}
public static async setOrIncTask(roleId: string, type: number, taskType: number, group: string, param: UpdateTaskParam) {
if(param.set) {
return await this.setTaskRec(roleId, type, taskType, group, param.set, param.records);
} else if (param.inc) {
return await this.incTaskRec(roleId, type, taskType, group, param.inc, param.records);
} else if (param.records) {
return await this.recordTaskRec(roleId, type, taskType, group, param.records);
}
}

View File

@@ -1,5 +1,5 @@
// 关卡表
import {decodeArrayListStr, decodeArrayStr, parseNumberList, readFileAndParse} from '../util'
import {decodeArrayListStr, parseNumberList, readFileAndParse} from '../util'
import { TRAIN_REWARD_TYPE, WAR_RELATE_TABLES, WAR_TYPE } from '../../consts';
import { isString } from 'underscore'
import { RewardInter } from '../interface';

View File

@@ -1607,11 +1607,11 @@
"subTab": 13,
"subTabName": "关卡",
"taskType": 39,
"taskParam": "3&",
"taskParam": "1&106&",
"achieveType": 35,
"achieveTaskName": "黄巾贼!哪里跑!",
"taskInfo": "主线通关第3关",
"condition": 3,
"condition": 1,
"taskReward": "31001&50000",
"point": 10
},