Bugfixes / Better topological map
This commit is contained in:
@@ -270,6 +270,8 @@ public class Sectors{
|
||||
: new BattleMission());
|
||||
}
|
||||
|
||||
sector.spawns = new Array<>();
|
||||
|
||||
for(Mission mission : sector.missions){
|
||||
sector.spawns.addAll(mission.getWaves(sector));
|
||||
}
|
||||
@@ -296,6 +298,7 @@ public class Sectors{
|
||||
if(headless) return; //obviously not created or needed on server
|
||||
|
||||
Pixmap pixmap = new Pixmap(sectorImageSize * sector.width, sectorImageSize * sector.height, Format.RGBA8888);
|
||||
GenResult secResult = new GenResult();
|
||||
|
||||
for(int x = 0; x < pixmap.getWidth(); x++){
|
||||
for(int y = 0; y < pixmap.getHeight(); y++){
|
||||
@@ -303,8 +306,9 @@ public class Sectors{
|
||||
int toY = y * sectorSize / sectorImageSize;
|
||||
|
||||
GenResult result = world.generator().generateTile(sector.x, sector.y, toX, toY, false);
|
||||
world.generator().generateTile(secResult, sector.x, sector.y, toX, toY + sectorSize / sectorImageSize, false, null, null);
|
||||
|
||||
int color = ColorMapper.colorFor(result.floor, result.wall, Team.none, result.elevation, (byte)0);
|
||||
int color = ColorMapper.colorFor(result.floor, result.wall, Team.none, result.elevation, secResult.elevation > result.elevation ? (byte)(1 << 6) : (byte)0);
|
||||
pixmap.drawPixel(x, pixmap.getHeight() - 1 - y, color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,10 @@ public class TutorialSector{
|
||||
);
|
||||
}
|
||||
|
||||
public static boolean supressDrone(){
|
||||
return world.getSector() != null && world.getSector().x == 0 && world.getSector().y == 0;
|
||||
}
|
||||
|
||||
private static void generateBase(){
|
||||
int x = sectorSize/2, y = sectorSize/2;
|
||||
world.setBlock(world.tile(x, y), StorageBlocks.core, waveTeam);
|
||||
|
||||
@@ -322,13 +322,13 @@ public class WorldGenerator{
|
||||
wall = decoration.get(floor);
|
||||
}
|
||||
|
||||
if(ores != null && ((Floor) floor).hasOres && wall == Blocks.air){
|
||||
int offsetX = 10 + x, offsetY = 10 + y;
|
||||
if(ores != null && ((Floor) floor).hasOres){
|
||||
int offsetX = x + 1, offsetY = y + 15;
|
||||
for(int i = ores.size - 1; i >= 0; i--){
|
||||
Item entry = ores.get(i);
|
||||
if(sim.octaveNoise2D(1, 0.7, 1f / (10 + i * 3), offsetX, offsetY) / 4f +
|
||||
Math.abs(0.5f - sim.octaveNoise2D(2, 0.7, 1f / (50 + i * 2), offsetX, offsetY)) > 0.35f &&
|
||||
Math.abs(0.5f - sim2.octaveNoise2D(1, 1, 1f / (55 + i * 4), offsetX, offsetY)) > 0.33f){
|
||||
if(
|
||||
Math.abs(0.5f - sim.octaveNoise2D(2, 0.7, 1f / (50 + i * 2), offsetX, offsetY)) > 0.23f &&
|
||||
Math.abs(0.5f - sim2.octaveNoise2D(1, 1, 1f / (40 + i * 4), offsetX, offsetY)) > 0.32f){
|
||||
floor = OreBlocks.get(floor, entry);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import io.anuke.mindustry.maps.generation.Generation;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
import static io.anuke.mindustry.Vars.state;
|
||||
import static io.anuke.mindustry.Vars.waveTeam;
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
public class WaveMission extends Mission{
|
||||
private final int target;
|
||||
@@ -30,6 +32,13 @@ public class WaveMission extends Mission{
|
||||
generateCoreAt(gen, coreX, coreY, Team.blue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBegin(){
|
||||
super.onBegin();
|
||||
|
||||
world.pathfinder().activateTeamPath(waveTeam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameMode getMode(){
|
||||
return GameMode.waves;
|
||||
|
||||
Reference in New Issue
Block a user