活动:添加新任务的统计
This commit is contained in:
@@ -275,6 +275,7 @@ export class NormalBattleHandler {
|
|||||||
let roleId = session.get('roleId');
|
let roleId = session.get('roleId');
|
||||||
let roleName = session.get('roleName');
|
let roleName = session.get('roleName');
|
||||||
let sid = session.get('sid');
|
let sid = session.get('sid');
|
||||||
|
let serverId = session.get('serverId');
|
||||||
let funcs: number[] = session.get('funcs');
|
let funcs: number[] = session.get('funcs');
|
||||||
let warInfo = gameData.war.get(battleId);
|
let warInfo = gameData.war.get(battleId);
|
||||||
if (!warInfo) {
|
if (!warInfo) {
|
||||||
@@ -329,6 +330,8 @@ export class NormalBattleHandler {
|
|||||||
|
|
||||||
// 任务
|
// 任务
|
||||||
await checkTaskWithWar(roleId, sid, funcs, TASK_TYPE.BATTLE_MAIN_SWEEP, battleId, [], count, 0);
|
await checkTaskWithWar(roleId, sid, funcs, TASK_TYPE.BATTLE_MAIN_SWEEP, battleId, [], count, 0);
|
||||||
|
//活动任务
|
||||||
|
await checkActivityTask(serverId, sid, funcs, roleId, TASK_TYPE.BATTLE_MAIN_SWEEP, 1, { battleId })
|
||||||
|
|
||||||
return resResult(STATUS.SUCCESS, {
|
return resResult(STATUS.SUCCESS, {
|
||||||
battleId, count,
|
battleId, count,
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
|
|
||||||
import { ActionPointModel } from '../db/ActionPoint';
|
import { ActionPointModel } from '../db/ActionPoint';
|
||||||
import { TASK_TYPE, STATUS } from '../consts';
|
import { TASK_TYPE, STATUS } from '../consts';
|
||||||
import { checkTask } from './taskService';
|
import { checkActivityTask, checkTask } from './taskService';
|
||||||
import { getDicApByLv } from '../pubUtils/data';
|
import { getDicApByLv } from '../pubUtils/data';
|
||||||
import { pinus } from 'pinus';
|
import { pinus } from 'pinus';
|
||||||
import { resResult } from '../pubUtils/util';
|
import { resResult } from '../pubUtils/util';
|
||||||
|
import { RoleModel } from '../db/Role';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前体力
|
* 获取当前体力
|
||||||
@@ -70,6 +71,8 @@ export async function setAp(roleId: string, lv: number, changeAp: number, sid: s
|
|||||||
|
|
||||||
if (changeAp < 0) {
|
if (changeAp < 0) {
|
||||||
await checkTask(roleId, sid, funcs, TASK_TYPE.BATTLE_COST_AP, -1 * changeAp, true, {});
|
await checkTask(roleId, sid, funcs, TASK_TYPE.BATTLE_COST_AP, -1 * changeAp, true, {});
|
||||||
|
let { serverId } = await RoleModel.findByRoleId(roleId);
|
||||||
|
await checkActivityTask(serverId, sid, funcs, roleId, TASK_TYPE.BATTLE_COST_AP, -1 * changeAp,);
|
||||||
}
|
}
|
||||||
let apJson = { ap, maxAp, refTime, apMaxRemainTime, apRemainTime };
|
let apJson = { ap, maxAp, refTime, apMaxRemainTime, apRemainTime };
|
||||||
if (changeAp != 0) {
|
if (changeAp != 0) {
|
||||||
|
|||||||
@@ -1203,6 +1203,16 @@ export function isComplete(roleId: string, taskType: TASK_TYPE, taskParam: strin
|
|||||||
addCount = count;
|
addCount = count;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case TASK_TYPE.BATTLE_COST_AP:
|
||||||
|
{
|
||||||
|
addCount = count;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TASK_TYPE.BATTLE_MAIN_SWEEP:
|
||||||
|
{
|
||||||
|
addCount = count;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
addCount = 0;
|
addCount = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user