添加最强五人战力

This commit is contained in:
luying
2020-12-29 16:49:08 +08:00
parent 74c6f19994
commit 315816ea59
11 changed files with 78 additions and 558 deletions
@@ -5,9 +5,8 @@ import { PvpDefenseModel } from '../db/PvpDefense';
import { getWarJsons, getGamedata, getExpeditionById } from '../pubUtils/gamedata';
import { decodeStr, resResult, setLocalHours, shouldRefresh } from '../pubUtils/util';
import { EXPEDITION_CONST, HERO_CE_RATIO } from '../consts';
import { EXPEDITION_CONST, HERO_CE_RATIO, getAttrCeRatio } from '../consts';
import { getAtrrNameById} from '../consts';
import Actor from '../pubUtils/actor';
import { ExpeditionWarRecordModel } from '../db/ExpeditionWarRecord';
export async function findOrCreateEnemies(roleId: string, myCe: number, expeditionCode: string, expeditionId: number, battleStatus: number) {
@@ -110,8 +109,10 @@ export async function matchRobots(scale: number, myCe: number, robotCe: number,
attribute[value] *= ratio;
attribute[value] = Math.round(attribute[value]);
}
let actor = new Actor();
let ce = actor.calculateCEByExpression(attribute);
let ce = 0;
for(let attrName in attribute) {
ce += attribute[attrName] * getAttrCeRatio(attrName);
}
enemyObj.enemies.push({...enemy, attribute, lv});
allCe += ce;
}