活动:修复七天乐任务
This commit is contained in:
@@ -3,8 +3,6 @@ import { ActivityBase } from './activityField';
|
||||
import { TASK_TYPE } from '../../consts';
|
||||
import { ActivityGrowthModelType } from '../../db/ActivityGrowth';
|
||||
import { ActivityGrowthPointModelType } from '../../db/ActivityGrowthPoint';
|
||||
import { HeroType } from '../../db/Hero';
|
||||
import { RoleModel } from '../../db/Role';
|
||||
import { parseNumberList, splitString } from '../../pubUtils/util';
|
||||
import { ActivityDailyGiftsModelType } from '../../db/ActivityDailyGifts';
|
||||
import { parseResStr } from '../../pubUtils/util';
|
||||
@@ -273,23 +271,13 @@ export class SevenDaysGrowthData {
|
||||
}
|
||||
|
||||
//解析玩家领取记录
|
||||
public async setPlayerRecords(data: ActivityGrowthModelType[], roleId: string, userHeroes: HeroType[]) {
|
||||
let { heroNum, towerLv } = await RoleModel.findByRoleId(roleId);
|
||||
public setPlayerRecords(data: ActivityGrowthModelType[]) {
|
||||
for (let obj of this.list) {
|
||||
let index = data.findIndex(record => { return obj.dayIndex == record.dayIndex && obj.cellIndex == record.cellIndex })
|
||||
if (index != -1) {
|
||||
obj.totalCount = data[index].totalCount ? data[index].totalCount : 0;
|
||||
obj.receiveRewardCount = data[index].receiveRewardCount ? data[index].receiveRewardCount : 0;
|
||||
}
|
||||
if (obj.taskType === TASK_TYPE.HERO_NUM) {
|
||||
obj.totalCount = heroNum;
|
||||
} else if (obj.taskType === TASK_TYPE.HERO_LV) {
|
||||
let lv = obj.taskParamArray[1];
|
||||
let heroes = userHeroes.filter(hero => { return hero.lv >= lv })
|
||||
obj.totalCount = heroes.length;
|
||||
} else if (obj.taskType === TASK_TYPE.BATTLE_TOWER_LV) {
|
||||
obj.totalCount = towerLv - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user