From f22be2f69918a33a405d80ed26b6cc5a5171fdc2 Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Sat, 21 Oct 2023 22:30:26 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=82=AC=E3=83=81=E3=83=A3=E6=99=AF?= =?UTF-8?q?=E5=93=81=E3=83=AA=E3=82=B9=E3=83=88=E3=82=92=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E3=81=A7?= =?UTF-8?q?=E5=90=88=E8=A8=88=E7=A2=BA=E7=8E=87=E3=81=8C=E3=81=8A=E3=81=8B?= =?UTF-8?q?=E3=81=97=E3=81=8F=E3=81=AA=E3=82=8B=E4=B8=8D=E5=85=B7=E5=90=88?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../subsystems/gacha/bukkit/GachaCommand.scala | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/GachaCommand.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/GachaCommand.scala index 4852736ee5..70dfcdabca 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/GachaCommand.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/GachaCommand.scala @@ -244,12 +244,13 @@ class GachaCommand[F[_]: OnMinecraftServerThread: ConcurrentEffect]( ContextualExecutorBuilder.beginConfiguration.buildWithExecutionCSEffect { context => val eventName = context.args.yetToBeParsed.headOption.map(GachaEventName) Kleisli.liftF(gachaPrizeAPI.allGachaPrizeList).flatMap { gachaPrizes => - val gachaPrizeInformation = gachaPrizes - .filter { gachaPrize => - if (eventName.isEmpty) gachaPrize.nonGachaEventItem - else - gachaPrize.gachaEvent.map(_.eventName) == eventName - } + val eventGachaPrizes = gachaPrizes.filter { gachaPrize => + if (eventName.isEmpty) gachaPrize.nonGachaEventItem + else + gachaPrize.gachaEvent.map(_.eventName) == eventName + } + + val gachaPrizeInformation = eventGachaPrizes .sortBy(_.id.id) .map { gachaPrize => val itemStack = gachaPrize.itemStack @@ -261,7 +262,7 @@ class GachaCommand[F[_]: OnMinecraftServerThread: ConcurrentEffect]( } .toList - val totalProbability = gachaPrizes.map(_.probability.value).sum + val totalProbability = eventGachaPrizes.map(_.probability.value).sum MessageEffectF( List(s"${RED}アイテム番号|アイテム名|アイテム数|出現確率") ++ gachaPrizeInformation ++ List( s"${RED}合計確率: $totalProbability(${totalProbability * 100}%)",