战力:修改战力公式

This commit is contained in:
luying
2021-09-01 17:12:00 +08:00
parent 159c354ae3
commit 2273ffe1e0
4 changed files with 18 additions and 6 deletions

View File

@@ -30,6 +30,7 @@ export async function calPlayerCeAndSave(type: number, roleId: string, originHer
let heroAttrs = calPlayerCe(originHero, update, type, args); // 根据操作计算attr的增加
let newAttr = new AttributeCal();
newAttr.setLv(update.lv||originHero.lv);
newAttr.setByDbData(roleAttrs, heroAttrs);
let heroCe = newAttr.calCe(); // 计算最终战力
let incCe = heroCe - originHero.ce;
@@ -69,8 +70,9 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
let roleCe = 0; // 总战力加成
let allIncCe = 0;
for (let hero of heros) {
let { attr: heroAttrs } = hero;
let { attr: heroAttrs, lv } = hero;
let newAttr = new AttributeCal();
newAttr.setLv(lv);
newAttr.setByDbData(roleAttrs, heroAttrs);
let heroCe = newAttr.calCe(); // 计算最终战力
if(heroCe != hero.ce) {