修改远征创建记录逻辑

This commit is contained in:
luying
2020-11-17 10:07:59 +08:00
parent d5a5cfc270
commit 0e2f043f93
26 changed files with 2147 additions and 1150 deletions

View File

@@ -121,7 +121,7 @@ export function decodeIdCntArrayStr(str: string, multi: number) {
// 计算当前武将战力
export async function calculateSumCE(roleId: string, type: number, param: { num?: number, heroes?: Array<number> }) {
let sum;
if(type == 1) { // 最高num人战力和
if(type == 1) { // 最高num人历史最高战力和
sum = await HeroModel.sumTopHeroCe(roleId, param.num||0);
} else if(type == 2) { // 所有人战力和
sum = await HeroModel.sumHeroCe(roleId);
@@ -329,7 +329,8 @@ export function setLocalHours(hour: number, curTime = new Date()) {
export async function updateCe(roleId: string, hero: any ) {
let {hid, ce: oldCe, historyCe} = hero;
let actor = new Actor(hero);
let actor = new Actor();
actor.initHero(hero);
let ce = actor.calculateCE();
if(ce != oldCe) {
// 更新总战力&最强五人战力
@@ -339,4 +340,4 @@ export async function updateCe(roleId: string, hero: any ) {
// 更新武将战力,历史最高战力
await HeroModel.updateCe(roleId, hid, ce, oldCe, historyCe);
}
}
}