From 75f1bca4ac91d337e7958ad199a59471ffccde9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=87=E8=91=A9=E3=81=AE=E7=81=B5=E6=A2=A6?= Date: Sat, 7 Dec 2024 18:02:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DAI=E4=BC=9A=E5=A8=81=E9=80=BC?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=B1=BB=E5=9E=8B=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/card/WeiBi.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/card/WeiBi.kt b/src/main/kotlin/card/WeiBi.kt index 30b6a4af..0ef30ed2 100644 --- a/src/main/kotlin/card/WeiBi.kt +++ b/src/main/kotlin/card/WeiBi.kt @@ -233,12 +233,14 @@ class WeiBi : Card { it.isEnemy(player) && it.cards.any { card -> card.type in availableCardType } }.run { - filter { it!!.cards.any { card -> card.id in player.game!!.canWeiBiCardIds } }.ifEmpty { + filter { it!!.cards.any { card -> + card.id in player.game!!.canWeiBiCardIds && card.type in availableCardType } + }.ifEmpty { filter { it!!.cards.any { card -> card.type in listOf(Jie_Huo, Wu_Dao, Diao_Bao) } }.ifEmpty { this } .run { if (player.identity != Black) filter { it!!.identity != Black }.ifEmpty { this } else this } } }.randomOrNull() ?: return false - val canWeiBiCards = p.cards.filter { it.id in player.game!!.canWeiBiCardIds } + val canWeiBiCards = p.cards.filter { it.id in player.game!!.canWeiBiCardIds && card.type in availableCardType } val cardType = if (canWeiBiCards.isNotEmpty()) canWeiBiCards.random().type // 有明牌优先威逼明牌 else if (player.weiBiFailRate > 0) listOf(Jie_Huo, Wu_Dao, Diao_Bao).random() // 威逼成功后一定纯随机