fix 历史战力未获得
This commit is contained in:
@@ -5,7 +5,7 @@ import { PvpDefenseModel } from '../db/PvpDefense';
|
||||
|
||||
import { getWarJsons, getGamedata, getExpeditionById } from '../pubUtils/gamedata';
|
||||
import { decodeStr, resResult, setLocalHours, shouldRefresh } from '../pubUtils/util';
|
||||
import { EXPEDITION_CONST } from '../consts';
|
||||
import { EXPEDITION_CONST, HERO_CE_RATIO } from '../consts';
|
||||
import { getAtrrNameById} from '../consts';
|
||||
import Actor from '../pubUtils/actor';
|
||||
import { ExpeditionWarRecordModel } from '../db/ExpeditionWarRecord';
|
||||
@@ -102,7 +102,7 @@ export async function matchRobots(scale: number, myCe: number, robotCe: number,
|
||||
enemyObj.enemyId = fileName + '';
|
||||
|
||||
let allCe = 0;
|
||||
let ratio = myCe / robotCe * scale; // 玩家战力/机器人初始战力*系数
|
||||
let ratio = myCe / HERO_CE_RATIO / HERO_CE_RATIO / robotCe * scale; // 玩家战力/机器人初始战力*系数
|
||||
for(let enemy of dicWarJson) {
|
||||
if(enemy.relation == 2) {
|
||||
let attribute = decodeWarJsonAttribute(enemy.attribute); // 格式:{'hp':1000, ...}
|
||||
|
||||
@@ -70,6 +70,7 @@ interface heroUpdate {
|
||||
scrollStar?: number;
|
||||
scrollColorStar?: number;
|
||||
scrollQuality?: number;
|
||||
historyCe?: number;
|
||||
}
|
||||
|
||||
@index({ roleId: 1, hid: 1 })
|
||||
@@ -178,7 +179,7 @@ export default class Hero extends BaseModel {
|
||||
const seqId = await CounterModel.getNewCounter(COUNTER.HID)||-1;
|
||||
const update = Object.assign(doc.toJSON(), heroInfo, {seqId});
|
||||
delete update._id;
|
||||
const hero: HeroType = await HeroModel.findOneAndUpdate({roleId: heroInfo.roleId, hid: heroInfo.hid}, update, {upsert: true, new: true}).select('seqId hid hName lv exp star starStage colorStar colorStarStage quality job jobStage conections favour favourLv skins equips ce ceAttr').lean(lean);
|
||||
const hero: HeroType = await HeroModel.findOneAndUpdate({roleId: heroInfo.roleId, hid: heroInfo.hid}, update, {upsert: true, new: true}).lean(lean);
|
||||
return hero;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user