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 a8492fb commit f799c59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/skill/BianZeTong.kt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class BianZeTong : TriggeredSkill {
/**
* 有这个技能的玩家,[cardTypeA]只能当作[cardTypeB]使用
*/
private class BianZeTong2(cardTypeA: card_type, cardTypeB: card_type) : OneTurnSkill,
class BianZeTong2(cardTypeA: card_type, cardTypeB: card_type) : OneTurnSkill,
ConvertCardSkill(cardTypeA, listOf(cardTypeB), true) {
override val isInitialSkill = false
}
Expand Down
10 changes: 7 additions & 3 deletions src/main/kotlin/skill/QiangLing.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.fengsheng.skill

import com.fengsheng.*
import com.fengsheng.protos.Common.card_type
import com.fengsheng.protos.Common.card_type.*
import com.fengsheng.protos.Role.skill_qiang_ling_tos
import com.fengsheng.protos.skillQiangLingToc
import com.fengsheng.protos.skillQiangLingTos
import com.fengsheng.protos.skillWaitForQiangLingToc
import com.fengsheng.skill.BianZeTong.BianZeTong2
import com.google.protobuf.GeneratedMessage
import org.apache.logging.log4j.kotlin.logger
import java.util.concurrent.TimeUnit
Expand Down Expand Up @@ -61,11 +63,13 @@ class QiangLing : TriggeredSkill {
return@post
}
}
fun cannotPlayCard(cardType: card_type): Boolean =
r.cannotPlayCard(cardType) || r.skills.any { it is BianZeTong2 && it.cardTypeA == cardType }
val result = listOf(Jie_Huo, Diao_Bao, Wu_Dao)
.filterNot { r.cannotPlayCard(it) }.run {
.filterNot { cannotPlayCard(it) }.run {
when (size) {
0 -> listOf(Po_Yi, Cheng_Qing).filterNot { r.cannotPlayCard(it) }
1 -> plus(if (event is SendCardEvent && !r.cannotPlayCard(Po_Yi)) Po_Yi else Cheng_Qing)
0 -> listOf(Po_Yi, Cheng_Qing).filterNot { cannotPlayCard(it) }
1 -> plus(if (event is SendCardEvent && !cannotPlayCard(Po_Yi)) Po_Yi else Cheng_Qing)
2 -> this
else -> sortedBy { type -> r.cards.any { it.type == type } }.take(2)
}
Expand Down

0 comments on commit f799c59

Please sign in to comment.