From ad2bda8ec1f21870b7eefa5fe1f3ee0c86f2a54a Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 11 Oct 2020 13:33:02 -0400 Subject: [PATCH] Better sector gen --- core/src/mindustry/core/Logic.java | 2 ++ .../maps/planet/SerpuloPlanetGenerator.java | 27 +++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index 31dee47410..0b79c97528 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -88,6 +88,8 @@ public class Logic implements ApplicationListener{ if(state.isCampaign()){ long seconds = state.rules.sector.getSecondsPassed(); CoreBuild core = state.rules.defaultTeam.core(); + //THE WAVES NEVER END + state.rules.waves = true; //apply fractional damage based on how many turns have passed for this sector float turnsPassed = seconds / (turnDuration / 60f); diff --git a/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java b/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java index 781bbdb7b5..fab208fd05 100644 --- a/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java @@ -252,10 +252,6 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ } }); - for(Room espawn : enemies){ - tiles.getn(espawn.x, espawn.y).setOverlay(Blocks.spawn); - } - trimDark(); median(2); @@ -273,7 +269,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ //tar if(floor == Blocks.darksand){ if(Math.abs(0.5f - noise(x - 40, y, 2, 0.7, 80)) > 0.25f && - Math.abs(0.5f - noise(x, y + sector.id*10, 1, 1, 60)) > 0.41f){ + Math.abs(0.5f - noise(x, y + sector.id*10, 1, 1, 60)) > 0.41f && !(enemies.contains(r -> Mathf.within(x, y, r.x, r.y, 15)))){ floor = Blocks.tar; ore = Blocks.air; } @@ -298,6 +294,23 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ } } + if(rand.chance(0.0075)){ + //random spore trees + boolean any = false; + boolean all = true; + for(Point2 p : Geometry.d4){ + Tile other = tiles.get(x + p.x, y + p.y); + if(other != null && other.block() == Blocks.air){ + any = true; + }else{ + all = false; + } + } + if(any && ((block == Blocks.snowWall || block == Blocks.iceWall) || (all && block == Blocks.air && floor == Blocks.snow && rand.chance(0.03)))){ + block = rand.chance(0.5) ? Blocks.whiteTree : Blocks.whiteTreeDead; + } + } + //random stuff dec: { for(int i = 0; i < 4; i++){ @@ -392,6 +405,10 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ Schematics.placeLaunchLoadout(spawn.x, spawn.y); + for(Room espawn : enemies){ + tiles.getn(espawn.x, espawn.y).setOverlay(Blocks.spawn); + } + if(sector.hasEnemyBase()){ basegen.generate(tiles, enemies.map(r -> tiles.getn(r.x, r.y)), tiles.get(spawn.x, spawn.y), state.rules.waveTeam, sector, difficulty);