mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-25 10:25:42 +07:00
Added distributed ore gen
This commit is contained in:
parent
2165a2af7d
commit
74b6bc5dd3
@ -0,0 +1 @@
|
||||
{version:1,fields:[{name:drownTime,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:range,type:float,size:4},{name:rotation,type:float,size:4},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
@ -0,0 +1 @@
|
||||
{version:1,fields:[{name:baseRotation,type:float,size:4},{name:drownTime,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:range,type:float,size:4},{name:rotation,type:float,size:4},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
@ -0,0 +1 @@
|
||||
{version:1,fields:[{name:drownTime,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:range,type:float,size:4},{name:rotation,type:float,size:4},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
@ -0,0 +1 @@
|
||||
{version:1,fields:[{name:drownTime,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:range,type:float,size:4},{name:rotation,type:float,size:4},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
@ -0,0 +1 @@
|
||||
{version:1,fields:[{name:drownTime,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:range,type:float,size:4},{name:rotation,type:float,size:4},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
Binary file not shown.
@ -34,7 +34,6 @@ public class TODOPlanetGenerator extends PlanetGenerator{
|
||||
{Blocks.darksandWater, Blocks.darksand, Blocks.darksand, Blocks.ice, Blocks.iceSnow, Blocks.iceSnow, Blocks.snow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice}
|
||||
};
|
||||
|
||||
Array<Block> ores = Array.with(Blocks.oreCopper, Blocks.oreLead, Blocks.oreCoal, Blocks.oreCopper);
|
||||
ObjectMap<Block, Block> dec = ObjectMap.of(
|
||||
Blocks.sporeMoss, Blocks.sporeCluster,
|
||||
Blocks.moss, Blocks.sporeCluster
|
||||
@ -195,7 +194,43 @@ public class TODOPlanetGenerator extends PlanetGenerator{
|
||||
|
||||
inverseFloodFill(tiles.getn(spawn.x, spawn.y));
|
||||
|
||||
ores(ores);
|
||||
Array<Block> ores = Array.with(Blocks.oreCopper, Blocks.oreLead);
|
||||
float poles = Math.abs(sector.tile.v.y);
|
||||
float nmag = 0.5f;
|
||||
float scl = 1f;
|
||||
float addscl = 1.3f;
|
||||
|
||||
if(noise.octaveNoise3D(2, 0.5, scl, sector.tile.v.x, sector.tile.v.y, sector.tile.v.z)*nmag + poles > 0.25f*addscl){
|
||||
ores.add(Blocks.oreCoal);
|
||||
}
|
||||
|
||||
if(noise.octaveNoise3D(2, 0.5, scl, sector.tile.v.x + 1, sector.tile.v.y, sector.tile.v.z)*nmag + poles > 0.5f*addscl){
|
||||
ores.add(Blocks.oreTitanium);
|
||||
}
|
||||
|
||||
if(noise.octaveNoise3D(2, 0.5, scl, sector.tile.v.x + 2, sector.tile.v.y, sector.tile.v.z)*nmag + poles > 0.7f*addscl){
|
||||
ores.add(Blocks.oreThorium);
|
||||
}
|
||||
|
||||
FloatArray frequencies = new FloatArray();
|
||||
for(int i = 0; i < ores.size; i++){
|
||||
frequencies.add(rand.random(-0.05f, 0.05f));
|
||||
}
|
||||
|
||||
pass((x, y) -> {
|
||||
if(floor.asFloor().isLiquid) return;
|
||||
|
||||
int offsetX = x - 4, offsetY = y + 23;
|
||||
for(int i = ores.size - 1; i >= 0; i--){
|
||||
Block entry = ores.get(i);
|
||||
float freq = frequencies.get(i);
|
||||
if(Math.abs(0.5f - noise(offsetX, offsetY + i*999, 2, 0.7, (40 + i * 2))) > 0.26f &&
|
||||
Math.abs(0.5f - noise(offsetX, offsetY - i*999, 1, 1, (30 + i * 4))) > 0.37f + freq){
|
||||
ore = entry;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for(Room espawn : enemies){
|
||||
tiles.getn(espawn.x, espawn.y).setOverlay(Blocks.spawn);
|
||||
|
Loading…
Reference in New Issue
Block a user