战力:修复战力错误
This commit is contained in:
@@ -100,6 +100,7 @@ import { pick } from "underscore";
|
||||
import { HeroShowParam } from '../domain/roleField/hero';
|
||||
import { saveCeChangeLog } from "./logUtil";
|
||||
import { ActivityInRemote } from "../domain/activityField/activityField";
|
||||
import { AttributeCal } from "../domain/roleField/attribute";
|
||||
|
||||
// 储存在内存中的初始数据
|
||||
export function getInitRoleInfo() {
|
||||
@@ -288,10 +289,14 @@ export class CreateHeroes extends UpdateHeroes {
|
||||
this.updateDbCe(true, heroInfo);
|
||||
// 皮肤使用初始加载进内存的数据
|
||||
let skins = await this.getSkinsOfThisHero(hid, { ...skinInfo, _id: new SkinModel()._id }, false);
|
||||
initHeroInfos.push({ ...heroInfo, skins, _id: new HeroModel()._id });
|
||||
let newAttr = new AttributeCal();
|
||||
newAttr.setLv(heroInfo.lv);
|
||||
newAttr.setByDbData(role.attr, heroInfo.attr);
|
||||
let heroCe = newAttr.calCe(); // 计算最终战力
|
||||
initHeroInfos.push({ ...heroInfo, skins, _id: new HeroModel()._id, ce: heroCe });
|
||||
this.heroNum ++;
|
||||
}
|
||||
// 武将使用初始加载数据插入
|
||||
// 武将使用初始加载数据插入
|
||||
this.resultHeroes = await HeroModel.insertHeroes(this.roleId, this.roleName, this.serverId, initHeroInfos);
|
||||
let heroSkins = this.resultHeroes.map(cur => { return pick(cur, ['hid', 'skins']) });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user