✨ feat(兼容): 配表使用后台隐藏物品
This commit is contained in:
@@ -14,7 +14,7 @@ import { calculateCes } from "../playerCeService";
|
||||
import { RoleModel, RoleType, RoleUpdate } from "../../db/Role";
|
||||
import { sendMessageToUserWithSuc } from "../pushService";
|
||||
import { checkTaskInCreateHero } from "../task/taskService";
|
||||
import { Rank } from "../rankService";
|
||||
import { filterHeroes } from "../dataService";
|
||||
|
||||
/**
|
||||
* 创建多个武将
|
||||
@@ -24,6 +24,7 @@ import { Rank } from "../rankService";
|
||||
* @param heroInfo
|
||||
*/
|
||||
export async function createHeroes(roleId: string, roleName: string, sid: string, serverId: number, heroInfo: CreateHeroParam[], initRoleInfos?: RoleUpdate) {
|
||||
heroInfo = filterHeroes(heroInfo, obj => obj.hid, roleId);
|
||||
let hids = heroInfo.map(cur => cur.hid);
|
||||
let userHeroesMap = await HeroModel.findMapByHidRange(hids, roleId);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import { combineItems, getCoinEventProperties, getGoldEventProperties, sortItems
|
||||
import { nowSeconds } from '../../pubUtils/timeUtil';
|
||||
import { calculateCeWithHero, calculateCeWithRole } from '../playerCeService';
|
||||
import { sendMessageToUsersWithSuc, sendMessageToUserWithSuc } from '../pushService';
|
||||
import { filterGoods } from '../dataService';
|
||||
|
||||
|
||||
|
||||
@@ -113,6 +114,7 @@ export async function handleCost(roleId: string, sid: string, goods: Array<ItemI
|
||||
}
|
||||
|
||||
export async function addItems(roleId: string, roleName: string, sid: string, goods: Array<ItemInter>, reason: ITEM_CHANGE_REASON) {
|
||||
goods = filterGoods(goods, obj => obj.id, roleId, reason);
|
||||
let { items, jewels, gold, coin, ap, skins, figures } = sortItems(goods, HANDLE_REWARD_TYPE.RECEIVE);
|
||||
let showItems: { id: number, seqId?: number, count: number, isBag?: boolean }[] = [];
|
||||
let role = await RoleModel.findByRoleId(roleId);
|
||||
@@ -494,11 +496,12 @@ export function getHonourObject(count: number) {
|
||||
*/
|
||||
export function unlockFigureWithoutSave(conditions: { type: number, paramHid?: number, paramFavourLv?: number, paramSkinId?: number, paramWinStreakNum?: number }[], role: RoleType) {
|
||||
|
||||
let { heads, frames, spines } = role;
|
||||
let { heads, frames, spines, roleId } = role;
|
||||
let figureInfo = { heads: new Array<Figure>(), frames: new Array<Figure>(), spines: new Array<Figure>() };
|
||||
for (let { type, paramHid, paramFavourLv, paramSkinId, paramWinStreakNum } of conditions) {
|
||||
let canUnLockList = gameData.figureCondition.get(type);
|
||||
if (canUnLockList) {
|
||||
canUnLockList = filterGoods(canUnLockList, obj => obj.gid, roleId, ITEM_CHANGE_REASON.GET_HERO_UNLOCK_FIGURE);
|
||||
let reason = 0;
|
||||
|
||||
for (let { id, params, gid } of canUnLockList) {
|
||||
|
||||
Reference in New Issue
Block a user