武将:修复重生战力返回
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Application, BackendSession, ChannelService, HandlerService, } from 'pinus';
|
||||
import { handleCost, addItems, unlockFigure, createHeroes, createHero, CheckMeterial } from '../../../services/rewardService';
|
||||
import { calPlayerCeAndSave, calAllHeroCe } from '../../../services/playerCeService';
|
||||
import { resResult, deepCopy } from '../../../pubUtils/util';
|
||||
import { resResult, deepCopy, reduceCe } from '../../../pubUtils/util';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import { HeroModel, Connect, HeroSkin, HeroUpdate, EPlace } from '../../../db/Hero';
|
||||
import { CURRENCY_BY_TYPE, CURRENCY_TYPE, CONSUME_TYPE, HERO_GROW_MAX, HERO_SYSTEM_TYPE, ABI_STAGE, DEBUG_MAGIC_WORD, HERO_INITIAL_QUALITY, REDIS_KEY, TASK_TYPE, ITEM_CHANGE_REASON } from '../../../consts';
|
||||
@@ -693,7 +693,7 @@ export class HeroHandler {
|
||||
|
||||
let goods = await addItems(roleId, roleName, sid, consumes, ITEM_CHANGE_REASON.REBIRTH);
|
||||
|
||||
return resResult(STATUS.SUCCESS, { curHero, curJewels, goods });
|
||||
return resResult(STATUS.SUCCESS, { curHero: { ...curHero, ce: reduceCe(curHero.ce) }, curJewels, goods });
|
||||
}
|
||||
|
||||
// ! debug接口 一键全武将
|
||||
|
||||
@@ -71,6 +71,7 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
|
||||
let pushHeros = new Array<{ hid: number, ce: number, incHeroCe: number }>();
|
||||
|
||||
let allIncCe = 0;
|
||||
let resultHeroes = [];
|
||||
for (let hero of heros) {
|
||||
let { attr: heroAttrs, lv } = hero;
|
||||
let newAttr = new AttributeCal();
|
||||
@@ -81,8 +82,11 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
|
||||
let incHeroCe = heroCe - hero.ce;
|
||||
allIncCe += incHeroCe;
|
||||
pushHeros.push({ hid: hero.hid, ce: reduceCe(heroCe), incHeroCe: reduceCe(incHeroCe) });
|
||||
await HeroModel.updateHeroInfo(roleId, hero.hid, { ce: heroCe });
|
||||
let resultHero = await HeroModel.updateHeroInfo(roleId, hero.hid, { ce: heroCe });
|
||||
resultHeroes.push(resultHero);
|
||||
await PvpDefenseModel.updateCe(roleId, hero.hid, reduceCe(incHeroCe)); // 更新pvp防守阵战力
|
||||
} else {
|
||||
resultHeroes.push(hero);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -100,7 +104,7 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
|
||||
let guild = await GuildModel.updateCe(roleId, allIncCe); // 公会更新战力
|
||||
|
||||
saveCeChangeLog(role, allIncCe, role.ce, type, args);
|
||||
return { role, pushHeros, ce: role.ce, topLineupCe: role.topLineupCe, guild, serverId: role.serverId, heros }
|
||||
return { role, pushHeros, ce: role.ce, topLineupCe: role.topLineupCe, guild, serverId: role.serverId, heros: resultHeroes }
|
||||
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user