优化:初始账号皮肤优化

This commit is contained in:
luying
2021-08-27 18:04:49 +08:00
parent fa3643c314
commit 03bf96a2c1
5 changed files with 49 additions and 28 deletions
+8 -7
View File
@@ -73,13 +73,14 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
let newAttr = new AttributeCal();
newAttr.setByDbData(roleAttrs, heroAttrs);
let heroCe = newAttr.calCe(); // 计算最终战力
let incHeroCe = heroCe - hero.ce;
allIncCe += incHeroCe;
roleCe += heroCe;
pushHeros.push({ hid: hero.hid, ce: reduceCe(hero.ce), incHeroCe: reduceCe(incHeroCe) });
await HeroModel.updateHeroInfo(roleId, hero.hid, { ce: heroCe });
await PvpDefenseModel.updateCe(roleId, hero.hid, incHeroCe); // 更新pvp防守阵战力
if(heroCe != hero.ce) {
let incHeroCe = heroCe - hero.ce;
allIncCe += incHeroCe;
roleCe += heroCe;
pushHeros.push({ hid: hero.hid, ce: reduceCe(hero.ce + heroCe), incHeroCe: reduceCe(incHeroCe) });
await HeroModel.updateHeroInfo(roleId, hero.hid, { ce: heroCe });
await PvpDefenseModel.updateCe(roleId, hero.hid, incHeroCe); // 更新pvp防守阵战力
}
}
let { topLineup, topLineupCe } = await calculatetopLineup(role); // 计算更新最强五人战力