Skip to content

Commit

Permalink
BP流程支持空ban空保
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Nov 23, 2023
1 parent 329317c commit 0dd43d4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/main/kotlin/BanPick.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,16 @@ class BanPick(private val whoFirst: Int) {
return phase
}
if (phase !in turn[playerIndex]) throw HandlerException("没有轮到你")
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 (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)
}
}
phase = when (phase) {
1 -> 2
Expand Down

0 comments on commit 0dd43d4

Please sign in to comment.