战力:替换新方法

This commit is contained in:
陆莹
2022-03-26 19:19:51 +08:00
parent 68e4d2232d
commit f35af70adc
18 changed files with 1294 additions and 1249 deletions
@@ -2,7 +2,6 @@ import { ITID, CONSUME_TYPE, ITEM_TABLE, CURRENCY, CURRENCY_TYPE, MAIL_TYPE, HAN
import { getDecimalCnt, getRandEelm, getRandEelmWithWeight, getRandSingleEelm, getRandValueByMinMax, resResult } from '../../pubUtils/util';
import { RoleModel, RoleType } from '../../db/Role';
import { setAp } from '../actionPointService';
import { pushCalAllHeroCe, calPlayerCeAndSave, calAllHeroCe } from '../playerCeService';
import { ItemModel, ItemType } from '../../db/Item';
import { STATUS } from '../../consts/statusCode';
import { pinus } from 'pinus';
@@ -27,6 +26,7 @@ import { checkPopUpConditionInCreateHero } from '../activity/popUpShopService';
import { CreateHeroes } from './createHero';
import { combineItems, getCoinEventProperties, getGoldEventProperties, sortItems } from './util';
import { nowSeconds } from '../../pubUtils/timeUtil';
import { calculateCe } from '../playerCeService';
@@ -82,7 +82,7 @@ export async function handleCost(roleId: string, sid: string, goods: Array<ItemI
}
}
let { newEplace } = updateEplaces(hero.ePlace, update);
await calPlayerCeAndSave(HERO_SYSTEM_TYPE.EQUIP_STRENGTH, sid, roleId, hero, { ePlace: newEplace }, [...update.keys()]);
await calculateCe(HERO_SYSTEM_TYPE.EQUIP_STRENGTH, roleId, role.serverId, sid, { ePlace: newEplace }, {}, { ePlaceIds: [...update.keys()] });
}
@@ -216,8 +216,6 @@ export async function addItems(roleId: string, roleName: string, sid: string, go
pushHeroSkinMsg(heroskins, skinInfos, uids); // 推送onHeroSkinChange
saveItemChangeLog(roleId, skinInfos, reason);
}
// 推送全局加成信息
if(calAllHeroResult) await pushCalAllHeroCe(roleId, sid, calAllHeroResult);
}
// 5. 获得头像和相框等
@@ -362,7 +360,7 @@ export async function addSkin(roleId: string, roleName: string, sid: string, ski
if(skin.hid && !hero) hero = await HeroModel.findByHidAndRole(skin.hid, roleId);
let condition = { type: FIGURE_UNLOCK_CONDITION.GET_SKIN, paramSkinId: skinId };
await unlockFigure(sid, roleId, [condition]); // 解锁头像
await calAllHeroCe(HERO_SYSTEM_TYPE.ADD_SKIN, sid, roleId, {}, [skinId]); // 全局加成
await calculateCe(HERO_SYSTEM_TYPE.ADD_SKIN, roleId, hero.serverId, sid, {}, {}, { skinId }); // 全局加成
if (hero) { // 有武将的,将皮肤链接到武将上
let curSkin = hero.skins.find(cur => cur.id == skinId);