This commit is contained in:
TONY_All 2023-06-16 00:14:37 +08:00
parent ef8e2391d6
commit f1ae6d7f4c
Signed by: tony_all
GPG Key ID: 08A2261D5D6F746A
2 changed files with 6 additions and 5 deletions

View File

@ -48,21 +48,22 @@ class Game(
fun start() { fun start() {
debug("game ${map.name} started.") debug("game ${map.name} started.")
placeBreakRule.defaultRule() placeBreakRule.loadDefaultRule()
state = GameState.START state = GameState.START
timer.startTimer() timer.startTimer()
timer.submitEvent("wall_fall", Duration.ofMinutes(1)) { timer.submitEvent("wall_fall", Duration.ofMinutes(1)) {
broadcast { it.sendLang("game_wall_fall") } broadcast { it.sendLang("game_wall_fall") }
placeBreakRule.addRule("allow_center_wall") { _, _, loc ->
map.wall.contains(loc)
}
submit { submit {
map.wall.forBlocksInArea().forEach { map.wall.forBlocksInArea().forEach {
it.block.type = Material.AIR it.block.type = Material.AIR
} }
placeBreakRule.addRule("allow_center_wall") { _, _, loc ->
map.wall.contains(loc)
}
} }
} }
autoJoinTeam() autoJoinTeam()
teams.forEach { teams.forEach {
it.start() it.start()

View File

@ -33,7 +33,7 @@ class GamePlaceBreakRule(val game: Game) {
rules[name] = rule rules[name] = rule
} }
fun defaultRule() { fun loadDefaultRule() {
// allow mine // allow mine
addRule("allow_mine") { _, _, loc -> addRule("allow_mine") { _, _, loc ->
game.map.teams.flatMap { game.map.teams.flatMap {