pvp保存阵容

This commit is contained in:
mamengke01
2021-01-07 20:36:30 +08:00
parent 5bfac1723c
commit 2470f7582f
8 changed files with 119 additions and 36 deletions
+2 -3
View File
@@ -16,7 +16,7 @@ import { DicRandomEffectPool } from './dictionary/DicRandomEffectPool';
import { getGoodById } from './gamedata';
import { SchoolModel } from '../db/School';
import { getTeraphAttr, HEROTARIN } from '../consts/constModules/abilityConst'
import { PvpDefenseModel } from '../db/PvpDefense';
// import { PvpDefenseModel } from '../db/PvpDefense';
const HERO_CE_RATIO = 100;
const _ = require('underscore');
//战力计算TODO
@@ -108,7 +108,7 @@ export async function calPlayerCeAndSave(roleId: string, heros: Array<HeroType>,
incPlayerCe += incHeroCe;
await calculateTopFive(role, hero.hid, hero.ce, hero._id); // 计算更新最强五人战力
await HeroModel.updateHeroInfo(roleId, hero.hid, hero);
await PvpDefenseModel.updateCe(roleId, hero.hid, hero.ce); // 更新pvp防守阵最强五人战力
//await PvpDefenseModel.updateCe(roleId, hero.hid, hero.ce); // 更新pvp防守阵最强五人战力
pushHeros.push({
hid: hero.hid,
ce: reduceCe(hero.ce),
@@ -152,7 +152,6 @@ async function calculateTopFive(role: RoleType, hid: number, ce: number, heroId:
role.topFive = topFive;
role.topFiveCe = topFiveCe;
return role;
}