Skip to content

Commit

Permalink
接情报AI优化
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Sep 12, 2024
1 parent d81e111 commit ad9c992
Showing 1 changed file with 28 additions and 34 deletions.
62 changes: 28 additions & 34 deletions src/main/kotlin/MessageCardValue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -285,49 +285,43 @@ fun Player.calculateMessageCardValue(
}
inFrontOfWhom.messageCards.removeLast()
}
if (Black in colors && inFrontOfWhom.skills.any { it is ShiSi }) { // 老汉【视死】
if (isPartnerOrSelf(inFrontOfWhom)) {
v1 += 20
} else if (inFrontOfWhom.identity != Black && identity != Black) { // 自己是神秘人就无视,老汉是神秘人也无视
v1 -= 20
fun addScore(p: Player, score: Int) {
if (p.identity != Black) { // 军潜:己方加分,敌方减分,神秘人不管
if (identity == p.identity) v1 += score
if (identity != p.identity && identity != Black) v1 -= score
} else if (p === this) { // 神秘人:自己加分,其他人不管
v1 += score
}
}
if (inFrontOfWhom.skills.any { it is ZhiYin }) { // 程小蝶【知音】
if (Black in colors) {
if (identity == inFrontOfWhom.identity) v1 += 10
if (identity != inFrontOfWhom.identity) v1 -= 10
}
if (inFrontOfWhom.identity != Black) {
if (identity == inFrontOfWhom.identity) v1 += 10
if (identity != inFrontOfWhom.identity) v1 -= 10
} else if (inFrontOfWhom === this) {
v1 += 10
if (Black in colors && inFrontOfWhom.skills.any { it is ShiSi }) { // 老汉【视死】
addScore(inFrontOfWhom, 20)
}
if (inFrontOfWhom.skills.any { it is ZhiYin }) { // 程小蝶【知音】【惊梦】
if (Black in colors) { // 惊梦
addScore(inFrontOfWhom, 10)
}
if (sender.identity != Black) {
if (identity == sender.identity) v1 += 10
if (identity != sender.identity) v1 -= 10
} else if (sender === this) {
v1 += 10
if (colors.any { it != Black }) { // 知音
addScore(inFrontOfWhom, 10)
addScore(sender, 10)
}
}
if (inFrontOfWhom.skills.any { it is MingEr }) { // 老鳖【明饵】
if (Black in colors) {
if (identity == inFrontOfWhom.identity) v1 += 10
if (identity != inFrontOfWhom.identity) v1 -= 10
}
if (inFrontOfWhom.identity != Black) {
if (identity == inFrontOfWhom.identity) v1 += 10
if (identity != inFrontOfWhom.identity) v1 -= 10
} else if (inFrontOfWhom === this) {
v1 += 10
if (colors.any { it != Black }) {
addScore(sender, 10)
addScore(inFrontOfWhom, 10)
}
if (sender.identity != Black) {
if (identity == sender.identity) v1 += 10
if (identity != sender.identity) v1 -= 10
} else if (sender === this) {
v1 += 10
}
if (sender !== inFrontOfWhom && sender.roleFaceUp && sender.skills.any { it is ZhenLi }) {
// 李书云【真理】
if (colors.any { it != Black }) {
addScore(sender, 20)
}
}
if (sender !== inFrontOfWhom && sender.skills.any { it is HanHouLaoShi }) {
// 哑炮【憨厚老实】
addScore(sender, -10)
addScore(inFrontOfWhom, 10)
}
if (Black in colors && inFrontOfWhom.roleFaceUp &&
inFrontOfWhom.skills.any { it is YiXin } && inFrontOfWhom.messageCards.count(Black) == 2) {
// 李宁玉【遗信】
Expand Down

0 comments on commit ad9c992

Please sign in to comment.