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() {
debug("game ${map.name} started.")
placeBreakRule.defaultRule()
placeBreakRule.loadDefaultRule()
state = GameState.START
timer.startTimer()
timer.submitEvent("wall_fall", Duration.ofMinutes(1)) {
broadcast { it.sendLang("game_wall_fall") }
placeBreakRule.addRule("allow_center_wall") { _, _, loc ->
map.wall.contains(loc)
}
submit {
map.wall.forBlocksInArea().forEach {
it.block.type = Material.AIR
}
placeBreakRule.addRule("allow_center_wall") { _, _, loc ->
map.wall.contains(loc)
}
}
}
autoJoinTeam()
teams.forEach {
it.start()

View File

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