Fixed default campaign core spawning units in blocks

This commit is contained in:
Anuken 2020-09-06 13:26:23 -04:00
parent cbce04f70f
commit 2a995efa2a
4 changed files with 16 additions and 4 deletions

Binary file not shown.

View File

@ -37,7 +37,7 @@ public class Vars implements Loadable{
/** Whether the logger is loaded. */
public static boolean loadedLogger = false, loadedFileLogger = false;
/** Maximum extra padding around deployment schematics. */
public static final int maxLoadoutSchematicPad = 4;
public static final int maxLoadoutSchematicPad = 5;
/** Maximum schematic size.*/
public static final int maxSchematicSize = 32;
/** All schematic base64 starts with this string.*/
@ -134,7 +134,7 @@ public class Vars implements Loadable{
/** whether typing into the console is enabled - developers only */
public static boolean enableConsole = false;
/** whether to clear sector saves when landing */
public static boolean clearSectors = false;
public static boolean clearSectors = true;
/** whether any light rendering is enabled */
public static boolean enableLight = true;
/** Whether to draw shadows of blocks at map edges and static blocks.

View File

@ -17,7 +17,7 @@ import mindustry.world.*;
import static mindustry.Vars.*;
public class WaveSpawner{
private static final float margin = 40f, coreMargin = tilesize * 3; //how far away from the edge flying units spawn
private static final float margin = 40f, coreMargin = tilesize * 3.5f;
private Seq<Tile> spawns = new Seq<>();
private boolean spawning = false;
@ -91,7 +91,7 @@ public class WaveSpawner{
if(state.rules.attackMode && state.teams.isActive(state.rules.waveTeam) && !state.teams.playerCores().isEmpty()){
Building firstCore = state.teams.playerCores().first();
for(Building core : state.rules.waveTeam.cores()){
Tmp.v1.set(firstCore).sub(core).limit(coreMargin + core.block().size * tilesize);
Tmp.v1.set(firstCore).sub(core).limit(coreMargin + core.block().size * tilesize /2f * Mathf.sqrt2);
cons.accept(core.x + Tmp.v1.x, core.y + Tmp.v1.y, false);
}
}

View File

@ -83,10 +83,22 @@ public class BaseGenerator{
}
});
//replace walls with the correct type
pass(tile -> {
if(tile.block() instanceof Wall && tile.team() == team && tile.block() != wall && tile.block() != wallLarge){
tile.setBlock(tile.block().size == 2 ? wallLarge : wall, team);
}
});
if(wallAngle > 0){
//small walls
pass(tile -> {
//no walls around cores
if(cores.contains(t -> t.within(tile, (3 + 4) * tilesize))){
return;
}
if(tile.block().alwaysReplace){
boolean any = false;