Skip to content

Commit

Permalink
针对空保空ban的情况进行优化
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Dec 7, 2023
1 parent 752c223 commit 1e34c2d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/main/kotlin/BanPick.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ class BanPick(private val whoFirst: Int) {
if (selection.isNotEmpty()) {
if (phase != 1 && phase != 2 && selection == "EX") throw HandlerException("不能选择EX")
if (selection !in games && selection != "EX") throw HandlerException("参数错误")
if (phase <= 4) {
pick[playerIndex] = arrayOf(*pick[playerIndex], selection)
if (selection == "EX") openEx = arrayOf(1, 1)
} else {
if (selection in pick[0] || selection in pick[1]) throw HandlerException("已经保了的作品,不能ban")
ban[playerIndex] = arrayOf(*ban[playerIndex], selection)
}
}
if (phase <= 4) {
pick[playerIndex] = arrayOf(*pick[playerIndex], selection)
if (selection == "EX") openEx = arrayOf(1, 1)
} else {
if (selection.isNotEmpty() && (selection in pick[0] || selection in pick[1]))
throw HandlerException("已经保了的作品,不能ban")
ban[playerIndex] = arrayOf(*ban[playerIndex], selection)
}
phase = when (phase) {
1 -> 2
Expand Down

0 comments on commit 1e34c2d

Please sign in to comment.