prebuildBase is now true for Serpulo
This commit is contained in:
@@ -137,8 +137,6 @@ public class Planets{
|
|||||||
allowLaunchSchematics = true;
|
allowLaunchSchematics = true;
|
||||||
enemyCoreSpawnReplace = true;
|
enemyCoreSpawnReplace = true;
|
||||||
allowLaunchLoadout = true;
|
allowLaunchLoadout = true;
|
||||||
//doesn't play well with configs
|
|
||||||
prebuildBase = false;
|
|
||||||
ruleSetter = r -> {
|
ruleSetter = r -> {
|
||||||
r.waveTeam = Team.crux;
|
r.waveTeam = Team.crux;
|
||||||
r.placeRangeCheck = false;
|
r.placeRangeCheck = false;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import mindustry.net.*;
|
|||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.dialogs.*;
|
import mindustry.ui.dialogs.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
import mindustry.world.blocks.power.PowerNode.*;
|
||||||
import mindustry.world.blocks.storage.CoreBlock.*;
|
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@@ -56,6 +57,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
private boolean hiscore = false;
|
private boolean hiscore = false;
|
||||||
private boolean wasPaused = false, backgroundPaused = false;
|
private boolean wasPaused = false, backgroundPaused = false;
|
||||||
private Seq<Building> toBePlaced = new Seq<>(false);
|
private Seq<Building> toBePlaced = new Seq<>(false);
|
||||||
|
private Seq<Object[]> toBePlacedConfigs = new Seq<>();
|
||||||
|
|
||||||
public Control(){
|
public Control(){
|
||||||
saves = new Saves();
|
saves = new Saves();
|
||||||
@@ -119,6 +121,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
Events.on(ResetEvent.class, event -> {
|
Events.on(ResetEvent.class, event -> {
|
||||||
player.reset();
|
player.reset();
|
||||||
toBePlaced.clear();
|
toBePlaced.clear();
|
||||||
|
toBePlacedConfigs.clear();
|
||||||
indicators.clear();
|
indicators.clear();
|
||||||
|
|
||||||
hiscore = false;
|
hiscore = false;
|
||||||
@@ -239,6 +242,15 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
|
|
||||||
//TODO if the save is unloaded or map is hosted, these blocks do not get built.
|
//TODO if the save is unloaded or map is hosted, these blocks do not get built.
|
||||||
boolean anyBuilds = false;
|
boolean anyBuilds = false;
|
||||||
|
float maxDelay = 0f;
|
||||||
|
|
||||||
|
for(var build : state.rules.defaultTeam.data().buildings){
|
||||||
|
//power nodes need to be configured later once everything is built
|
||||||
|
if(build instanceof PowerNodeBuild){
|
||||||
|
toBePlacedConfigs.add(new Object[]{build, build.config()});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(var build : state.rules.defaultTeam.data().buildings.copy()){
|
for(var build : state.rules.defaultTeam.data().buildings.copy()){
|
||||||
if(!(build instanceof CoreBuild) && !build.block.privileged){
|
if(!(build instanceof CoreBuild) && !build.block.privileged){
|
||||||
var ccore = build.closestCore();
|
var ccore = build.closestCore();
|
||||||
@@ -251,8 +263,10 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
build.tile.remove();
|
build.tile.remove();
|
||||||
|
|
||||||
toBePlaced.add(build);
|
toBePlaced.add(build);
|
||||||
|
float delay = build.dst(ccore) / unitsPerTick + coreDelay;
|
||||||
|
maxDelay = Math.max(delay, maxDelay);
|
||||||
|
|
||||||
Time.run(build.dst(ccore) / unitsPerTick + coreDelay, () -> {
|
Time.run(delay, () -> {
|
||||||
if(build.tile.build != build){
|
if(build.tile.build != build){
|
||||||
placeLandBuild(build);
|
placeLandBuild(build);
|
||||||
|
|
||||||
@@ -269,6 +283,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(anyBuilds){
|
if(anyBuilds){
|
||||||
|
Time.run(maxDelay + 1f, this::configurePlaced);
|
||||||
for(var ccore : state.rules.defaultTeam.data().cores){
|
for(var ccore : state.rules.defaultTeam.data().cores){
|
||||||
Time.run(coreDelay, () -> {
|
Time.run(coreDelay, () -> {
|
||||||
Fx.coreBuildShockwave.at(ccore.x, ccore.y, buildRadius);
|
Fx.coreBuildShockwave.at(ccore.x, ccore.y, buildRadius);
|
||||||
@@ -292,9 +307,19 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
placeLandBuild(build);
|
placeLandBuild(build);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configurePlaced();
|
||||||
toBePlaced.clear();
|
toBePlaced.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void configurePlaced(){
|
||||||
|
for(Object[] obj : toBePlacedConfigs){
|
||||||
|
Building build = (Building)obj[0];
|
||||||
|
Object config = obj[1];
|
||||||
|
build.configureAny(config);
|
||||||
|
}
|
||||||
|
toBePlacedConfigs.clear();
|
||||||
|
}
|
||||||
|
|
||||||
private void placeLandBuild(Building build){
|
private void placeLandBuild(Building build){
|
||||||
build.tile.setBlock(build.block, build.team, build.rotation, () -> build);
|
build.tile.setBlock(build.block, build.team, build.rotation, () -> build);
|
||||||
build.dropped();
|
build.dropped();
|
||||||
|
|||||||
Reference in New Issue
Block a user