sync
This commit is contained in:
parent
ef8e2391d6
commit
f1ae6d7f4c
|
|
@ -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()
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue