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() // 威逼成功后一定纯随机