形象:作为物品获得

This commit is contained in:
luying
2021-03-11 19:30:41 +08:00
parent c895e99851
commit ee9f443f7a
7 changed files with 972 additions and 911 deletions
+11 -2
View File
@@ -8,7 +8,7 @@ import { calAllHeroCe } from './playerCeService';
import { ItemModel } from '../db/Item';
import { STATUS } from '../consts/statusCode';
import { pinus } from 'pinus';
import { addEquips, addBags, addSkins } from '../pubUtils/itemUtils';
import { addEquips, addBags, addSkins, addFigure } from '../pubUtils/itemUtils';
import { EquipInter, ItemInter, BagInter } from '../pubUtils/interface';
import { gameData } from '../pubUtils/data';
import { uniq, indexOf, findIndex } from 'underscore';
@@ -146,6 +146,15 @@ export async function addItems(roleId: string, roleName: string, sid: string, go
if (!!bagInfos.length)
pinus.app.get('channelService').pushMessageByUids('onItemUpdate', resResult(STATUS.SUCCESS, {goods: bagInfos}), uids);
let figureInfo = await addFigure(roleId, figures);
for (let id of figures) {//皮肤推送
showItems.push({id, count: 1});
}
if (!!figureInfo) {
pinus.app.get('channelService').pushMessageByUids('onHeadChange', resResult(STATUS.SUCCESS, { ...figureInfo }), uids);
}
let skinInfos = [];
let addSkinIds = [];
for (let skinId of skins) {//皮肤推送
@@ -207,7 +216,7 @@ function sortItems (goods: Array<ItemInter>, bags: Array<BagInter>, skins: Array
currencysMap[curname] = (currencysMap[curname]||0 )+ good.count;
}
} else {
if (type == CONSUME_TYPE.SKIN) {
if (type == CONSUME_TYPE.HEAD || type == CONSUME_TYPE.FRAME || type == CONSUME_TYPE.SPINE ) {
let index = indexOf(figures, good.id);
if (index == -1) {
figures.push(good.id);