Skip to content

Commit

Permalink
优化金生火AI
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Sep 13, 2024
1 parent f799c59 commit 6d41b2a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/kotlin/MessageCardValue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,16 @@ fun Player.calculateMessageCardValue(
override fun canUse(g: Game, r: Player, vararg args: Any) = false
override fun execute(g: Game, r: Player, vararg args: Any) = Unit
}
if (colors.size == 2 && inFrontOfWhom.skills.any { it is JinShen }) { // 金生火
var valueInFrontOfWhom = 0
for (c in inFrontOfWhom.cards.toList()) {
val v = inFrontOfWhom.calculateMessageCardValue(whoseTurn, inFrontOfWhom, c.colors, checkThreeSame)
if (v > valueInFrontOfWhom) {
valueInFrontOfWhom = v
v1 = calculateMessageCardValue(whoseTurn, inFrontOfWhom, c.colors, checkThreeSame)
}
}
}
if (sender.skills.any { it is MianLiCangZhen }) { // 邵秀
inFrontOfWhom.messageCards.add(TmpCard(colors))
var valueSender = -1
Expand Down

0 comments on commit 6d41b2a

Please sign in to comment.