Many various campaign mechanic changes
This commit is contained in:
@@ -1,13 +1,41 @@
|
||||
package mindustry.maps.generators;
|
||||
|
||||
import arc.math.geom.*;
|
||||
import arc.util.noise.*;
|
||||
import mindustry.graphics.g3d.*;
|
||||
import mindustry.graphics.g3d.PlanetGrid.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.type.Sector.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
public abstract class PlanetGenerator extends BasicGenerator implements HexMesher{
|
||||
protected Sector sector;
|
||||
|
||||
/** Should generate sector bases for a planet. */
|
||||
public void generateSector(Sector sector){
|
||||
Ptile tile = sector.tile;
|
||||
|
||||
boolean any = false;
|
||||
float noise = Noise.snoise3(tile.v.x, tile.v.y, tile.v.z, 0.001f, 0.5f);
|
||||
|
||||
if(noise > 0.028){
|
||||
any = true;
|
||||
}
|
||||
|
||||
if(noise < 0.15){
|
||||
for(Ptile other : tile.tiles){
|
||||
if(sector.planet.getSector(other).is(SectorAttribute.base)){
|
||||
any = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(any){
|
||||
sector.data.attributes |= (1 << SectorAttribute.base.ordinal());
|
||||
}
|
||||
}
|
||||
|
||||
protected void genTile(Vec3 position, TileGen tile){
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user