Skip to content

Commit 0a6cbcd

Browse files
committed
✨ (mapScript/shared/hexed) 更新分队平衡
1 parent b659b83 commit 0a6cbcd

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ sourceSets {
2626
main {
2727
java.srcDir("loader/common")
2828
}
29-
create("mindustry") {
29+
create("mindustry").apply {
3030
compileClasspath += main.get().output
3131
configurations[compileOnlyConfigurationName].extendsFrom(configurations["runtimeClasspath"])
3232
java.srcDir("loader/mindustry/src")
3333
resources.srcDir("loader/mindustry/res")
3434
}
35-
create("bukkit") {
35+
create("bukkit").apply {
3636
compileClasspath += main.get().output
3737
configurations[compileOnlyConfigurationName].extendsFrom(configurations["runtimeClasspath"])
3838
java.srcDir("loader/bukkit/src")

scripts/mapScript/shared/hexed.HexData.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ object HexData {
9292
?.takeIf { it.active() && players.none { pp -> pp.team() == it } }
9393
?.let { return it }
9494

95+
if (Vars.state.teams.active.any { it.team.hexData.hexes.size >= 4 }) {
96+
broadcast("[red][HEX PVP][yellow]巨头出现,进入第二阶段".with())
97+
stage = 2
98+
return assignTeam(p, players)
99+
}
100+
95101
val hex = hexes.filter { it.available() }
96102
.randomOrNull() ?: let {
97103
broadcast("[red][HEX PVP][yellow]所有区块分配完毕, 进入第二阶段".with())
@@ -112,8 +118,7 @@ object HexData {
112118
?.let { return it }
113119
val team = Vars.state.teams.active.select { it.hasCore() }.map { it.team }
114120
.minByOrNull {
115-
players.count { pp -> pp.team() == it } +
116-
it.hexData.hexes.size.coerceAtMost(8)
121+
players.count { pp -> pp.team() == it } * 3 + it.hexData.hexes.size
117122
}
118123
?: Team.get(255)
119124
teams[p.uuid()] = team

0 commit comments

Comments
 (0)