装备:任务

This commit is contained in:
luying
2022-02-22 10:56:41 +08:00
parent 56f2c23929
commit 3f5371df79
11 changed files with 598 additions and 262 deletions
+13 -1
View File
@@ -4,7 +4,7 @@ import { pinus, FrontendOrBackendSession } from 'pinus';
import { resResult, shouldRefresh } from '../pubUtils/util';
import { STATUS, TASK_TYPE, TASK_FUN_TYPE, SHOP_REFRESH_TYPE, WAR_TYPE } from '../consts';
import { TaskParam, TaskListReturn } from '../domain/roleField/task';
import { HeroType } from '../db/Hero';
import { EPlace, HeroType } from '../db/Hero';
import { getRoleOnlineInfo } from './redisService';
import { HeroScores } from '../db/PvpHistoryOpp';
import { ItemInter } from '../pubUtils/interface';
@@ -15,6 +15,7 @@ import { gameData } from '../pubUtils/data';
import { getSeconds, getZeroPointD } from '../pubUtils/timeUtil';
import { RoleStatus } from '../db/ComBattleTeam';
import { getActivities } from './activity/activityService';
import { JewelType } from '../db/Jewel';
export async function checkTaskWithRoles(serverId: number, roleId: string, sid: string, taskType: number, roles: RoleType[]) {
for (let role of roles) {
@@ -34,6 +35,11 @@ export async function checkTaskWithHero(roleId: string, sid: string, taskType: n
pushTaskUpdate(roleId, sid, pushMessage);
}
export async function checkTaskWithEplaces(roleId: string, sid: string, taskType: number, eplace: EPlace[], newEplace: EPlace[], eplaceIds: number[], params?: any) {
let pushMessage = await taskUtil.checkTaskWithEplaces(roleId, taskType, eplace, newEplace, eplaceIds, params);
pushTaskUpdate(roleId, sid, pushMessage);
}
// export async function checkTaskWithEquip(roleId: string, sid: string, taskType: number, equip: EquipType, args?: number[]) {
// let pushMessage = await taskUtil.checkTaskWithEquip(roleId, taskType, equip, args);
// pushTaskUpdate(roleId, sid, pushMessage);
@@ -294,6 +300,12 @@ export async function getPvpTask(roleId: string) {
return { taskList }
}
export async function checkTaskInPutJewel(roleId: string, sid: string, oldEplace: EPlace[], newEplace: EPlace[], ePlaceId: number, originJewel: JewelType, curJewel: JewelType) {
await checkTaskWithEplaces(roleId, sid, TASK_TYPE.EQUIP_PUT_JEWEL, oldEplace, newEplace, [ePlaceId], { jewels: [originJewel, curJewel ] });
await checkTaskWithEplaces(roleId, sid, TASK_TYPE.EQUIP_PUT_JEWEL_CNT, oldEplace, newEplace, [ePlaceId]);
await checkTaskWithEplaces(roleId, sid, TASK_TYPE.EQUIP_JEWEL_RANDSE_CNT, oldEplace, newEplace, [ePlaceId], { jewels: [originJewel, curJewel ] });
}
// 刷新每日任务
export async function refDailyTask(roleId: string, sid: string) {
let userTask = await UserTaskModel.findByRole(roleId);