合成藏宝图不消耗元宝

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
@@ -770,12 +770,6 @@ export class ComBattleHandler {
if(originalSum != dicCompose.blueprtNum) { if(originalSum != dicCompose.blueprtNum) {
return resResult(STATUS.COM_BLUEPRT_COUNT_ERROR); 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({ original.push({
id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.TREASURE_POINT), id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.TREASURE_POINT),
@@ -786,8 +780,6 @@ export class ComBattleHandler {
if(!rec) { if(!rec) {
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH); return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
} }
// 消耗元宝
await RoleModel.costGold(roleId, costGold);
const targetList = getBluePrtByQuality(dicCompose.targetQuality); const targetList = getBluePrtByQuality(dicCompose.targetQuality);
const target = getRandomByLen(targetList); const target = getRandomByLen(targetList);
@@ -795,6 +787,6 @@ export class ComBattleHandler {
const goods = await handleReward(roleId, roleName, reward); const goods = await handleReward(roleId, roleName, reward);
return resResult(STATUS.SUCCESS, { ...goods, costGold }); return resResult(STATUS.SUCCESS, { ...goods, costGold: 0 });
} }
} }
+1 -2
View File
@@ -257,8 +257,7 @@ export const GOLD_COST_RATIO = {
"TOWER_HANG_SPDUP": { "A": 0, "B": 50 }, // 天梯挂机加速花费 "TOWER_HANG_SPDUP": { "A": 0, "B": 50 }, // 天梯挂机加速花费
"TOWER_TASK_REF": { "A": 0, "B": 50 }, // 天梯派遣刷新花费 "TOWER_TASK_REF": { "A": 0, "B": 50 }, // 天梯派遣刷新花费
"DAILY_REF_NUM": { "A": 50, "B": 0 }, // 每日购买次数花费 "DAILY_REF_NUM": { "A": 50, "B": 0 }, // 每日购买次数花费
"DUNGRON_BUY_NUM": { "A": 0, "B": 50 }, // 秘境购买次数花费 "DUNGRON_BUY_NUM": { "A": 0, "B": 50 } // 秘境购买次数花费
"BLUEPRT_COMPOSE_COST": { "A": 0, "B": 1000 } // 寻宝合成花费
} }
export const EXPRESSION = { export const EXPRESSION = {