From 33ea6927771090c505edc7327af268ce3ae2f59b Mon Sep 17 00:00:00 2001 From: luying Date: Fri, 25 Dec 2020 18:21:23 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=8E=86=E5=8F=B2=E6=88=98=E5=8A=9B?= =?UTF-8?q?=E6=9C=AA=E8=8E=B7=E5=BE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/expeditionService.ts | 4 ++-- shared/db/Hero.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/game-server/app/services/expeditionService.ts b/game-server/app/services/expeditionService.ts index 489715789..4c3c1efde 100644 --- a/game-server/app/services/expeditionService.ts +++ b/game-server/app/services/expeditionService.ts @@ -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, ...} diff --git a/shared/db/Hero.ts b/shared/db/Hero.ts index 596a72b94..aea5dc070 100644 --- a/shared/db/Hero.ts +++ b/shared/db/Hero.ts @@ -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; }