mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
Added rivers on Serpulo / Added deep tainted water
This commit is contained in:
parent
3f49807348
commit
24b0f445b8
Binary file not shown.
After Width: | Height: | Size: 291 B |
Binary file not shown.
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"){{
|
||||
|
@ -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<Block> 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){
|
||||
|
@ -13,6 +13,7 @@ public class AirBlock extends Floor{
|
||||
hasShadow = false;
|
||||
useColor = false;
|
||||
wall = this;
|
||||
needsSurface = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user