活动:30天目标
This commit is contained in:
@@ -15,6 +15,8 @@ import { ActivityModel, ActivityModelType } from '../db/Activity';
|
||||
import { ACTIVITY_TYPE } from '../consts/constModules/activityConst';
|
||||
import { ActivityGrowthModel } from '../db/ActivityGrowth';
|
||||
import { ActivityDailyChallengesModel } from '../db/ActivityDailyChallenges';
|
||||
import { ThirtyDaysData } from '../domain/activityField/thirtyDaysField';
|
||||
import { ActivityThirtyDaysModel } from '../db/ActivityThirtyDays';
|
||||
|
||||
|
||||
|
||||
@@ -423,7 +425,7 @@ export async function checkTaskRec(roleId: string, type: number, group: number,
|
||||
break;
|
||||
}
|
||||
console.log('****isMatch', isMatch, checkHistory, type, taskType, group, count)
|
||||
if(param.isDebug) {
|
||||
if (param.isDebug) {
|
||||
isMatch = true;
|
||||
}
|
||||
|
||||
@@ -514,6 +516,22 @@ export async function accomplishTask(roleId: string, taskType: TASK_TYPE, count:
|
||||
}
|
||||
}
|
||||
|
||||
//30天任务统计
|
||||
allActivity = await ActivityModel.findOpenActivityByType(ACTIVITY_TYPE.THIRTY_DAYS, new Date());
|
||||
for (let activity of allActivity) {
|
||||
let thirtyDaysActivity = new ThirtyDaysData(activity);
|
||||
let taskArray = thirtyDaysActivity.findTaskByType(taskType);
|
||||
for (let task of taskArray) {
|
||||
let addCount = isComplete(roleId, task.taskType, task.taskParam, count, parma);
|
||||
if (addCount) {
|
||||
if (taskType == TASK_TYPE.ROLE_LV || taskType == TASK_TYPE.ROLE_TITLE) {
|
||||
await ActivityThirtyDaysModel.setTaskCount(thirtyDaysActivity.activityId, roleId, task.pageIndex, task.cellIndex, task.taskType, addCount);
|
||||
} else {
|
||||
await ActivityThirtyDaysModel.addTaskCount(thirtyDaysActivity.activityId, roleId, task.pageIndex, task.cellIndex, task.taskType, addCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -544,6 +562,9 @@ export function isComplete(roleId: string, taskType: TASK_TYPE, taskParam: strin
|
||||
case TASK_TYPE.HERO_NUM:
|
||||
addCount = count;
|
||||
break;
|
||||
case TASK_TYPE.HERO_QUALITY_STAR_UP://herocount&quality&star&
|
||||
addCount = (param[1] == paramObj.quality) && (param[2] == paramObj.star) ? count : 0;
|
||||
break;
|
||||
case TASK_TYPE.ROLE_TITLE://重置数据
|
||||
addCount = param[0] <= count ? count : 0;
|
||||
break;
|
||||
@@ -592,7 +613,7 @@ export function isComplete(roleId: string, taskType: TASK_TYPE, taskParam: strin
|
||||
*/
|
||||
export async function getCreateUserFuncs(dataFuncs: number[], lv: number) {
|
||||
let addFuncs: number[] = [];
|
||||
for(let [id, dicFunSwitch] of gameData.funcsSwitch) {
|
||||
for (let [id, dicFunSwitch] of gameData.funcsSwitch) {
|
||||
if (dataFuncs.includes(id)) continue; // 已开启过了
|
||||
|
||||
if (dicFunSwitch && lv >= dicFunSwitch.param) {
|
||||
|
||||
Reference in New Issue
Block a user