军团fix:领取活跃宝箱记录

This commit is contained in:
luying
2021-01-25 16:37:33 +08:00
parent 90e78bd967
commit d4d4ba825b
6 changed files with 34 additions and 20 deletions

View File

@@ -19,6 +19,7 @@ import { getTeraphAttr, HEROTARIN } from '../consts/constModules/abilityConst'
import { PvpDefenseModel } from '../db/PvpDefense';
const HERO_CE_RATIO = 100;
import { findIndex } from 'underscore';
import { GuildModel } from '../db/Guild';
//战力计算TODO
export function calPlayerCe(globalCeAttr: CeAttrRole, hero: HeroType, type: number, args: Array<number> = []) {
let heroCe = 0;
@@ -118,6 +119,7 @@ export async function calPlayerCeAndSave(roleId: string, heros: Array<HeroType>,
role.ce += incPlayerCe;
let { topFive, topFiveCe } = role;
await RoleModel.updateRoleInfo(roleId, { globalCeAttr: role.globalCeAttr, ce: role.ce, topFive, topFiveCe });
await GuildModel.updateCe(roleId, incPlayerCe);
return { pushHeros, role, topFiveCe }
}