合成藏宝图不消耗元宝

This commit is contained in:
luying
2020-12-04 13:57:21 +08:00
parent 77ad3d93ed
commit 32e9a782dc
2 changed files with 2 additions and 11 deletions

View File

@@ -770,12 +770,6 @@ export class ComBattleHandler {
if(originalSum != dicCompose.blueprtNum) {
return resResult(STATUS.COM_BLUEPRT_COUNT_ERROR);
}
// 检查元宝
const role = await RoleModel.findByRoleId(roleId);
const costGold = calculateNum(GOLD_COST_RATIO.BLUEPRT_COMPOSE_COST, {num: originalQuality}, 1000);
if(!role || role.gold < costGold) {
return resResult(STATUS.TOWER_GOLD_NOT_ENOUGH);
}
// 添加寻宝币
original.push({
id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.TREASURE_POINT),
@@ -786,8 +780,6 @@ export class ComBattleHandler {
if(!rec) {
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
}
// 消耗元宝
await RoleModel.costGold(roleId, costGold);
const targetList = getBluePrtByQuality(dicCompose.targetQuality);
const target = getRandomByLen(targetList);
@@ -795,6 +787,6 @@ export class ComBattleHandler {
const goods = await handleReward(roleId, roleName, reward);
return resResult(STATUS.SUCCESS, { ...goods, costGold });
return resResult(STATUS.SUCCESS, { ...goods, costGold: 0 });
}
}