Fixed default campaign core spawning units in blocks
This commit is contained in:
Binary file not shown.
@@ -37,7 +37,7 @@ public class Vars implements Loadable{
|
|||||||
/** Whether the logger is loaded. */
|
/** Whether the logger is loaded. */
|
||||||
public static boolean loadedLogger = false, loadedFileLogger = false;
|
public static boolean loadedLogger = false, loadedFileLogger = false;
|
||||||
/** Maximum extra padding around deployment schematics. */
|
/** Maximum extra padding around deployment schematics. */
|
||||||
public static final int maxLoadoutSchematicPad = 4;
|
public static final int maxLoadoutSchematicPad = 5;
|
||||||
/** Maximum schematic size.*/
|
/** Maximum schematic size.*/
|
||||||
public static final int maxSchematicSize = 32;
|
public static final int maxSchematicSize = 32;
|
||||||
/** All schematic base64 starts with this string.*/
|
/** 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 */
|
/** whether typing into the console is enabled - developers only */
|
||||||
public static boolean enableConsole = false;
|
public static boolean enableConsole = false;
|
||||||
/** whether to clear sector saves when landing */
|
/** whether to clear sector saves when landing */
|
||||||
public static boolean clearSectors = false;
|
public static boolean clearSectors = true;
|
||||||
/** whether any light rendering is enabled */
|
/** whether any light rendering is enabled */
|
||||||
public static boolean enableLight = true;
|
public static boolean enableLight = true;
|
||||||
/** Whether to draw shadows of blocks at map edges and static blocks.
|
/** Whether to draw shadows of blocks at map edges and static blocks.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import mindustry.world.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class WaveSpawner{
|
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 Seq<Tile> spawns = new Seq<>();
|
||||||
private boolean spawning = false;
|
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()){
|
if(state.rules.attackMode && state.teams.isActive(state.rules.waveTeam) && !state.teams.playerCores().isEmpty()){
|
||||||
Building firstCore = state.teams.playerCores().first();
|
Building firstCore = state.teams.playerCores().first();
|
||||||
for(Building core : state.rules.waveTeam.cores()){
|
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);
|
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){
|
if(wallAngle > 0){
|
||||||
|
|
||||||
//small walls
|
//small walls
|
||||||
pass(tile -> {
|
pass(tile -> {
|
||||||
|
//no walls around cores
|
||||||
|
if(cores.contains(t -> t.within(tile, (3 + 4) * tilesize))){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(tile.block().alwaysReplace){
|
if(tile.block().alwaysReplace){
|
||||||
boolean any = false;
|
boolean any = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user