数数:消耗来源

This commit is contained in:
luying
2021-12-14 13:18:29 +08:00
parent e9c471c583
commit b6501ee4a2
70 changed files with 503 additions and 305 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import { MemComBtlTeam } from './../domain/battleField/ComBattleTeamField';
import { ItemModel } from './../db/Item';
import { IT_TYPE } from './../consts';
import { ITEM_CHANGE_REASON, IT_TYPE } from './../consts';
import { COM_BTL_QUALITY } from './../consts/constModules/itemConst';
import { FriendRelationModel } from './../db/FriendRelation';
import { RoleModel, RoleType } from './../db/Role';
@@ -14,7 +14,6 @@ import { getRandRobot, transBossHpArr } from "./battleService";
import { difference, omit } from 'underscore';
import { Channel, ChannelService, pinus } from 'pinus';
import { TREASURE, EXTERIOR } from '../pubUtils/dicParam';
import { addItems, decreaseItems, handleCost } from './rewardService';
import { getFriendLvAdd } from './friendService';
import { getRoleIds } from '../pubUtils/friendUtil';
import { getTeamSearchByQuality, rmRoleFromQueue } from './redisService';
@@ -26,6 +25,7 @@ import { getFriendPointObject } from '../pubUtils/itemUtils';
import { DicWar } from '../pubUtils/dictionary/DicWar';
import { getZeroPointD } from '../pubUtils/timeUtil';
import { dispatch } from '../pubUtils/dispatcher';
import { handleCost } from './rewardService';
/**
* 在给定的品质列表中随机返回一定数量的藏宝图Id
@@ -261,7 +261,7 @@ export async function handleComBtlProgress(teamStatus: MemComBtlTeam, robotHurtT
// 战斗胜利队长扣减藏宝图
if (result && teamStatus.capId != 'robot') {
const { sid } = channel.getMember(teamStatus.capId);
let res = await decreaseItems(teamStatus.capId, sid, [{ id: teamStatus.blueprtId, count: 1 }]);
let res = await handleCost(teamStatus.capId, sid, [{ id: teamStatus.blueprtId, count: 1 }], ITEM_CHANGE_REASON.COM_BATTLE_USE_BLUEPRT);
if (res === true) return resResult(STATUS.COM_BATTLE_BLUEPRT_NOT_ENOUGH);
}
// // 为了背包显示,队长藏宝图在创建队伍的时候就扣掉了,如果输了,返还藏宝图