战力:操作细节

This commit is contained in:
luying
2022-03-28 20:28:47 +08:00
parent 14b28921af
commit 1ccb66e3eb
7 changed files with 267 additions and 63 deletions
@@ -24,7 +24,7 @@ import { JewelModel, JewelType, jewelUpdate, RandSe } from '../../db/Jewel';
import { updateEplaces } from '../equipService';
import { combineItems, getCoinEventProperties, getGoldEventProperties, sortItems } from './util';
import { nowSeconds } from '../../pubUtils/timeUtil';
import { calculateCeWithHero } from '../playerCeService';
import { calculateCeWithHero, calculateWithRole } from '../playerCeService';
@@ -358,7 +358,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 calculateCeWithHero(HERO_SYSTEM_TYPE.ADD_SKIN, roleId, hero.serverId, sid, skin.hid, {}, { skinId }); // 全局加成
await calculateWithRole(HERO_SYSTEM_TYPE.ADD_SKIN, roleId, hero.serverId, sid, {}, { skinId }); // 全局加成
if (hero) { // 有武将的,将皮肤链接到武将上
let curSkin = hero.skins.find(cur => cur.id == skinId);