mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
Fixed default campaign core spawning units in blocks
This commit is contained in:
parent
cbce04f70f
commit
2a995efa2a
Binary file not shown.
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user