Skip to content

Commit

Permalink
细化符卡数量不足的错误提示
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed May 4, 2024
1 parent 26287e0 commit 6366e74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/kotlin/SpellConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ object SpellConfig {
}
val spellIds = HashSet<String>()
val result = Array(stars.size) {
val isExMap = map[stars[it]] ?: throw HandlerException("符卡数量不足")
val gameMap = isExMap[false] ?: throw HandlerException("符卡数量不足")
val isExMap = map[stars[it]] ?: throw HandlerException("${stars[it]}星符卡数量不足")
val gameMap = isExMap[false] ?: throw HandlerException("${stars[it]}星符卡数量不足")
var spell: Spell
do {
val game = gameMap.keys.randomOrNull(rand) ?: throw HandlerException("符卡数量不足")
val game = gameMap.keys.randomOrNull(rand) ?: throw HandlerException("${stars[it]}星符卡数量不足")
val spellList = gameMap[game]!!
spell = spellList.removeFirst()
if (spellList.isEmpty()) gameMap.remove(game)
Expand All @@ -75,7 +75,7 @@ object SpellConfig {
firstTry = false
} else {
index = (index + 1) % result.size
if (index == exPos[i]) throw HandlerException("符卡数量不足")
if (index == exPos[i]) throw HandlerException("EX符卡数量不足")
if (index in exPos) continue
}
val isExMap = map[stars[index]] ?: continue
Expand Down

0 comments on commit 6366e74

Please sign in to comment.