From 24b0f445b8a7c61343fd3cb8e0107641bc5b656c Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 4 Sep 2021 15:23:47 -0400 Subject: [PATCH] Added rivers on Serpulo / Added deep tainted water --- .../blocks/environment/deep-tainted-water.png | Bin 0 -> 291 bytes .../blocks/environment/tainted-water.png | Bin 290 -> 290 bytes core/assets/bundles/bundle.properties | 1 + core/assets/icons/icons.properties | 1 + core/src/mindustry/content/Blocks.java | 17 ++++++- .../maps/planet/SerpuloPlanetGenerator.java | 43 +++++++++++++++--- .../world/blocks/environment/AirBlock.java | 1 + 7 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 core/assets-raw/sprites/blocks/environment/deep-tainted-water.png diff --git a/core/assets-raw/sprites/blocks/environment/deep-tainted-water.png b/core/assets-raw/sprites/blocks/environment/deep-tainted-water.png new file mode 100644 index 0000000000000000000000000000000000000000..c072c0ebeab3ea74884cb355962c26ecf60397c3 GIT binary patch literal 291 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}cRgJkLn2z= zPIKfsqQK*795i8Gdf$cHXZ|kSkrghc*{Swx@$8?wFI}>kJpah~kAGuB0`DZhH5C+G zYHYfHqKHjBAL9vuI0dZ+p%l#qm0tfCMmL272FXKQn@lI%g zRniG&4vx+2Sps3q$87tUJq%(D{1Q_-6hu0Xsm%-vDw`)XMc|(F1Xhi&=Qy}Jq?1;e zxlDUeEAc|_MPmT-g5F?5O4?q9_ delta 38 tcmZ3)w1{bf3;W(@LVGX8Y@g_TSY(1)Ky=9)^I8TV@O1TaS?83{1OPEX4wV1^ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 039f3bad70..75df389a5f 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1158,6 +1158,7 @@ block.core-nucleus.name = Core: Nucleus block.deep-water.name = Deep Water block.shallow-water.name = Water block.tainted-water.name = Tainted Water +block.deep-tainted-water.name = Deep Tainted Water block.darksand-tainted-water.name = Dark Sand Tainted Water block.tar.name = Tar block.stone.name = Stone diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index 88b2e7d939..2b29514b5b 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -360,3 +360,4 @@ 63349=shallow-water|block-shallow-water-ui 63348=molten-slag|block-molten-slag-ui 63347=crater-stone|block-crater-stone-ui +63346=deep-tainted-water|block-deep-tainted-water-ui diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 6746e14984..4393a72fba 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -35,7 +35,7 @@ public class Blocks implements ContentList{ public static Block //environment - air, spawn, cliff, deepwater, water, taintedWater, tar, slag, stone, craters, charr, sand, darksand, dirt, mud, ice, snow, darksandTaintedWater, space, + air, spawn, cliff, deepwater, water, taintedWater, deepTaintedWater, tar, slag, stone, craters, charr, sand, darksand, dirt, mud, ice, snow, darksandTaintedWater, space, dacite, stoneWall, dirtWall, sporeWall, iceWall, daciteWall, sporePine, snowPine, pine, shrubs, whiteTree, whiteTreeDead, sporeCluster, iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, grass, salt, @@ -142,7 +142,19 @@ public class Blocks implements ContentList{ }}; taintedWater = new Floor("tainted-water"){{ - speedMultiplier = 0.17f; + speedMultiplier = 0.5f; + variants = 0; + status = StatusEffects.wet; + statusDuration = 90f; + liquidDrop = Liquids.water; + isLiquid = true; + cacheLayer = CacheLayer.water; + albedo = 0.5f; + attributes.set(Attribute.spores, 0.15f); + }}; + + deepTaintedWater = new Floor("deep-tainted-water"){{ + speedMultiplier = 0.18f; variants = 0; status = StatusEffects.wet; statusDuration = 140f; @@ -313,6 +325,7 @@ public class Blocks implements ContentList{ sporeWall = new StaticWall("spore-wall"){{ variants = 2; + taintedWater.asFloor().wall = deepTaintedWater.asFloor().wall = this; }}; dirtWall = new StaticWall("dirt-wall"){{ diff --git a/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java b/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java index 112838d405..b00ba5d3a6 100644 --- a/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java @@ -23,6 +23,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ BaseGenerator basegen = new BaseGenerator(); float scl = 5f; float waterOffset = 0.07f; + boolean genLakes = false; Block[][] arr = { @@ -33,11 +34,11 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ {Blocks.deepwater, Blocks.water, Blocks.sandWater, Blocks.sand, Blocks.salt, Blocks.sand, Blocks.sand, Blocks.basalt, Blocks.snow, Blocks.snow, Blocks.snow, Blocks.snow, Blocks.ice}, {Blocks.deepwater, Blocks.water, Blocks.sandWater, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.moss, Blocks.iceSnow, Blocks.snow, Blocks.snow, Blocks.ice, Blocks.snow, Blocks.ice}, {Blocks.deepwater, Blocks.sandWater, Blocks.sand, Blocks.sand, Blocks.moss, Blocks.moss, Blocks.snow, Blocks.basalt, Blocks.basalt, Blocks.basalt, Blocks.ice, Blocks.snow, Blocks.ice}, - {Blocks.taintedWater, Blocks.darksandTaintedWater, Blocks.darksand, Blocks.darksand, Blocks.basalt, Blocks.moss, Blocks.basalt, Blocks.hotrock, Blocks.basalt, Blocks.ice, Blocks.snow, Blocks.ice, Blocks.ice}, + {Blocks.deepTaintedWater, Blocks.darksandTaintedWater, Blocks.darksand, Blocks.darksand, Blocks.basalt, Blocks.moss, Blocks.basalt, Blocks.hotrock, Blocks.basalt, Blocks.ice, Blocks.snow, Blocks.ice, Blocks.ice}, {Blocks.darksandWater, Blocks.darksand, Blocks.darksand, Blocks.darksand, Blocks.moss, Blocks.sporeMoss, Blocks.snow, Blocks.basalt, Blocks.basalt, Blocks.ice, Blocks.snow, Blocks.ice, Blocks.ice}, {Blocks.darksandWater, Blocks.darksand, Blocks.darksand, Blocks.sporeMoss, Blocks.ice, Blocks.ice, Blocks.snow, Blocks.snow, Blocks.snow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice}, - {Blocks.taintedWater, Blocks.darksandTaintedWater, Blocks.darksand, Blocks.sporeMoss, Blocks.sporeMoss, Blocks.ice, Blocks.ice, Blocks.snow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice}, - {Blocks.darksandTaintedWater, Blocks.darksandTaintedWater, Blocks.darksand, Blocks.sporeMoss, Blocks.moss, Blocks.sporeMoss, Blocks.iceSnow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice}, + {Blocks.deepTaintedWater, Blocks.darksandTaintedWater, Blocks.darksand, Blocks.sporeMoss, Blocks.sporeMoss, Blocks.ice, Blocks.ice, Blocks.snow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice}, + {Blocks.taintedWater, Blocks.darksandTaintedWater, Blocks.darksand, Blocks.sporeMoss, Blocks.moss, Blocks.sporeMoss, Blocks.iceSnow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice}, {Blocks.darksandWater, Blocks.darksand, Blocks.snow, Blocks.ice, Blocks.iceSnow, Blocks.snow, Blocks.snow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice} }; @@ -255,10 +256,35 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ for(Room room : roomseq){ spawn.connect(room); } + Room fspawn = spawn; cells(1); distort(10f, 6f); + //rivers + pass((x, y) -> { + if(block.solid) return; + + Vec3 v = sector.rect.project(x, y); + + float rr = Simplex.noise2d(sector.id, (float)2, 0.6f, 1f / 7f, x, y) * 0.1f; + float value = Ridged.noise3d(2, v.x, v.y, v.z, 1, 1f / 53f) + rr - rawHeight(v) * 0f; + float rrscl = rr * 44 - 2; + + if(value > 0.12f && !Mathf.within(x, y, fspawn.x, fspawn.y, 12 + rrscl)){ + boolean deep = value > 0.12f + 0.1f && !Mathf.within(x, y, fspawn.x, fspawn.y, 15 + rrscl); + boolean spore = floor != Blocks.sand && floor != Blocks.salt; + //do not place rivers on ice, they're frozen + //ignore pre-existing liquids + if(!(floor == Blocks.ice || floor == Blocks.iceSnow || floor == Blocks.snow || floor.asFloor().isLiquid)){ + floor = spore ? + (deep ? Blocks.taintedWater : Blocks.darksandTaintedWater) : + (deep ? Blocks.water : + (floor == Blocks.sand ? Blocks.sandWater : Blocks.darksandWater)); + } + } + }); + Seq ores = Seq.with(Blocks.oreCopper, Blocks.oreLead); float poles = Math.abs(sector.tile.v.y); float nmag = 0.5f; @@ -326,7 +352,6 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ 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 && !(roomseq.contains(r -> Mathf.within(x, y, r.x, r.y, 15)))){ floor = Blocks.tar; - ore = Blocks.air; } } @@ -347,7 +372,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ floor = Blocks.magmarock; } } - }else if(floor != Blocks.basalt && floor != Blocks.ice && floor.asFloor().hasSurface()){ + }else if(genLakes && floor != Blocks.basalt && floor != Blocks.ice && floor.asFloor().hasSurface()){ float noise = noise(x + 782, y, 5, 0.75f, 260f, 1f); if(noise > 0.67f && !roomseq.contains(e -> Mathf.within(x, y, e.x, e.y, 14))){ if(noise > 0.72f){ @@ -355,7 +380,6 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ }else{ floor = (floor == Blocks.sand ? floor : Blocks.darksand); } - ore = Blocks.air; } } @@ -470,6 +494,13 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ } } + //remove invalid ores + for(Tile tile : tiles){ + if(tile.overlay().needsSurface && !tile.floor().hasSurface()){ + tile.setOverlay(Blocks.air); + } + } + Schematics.placeLaunchLoadout(spawn.x, spawn.y); for(Room espawn : enemies){ diff --git a/core/src/mindustry/world/blocks/environment/AirBlock.java b/core/src/mindustry/world/blocks/environment/AirBlock.java index 4ecd1667df..b100bbc4ef 100644 --- a/core/src/mindustry/world/blocks/environment/AirBlock.java +++ b/core/src/mindustry/world/blocks/environment/AirBlock.java @@ -13,6 +13,7 @@ public class AirBlock extends Floor{ hasShadow = false; useColor = false; wall = this; + needsSurface = false; } @Override