✨ feat(校验): 添加战场伤害统计伤害
This commit is contained in:
@@ -14,13 +14,14 @@ import { setAp } from './actionPointService';
|
||||
import { resResult, shouldRefresh } from '../pubUtils/util';
|
||||
import { GuildLeader, LineupParam } from '../domain/rank';
|
||||
import { WarStar } from '../domain/dbGeneral';
|
||||
import { uniq } from 'underscore';
|
||||
import { isArray, isNumber, uniq } from 'underscore';
|
||||
import { checkPopUpCondition } from './activity/popUpShopService';
|
||||
import { calculateCeWithRole } from './playerCeService';
|
||||
import { sendMessageToUserWithSuc } from './pushService';
|
||||
import { ActionPointModel } from '../db/ActionPoint';
|
||||
import { GK_MAIN, GK_MAINELITE, RECHARGE } from '../pubUtils/dicParam';
|
||||
import { updateGVGBattleRoleInfo } from './gvg/gvgTeamService';
|
||||
import { pvpEndParamInter } from '../pubUtils/interface';
|
||||
|
||||
export async function roleLevelup(type: KING_EXP_RATIO_TYPE, roleId: string, kingExp: number = 0, session: BackendSession) {
|
||||
const serverId = session.get('serverId');
|
||||
@@ -263,3 +264,17 @@ export function getMainChapter(role: RoleType) {
|
||||
receivedWarIds: role.receivedWarIds||[],
|
||||
}
|
||||
}
|
||||
|
||||
export function getBattleRecordParam(damageRecord: pvpEndParamInter[], round: number, heroes?: number[]) {
|
||||
let record = { 'record.heroes': [], 'record.damageRecord': [], 'record.round': 0 };
|
||||
if(heroes && isArray(heroes)) record['record.heroes'] = heroes;
|
||||
if(damageRecord && isArray(damageRecord)) {
|
||||
for(let { hid, damage, heal, underDamage } of damageRecord) {
|
||||
if(isNumber(hid) && isNumber(damage) && isNumber(heal) && isNumber(underDamage)) {
|
||||
record['record.damageRecord'].push({ hid, damage, heal, underDamage });
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isNumber(round)) record['record.round'] = round;
|
||||
return record;
|
||||
}
|
||||
Reference in New Issue
Block a user