Skip to content

Commit

Permalink
神秘人不使用试探(fix #319)
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Jan 3, 2025
1 parent d04cb1c commit 31bf024
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/main/kotlin/card/ShiTan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -253,26 +253,8 @@ class ShiTan : Card {
}
}

player.identity == Black -> {
player.game!!.players.any {
it!!.alive && it.identity in listOf(Red, Blue) && it.messageCards.count(it.identity) == 2
} || return false
// 按照和自己身份相同的情报数降序排列,然后按照手牌数升序排列
val c1: Comparator<Player?> = Comparator { p1, p2 ->
val p1MsgCount = p1!!.messageCards.count(p1.identity)
val p2MsgCount = p2!!.messageCards.count(p2.identity)
if (p1MsgCount != p2MsgCount)
return@Comparator p2MsgCount.compareTo(p1MsgCount)
p1.cards.size.compareTo(p2.cards.size)
}
val colors = listOf(Red, Blue).filter { it !in (card as ShiTan).whoDrawCard }
if (colors.isEmpty()) return false
else {
listOf(player.game!!.players.filter {
it!!.alive && it.identity in colors && it.cards.isNotEmpty()
}.minWithOrNull(c1))
}
}
player.identity == Black ->
return false

jianXianSheng != null && player.isPartner(jianXianSheng) ->
listOf(jianXianSheng)
Expand Down

0 comments on commit 31bf024

Please sign in to comment.