From a3104d41fbcf79bd7601839e848ee02fbadf7a32 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 21 Apr 2026 15:03:26 +0800 Subject: [PATCH] =?UTF-8?q?cp=E7=A4=BC=E7=89=A9=200.7=20=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E7=A4=BC=E7=89=A90.9=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 5eeb88129a8e2aac63b1126aef493a5b0958ab7d) --- .../app/listener/gift/GiveGiftsListener.java | 16 ++++++++++++++-- .../gift/strategy/GiftCountStrategy.java | 7 ++++++- .../gift/strategy/GiftRocketListener.java | 6 +++++- .../gift/strategy/RankCountStrategy.java | 6 +++++- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/GiveGiftsListener.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/GiveGiftsListener.java index 94e81160..c9647ff9 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/GiveGiftsListener.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/GiveGiftsListener.java @@ -525,12 +525,18 @@ public class GiveGiftsListener implements MessageListener { targetAmount = giftValue.getGiftValue().multiply(luckyGiftRatio).setScale(0, RoundingMode.DOWN); acceptAmount = targetAmount; - } else if (event.checkCpGift() || event.checkActivityGift()){ + } else if (event.checkCpGift()){ // CP礼物 acceptAssistRatio = getAssistCpGiftGoldRatio(acceptRegion.getId()); targetAmount = giftValue.getGiftValue().multiply(acceptAssistRatio.multiply(new BigDecimal("10")).min(new BigDecimal("0.7"))).setScale(0, RoundingMode.DOWN); acceptAmount = giftValue.getGiftValue().multiply(acceptAssistRatio).setScale(0, RoundingMode.DOWN); + } else if (event.checkActivityGift()){ + // CP礼物 + acceptAssistRatio = getAssistCpGiftGoldRatio(acceptRegion.getId()); + targetAmount = giftValue.getGiftValue().multiply(acceptAssistRatio.multiply(new BigDecimal("10")).min(new BigDecimal("0.9"))).setScale(0, RoundingMode.DOWN); + acceptAmount = giftValue.getGiftValue().multiply(acceptAssistRatio).setScale(0, RoundingMode.DOWN); + } else if (event.checkMagicGift()) { // 魔法礼物 acceptAssistRatio = new BigDecimal("0.1"); @@ -817,11 +823,17 @@ public class GiveGiftsListener implements MessageListener { // 幸运礼物比例 return gameLuckyGiftCommon.getLuckyGiftTargetRatio(event.getSysOrigin().name()); } - if (event.checkCpGift() || event.checkActivityGift()) { + if (event.checkCpGift()) { BigDecimal multiply = getAssistCpGiftGoldRatio("").multiply(new BigDecimal("10")); BigDecimal min = multiply.min(new BigDecimal("0.7")); return getAssistCpGiftGoldRatio("").multiply(new BigDecimal("10")).min(new BigDecimal("0.7")); } + if (event.checkActivityGift()) { + BigDecimal multiply = getAssistCpGiftGoldRatio("").multiply(new BigDecimal("10")); + BigDecimal min = multiply.min(new BigDecimal("0.9")); + return getAssistCpGiftGoldRatio("").multiply(new BigDecimal("10")).min(new BigDecimal("0.9")); + } + if (event.checkMagicGift()) { return new BigDecimal("0.1"); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java index 884fb89b..1c2ff602 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java @@ -716,11 +716,16 @@ public class GiftCountStrategy implements GiftStrategy { return acceptAmount.multiply(ratio).setScale(0, RoundingMode.DOWN).longValue(); } - if (isActivityGift(giftValue) || isCpGift(giftValue)) { + if (isCpGift(giftValue)) { BigDecimal ratio = new BigDecimal("0.7"); return acceptAmount.multiply(ratio).setScale(0, RoundingMode.DOWN).longValue(); } + if (isActivityGift(giftValue)) { + BigDecimal ratio = new BigDecimal("0.9"); + return acceptAmount.multiply(ratio).setScale(0, RoundingMode.DOWN).longValue(); + } + return acceptAmount.longValue(); } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftRocketListener.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftRocketListener.java index 23996508..7ea648cc 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftRocketListener.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftRocketListener.java @@ -117,10 +117,14 @@ public class GiftRocketListener implements GiftStrategy { return new BigDecimal("0.1"); } - if (isActivityGift(giftValue) || isCpGift(giftValue)) { + if (isCpGift(giftValue)) { return new BigDecimal("0.7"); } + if (isActivityGift(giftValue)) { + return new BigDecimal("0.9"); + } + return BigDecimal.ONE; } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/RankCountStrategy.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/RankCountStrategy.java index 6c7d437e..8b4a8aa4 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/RankCountStrategy.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/RankCountStrategy.java @@ -169,10 +169,14 @@ public class RankCountStrategy implements GiftStrategy { return new BigDecimal("0.1"); } - if (isActivityGift(giftValue) || isCpGift(giftValue)) { + if (isCpGift(giftValue)) { return new BigDecimal("0.7"); } + if (isActivityGift(giftValue)) { + return new BigDecimal("0.9"); + } + return BigDecimal.ONE; }