diff --git a/game-server/app/servers/battle/handler/rougeHandler.ts b/game-server/app/servers/battle/handler/rougeHandler.ts index 30cd943e3..bc78aa44d 100644 --- a/game-server/app/servers/battle/handler/rougeHandler.ts +++ b/game-server/app/servers/battle/handler/rougeHandler.ts @@ -674,20 +674,20 @@ export class RougeHandler { if (!shop || shop.optionStatus != ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE) return resResult(STATUS.SHOP_NO_BUY); let dbRecord = await RougelikeRecordModel.findByGameCode(gameCode); - if (!dbRecord || (dbRecord.coin || 0) < shop.price) return resResult(STATUS.COIN_NOT_ENOUGH); + if (!dbRecord || (dbRecord.coin || 0) < shop.discountPrice) return resResult(STATUS.COIN_NOT_ENOUGH); shop.optionStatus = ROUGE_LIKE_CHOOSE_REWARD.CHOOSE; await RougelikeRecordDetailModel.updateShopByCode(gameCode, detailCode, optionIndex, shop.optionStatus); - await RougelikeRecordModel.updateByGameCode(gameCode, { $set: { coin: (dbRecord.coin || 0) - shop.price } }); + await RougelikeRecordModel.updateByGameCode(gameCode, { $set: { coin: (dbRecord.coin || 0) - shop.discountPrice } }); let handleAddFun = new HandleAddCard(session, gameCode, dbDetail); handleAddFun.pushCard(shop.rewardId, shop.rewardType); let result = await handleAddFun.save(); result = await handleAddFun.getHolyEffect(); - return resResult(STATUS.SUCCESS, { curShop: shop, ...result, redCoin: -shop.price }); + return resResult(STATUS.SUCCESS, { curShop: shop, ...result, redCoin: -shop.discountPrice }); }