Erekir generation improvements
This commit is contained in:
BIN
core/assets-raw/sprites/blocks/props/yellow-stone-boulder1.png
Normal file
BIN
core/assets-raw/sprites/blocks/props/yellow-stone-boulder1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 636 B |
BIN
core/assets-raw/sprites/blocks/props/yellow-stone-boulder2.png
Normal file
BIN
core/assets-raw/sprites/blocks/props/yellow-stone-boulder2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 720 B |
@@ -469,3 +469,4 @@
|
|||||||
63237=arkycite|liquid-arkycite-ui
|
63237=arkycite|liquid-arkycite-ui
|
||||||
63236=chemical-combustion-chamber|block-chemical-combustion-chamber-ui
|
63236=chemical-combustion-chamber|block-chemical-combustion-chamber-ui
|
||||||
63235=arkyic-stone|block-arkyic-stone-ui
|
63235=arkyic-stone|block-arkyic-stone-ui
|
||||||
|
63234=yellow-stone-boulder|block-yellow-stone-boulder-ui
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class Blocks{
|
|||||||
regolithWall, yellowStoneWall, rhyoliteWall, steamVent, carbonWall, redIceWall, ferricStoneWall, beryllicStoneWall,
|
regolithWall, yellowStoneWall, rhyoliteWall, steamVent, carbonWall, redIceWall, ferricStoneWall, beryllicStoneWall,
|
||||||
ferricStone, ferricCraters, carbonStone, beryllicStone,
|
ferricStone, ferricCraters, carbonStone, beryllicStone,
|
||||||
iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, grass, salt,
|
iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, grass, salt,
|
||||||
shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, carbonBoulder, ferricBoulder, beryllicBoulder,
|
shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, carbonBoulder, ferricBoulder, beryllicBoulder, yellowStoneBoulder,
|
||||||
metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor4, metalFloor5, basalt, magmarock, hotrock, snowWall, saltWall,
|
metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor4, metalFloor5, basalt, magmarock, hotrock, snowWall, saltWall,
|
||||||
darkPanel1, darkPanel2, darkPanel3, darkPanel4, darkPanel5, darkPanel6, darkMetal,
|
darkPanel1, darkPanel2, darkPanel3, darkPanel4, darkPanel5, darkPanel6, darkMetal,
|
||||||
pebbles, tendrils,
|
pebbles, tendrils,
|
||||||
@@ -97,7 +97,8 @@ public class Blocks{
|
|||||||
impactReactor, battery, batteryLarge, powerNode, powerNodeLarge, surgeTower, diode,
|
impactReactor, battery, batteryLarge, powerNode, powerNodeLarge, surgeTower, diode,
|
||||||
|
|
||||||
//power - erekir
|
//power - erekir
|
||||||
turbineCondenser, chemicalCombustionChamber,
|
//TODO rename chemicalCombustionChamber
|
||||||
|
turbineCondenser, chemicalCombustionChamber, pyrolysisGenerator,
|
||||||
beamNode, beamTower,
|
beamNode, beamTower,
|
||||||
|
|
||||||
//production
|
//production
|
||||||
@@ -105,7 +106,7 @@ public class Blocks{
|
|||||||
cliffCrusher, plasmaBore, largePlasmaBore, impactDrill,
|
cliffCrusher, plasmaBore, largePlasmaBore, impactDrill,
|
||||||
|
|
||||||
//storage
|
//storage
|
||||||
coreShard, coreFoundation, coreNucleus, vault, container, unloader,
|
coreShard, coreFoundation, /*TODO core foundation is a bad name, rename to fragment */ coreNucleus, vault, container, unloader,
|
||||||
//storage - erekir
|
//storage - erekir
|
||||||
coreBastion, coreCitadel, coreAcropolis, reinforcedContainer, reinforcedVault,
|
coreBastion, coreCitadel, coreAcropolis, reinforcedContainer, reinforcedVault,
|
||||||
|
|
||||||
@@ -612,6 +613,11 @@ public class Blocks{
|
|||||||
beryllicStone.asFloor().decoration = this;
|
beryllicStone.asFloor().decoration = this;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
yellowStoneBoulder = new Prop("yellow-stone-boulder"){{
|
||||||
|
variants = 2;
|
||||||
|
yellowStone.asFloor().decoration = this;
|
||||||
|
}};
|
||||||
|
|
||||||
metalFloor = new Floor("metal-floor", 0);
|
metalFloor = new Floor("metal-floor", 0);
|
||||||
metalFloorDamaged = new Floor("metal-floor-damaged", 3);
|
metalFloorDamaged = new Floor("metal-floor-damaged", 3);
|
||||||
|
|
||||||
@@ -1952,13 +1958,12 @@ public class Blocks{
|
|||||||
|
|
||||||
//erekir
|
//erekir
|
||||||
|
|
||||||
//TODO work on sprite, green bits?
|
|
||||||
turbineCondenser = new ThermalGenerator("turbine-condenser"){{
|
turbineCondenser = new ThermalGenerator("turbine-condenser"){{
|
||||||
requirements(Category.power, with(Items.graphite, 40, Items.beryllium, 40));
|
requirements(Category.power, with(Items.graphite, 40, Items.beryllium, 40));
|
||||||
attribute = Attribute.vent;
|
attribute = Attribute.vent;
|
||||||
displayEfficiencyScale = 1f / 9f;
|
displayEfficiencyScale = 1f / 9f;
|
||||||
minEfficiency = 9f - 0.0001f;
|
minEfficiency = 9f - 0.0001f;
|
||||||
powerProduction = 4f / 9f;
|
powerProduction = 3f / 9f;
|
||||||
displayEfficiency = false;
|
displayEfficiency = false;
|
||||||
generateEffect = Fx.turbinegenerate;
|
generateEffect = Fx.turbinegenerate;
|
||||||
effectChance = 0.04f;
|
effectChance = 0.04f;
|
||||||
@@ -1972,6 +1977,7 @@ public class Blocks{
|
|||||||
liquidCapacity = 20f;
|
liquidCapacity = 20f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
//TODO rename
|
||||||
chemicalCombustionChamber = new SingleTypeGenerator("chemical-combustion-chamber"){{
|
chemicalCombustionChamber = new SingleTypeGenerator("chemical-combustion-chamber"){{
|
||||||
requirements(Category.power, with(Items.graphite, 40, Items.tungsten, 40, Items.oxide, 40f, Items.silicon, 30));
|
requirements(Category.power, with(Items.graphite, 40, Items.tungsten, 40, Items.oxide, 40f, Items.silicon, 30));
|
||||||
powerProduction = 6f;
|
powerProduction = 6f;
|
||||||
@@ -1993,6 +1999,30 @@ public class Blocks{
|
|||||||
ambientSoundVolume = 0.06f;
|
ambientSoundVolume = 0.06f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
if(false)
|
||||||
|
pyrolysisGenerator = new SingleTypeGenerator("pyrolysis-generator"){{
|
||||||
|
//TODO requirements
|
||||||
|
requirements(Category.power, with(Items.graphite, 50, Items.carbide, 50, Items.oxide, 60f, Items.silicon, 40));
|
||||||
|
powerProduction = 12f;
|
||||||
|
|
||||||
|
//TODO ratios, extra requirements
|
||||||
|
consumes.liquids(LiquidStack.with(Liquids.slag, 20f / 60f, Liquids.arkycite, 20f / 60f));
|
||||||
|
size = 3;
|
||||||
|
useItems = false;
|
||||||
|
|
||||||
|
//TODO water output? hydrogen??
|
||||||
|
|
||||||
|
iconOverride = new String[]{"-bottom", ""};
|
||||||
|
generateEffect = Fx.none;
|
||||||
|
|
||||||
|
ambientSound = Sounds.smelter;
|
||||||
|
ambientSoundVolume = 0.06f;
|
||||||
|
}};
|
||||||
|
|
||||||
|
//TODO volatile reactor;
|
||||||
|
//- input arkycite, ozone(?), some item(?), maybe slag or heat?
|
||||||
|
//- output water, power
|
||||||
|
|
||||||
//endregion power
|
//endregion power
|
||||||
//region production
|
//region production
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ public enum ContentType{
|
|||||||
typeid_UNUSED,
|
typeid_UNUSED,
|
||||||
error,
|
error,
|
||||||
planet,
|
planet,
|
||||||
ammo_UNUSED;
|
ammo_UNUSED,
|
||||||
|
team;
|
||||||
|
|
||||||
public static final ContentType[] all = values();
|
public static final ContentType[] all = values();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import mindustry.ai.Astar.*;
|
|||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
import mindustry.world.blocks.environment.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -343,6 +344,26 @@ public abstract class BasicGenerator implements WorldGenerator{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean nearWall(int x, int y){
|
||||||
|
for(Point2 p : Geometry.d8){
|
||||||
|
Tile other = tiles.get(x + p.x, y + p.y);
|
||||||
|
if(other != null && other.block() != Blocks.air){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean nearAir(int x, int y){
|
||||||
|
for(Point2 p : Geometry.d4){
|
||||||
|
Tile other = tiles.get(x + p.x, y + p.y);
|
||||||
|
if(other != null && other.block() == Blocks.air){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void decoration(float chance){
|
public void decoration(float chance){
|
||||||
pass((x, y) -> {
|
pass((x, y) -> {
|
||||||
for(int i = 0; i < 4; i++){
|
for(int i = 0; i < 4; i++){
|
||||||
@@ -358,6 +379,30 @@ public abstract class BasicGenerator implements WorldGenerator{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void blend(Block floor, Block around, float radius){
|
||||||
|
float r2 = radius*radius;
|
||||||
|
int cap = Mathf.ceil(radius);
|
||||||
|
int max = tiles.width * tiles.height;
|
||||||
|
Floor dest = around.asFloor();
|
||||||
|
|
||||||
|
for(int i = 0; i < max; i++){
|
||||||
|
Tile tile = tiles.geti(i);
|
||||||
|
if(tile.floor() == floor){
|
||||||
|
for(int cx = -cap; cx <= cap; cx++){
|
||||||
|
for(int cy = -cap; cy <= cap; cy++){
|
||||||
|
if(cx*cx + cy*cy <= r2){
|
||||||
|
Tile other = tiles.get(tile.x + cx, tile.y + cy);
|
||||||
|
|
||||||
|
if(other != null && other.floor() != floor){
|
||||||
|
other.setFloor(dest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void brush(Seq<Tile> path, int rad){
|
public void brush(Seq<Tile> path, int rad){
|
||||||
path.each(tile -> erase(tile.x, tile.y, rad));
|
path.each(tile -> erase(tile.x, tile.y, rad));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,11 +92,11 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
|
|
||||||
tile.block = tile.floor.asFloor().wall;
|
tile.block = tile.floor.asFloor().wall;
|
||||||
|
|
||||||
if(Ridged.noise3d(1, position.x, position.y, position.z, 2, 25) > 0.2){
|
if(Ridged.noise3d(1, position.x, position.y, position.z, 2, 25) > 0.19){
|
||||||
tile.block = Blocks.air;
|
tile.block = Blocks.air;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Ridged.noise3d(2, position.x, position.y + 4f, position.z, 3, 7f) > 0.7){
|
if(Ridged.noise3d(2, position.x, position.y + 4f, position.z, 3, 6f) > 0.65){
|
||||||
tile.floor = Blocks.carbonStone;
|
tile.floor = Blocks.carbonStone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,25 +136,29 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
|
|
||||||
//arkycite
|
//arkycite
|
||||||
pass((x, y) -> {
|
pass((x, y) -> {
|
||||||
|
if(nearWall(x, y)) return;
|
||||||
|
|
||||||
float noise = noise(x + 300, y - x*1.6f + 100, 4, 0.81f, 96f, 1f);
|
float noise = noise(x + 300, y - x*1.6f + 100, 4, 0.8f, 120f, 1f);
|
||||||
|
|
||||||
if(noise > 0.71f){
|
if(noise > 0.71f){
|
||||||
floor = Blocks.arkyciteFloor;
|
floor = Blocks.arkyciteFloor;
|
||||||
}else if(noise > 0.65){
|
|
||||||
floor = Blocks.arkyicStone;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
median(2, 0.6, Blocks.arkyciteFloor);
|
||||||
|
|
||||||
|
//TODO arkycite walls
|
||||||
|
blend(Blocks.arkyciteFloor, Blocks.arkyicStone, 4);
|
||||||
|
|
||||||
distort(10f, 12f);
|
distort(10f, 12f);
|
||||||
distort(5f, 7f);
|
distort(5f, 7f);
|
||||||
|
|
||||||
|
//does arkycite need smoothing?
|
||||||
|
median(2, 0.6, Blocks.arkyciteFloor);
|
||||||
|
|
||||||
//smooth out slag to prevent random 1-tile patches
|
//smooth out slag to prevent random 1-tile patches
|
||||||
median(3, 0.6, Blocks.slag);
|
median(3, 0.6, Blocks.slag);
|
||||||
|
|
||||||
//does arkycite need smoothing?
|
|
||||||
//median(3, 0.6, Blocks.arkyciteFloor);
|
|
||||||
|
|
||||||
pass((x, y) -> {
|
pass((x, y) -> {
|
||||||
float max = 0;
|
float max = 0;
|
||||||
for(Point2 p : Geometry.d8){
|
for(Point2 p : Geometry.d8){
|
||||||
@@ -171,42 +175,29 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
|
|
||||||
tiles.getn(endX, endY).setOverlay(Blocks.spawn);
|
tiles.getn(endX, endY).setOverlay(Blocks.spawn);
|
||||||
|
|
||||||
|
//TODO tech is lazy and boring
|
||||||
tech(Blocks.darkPanel3, Blocks.darkPanel5, Blocks.darkMetal);
|
tech(Blocks.darkPanel3, Blocks.darkPanel5, Blocks.darkMetal);
|
||||||
|
|
||||||
//ores
|
//ores
|
||||||
pass((x, y) -> {
|
pass((x, y) -> {
|
||||||
|
|
||||||
if(block != Blocks.air){
|
if(block != Blocks.air){
|
||||||
boolean empty = false;
|
//TODO use d4 instead of d8 for no out-of-reach ores?
|
||||||
for(Point2 p : Geometry.d8){
|
if(nearAir(x, y)){
|
||||||
Tile other = tiles.get(x + p.x, y + p.y);
|
if(noise(x + 78, y, 4, 0.7f, 35f, 1f) > 0.67f && block == Blocks.carbonWall){
|
||||||
if(other != null && other.block() == Blocks.air){
|
block = Blocks.graphiticWall;
|
||||||
empty = true;
|
}else if(noise(x + 782, y, 4, 0.8f, 40f, 1f) > 0.7f && block != Blocks.carbonWall){
|
||||||
break;
|
ore = Blocks.wallOreBeryl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else if(!nearWall(x, y)){
|
||||||
|
|
||||||
if(empty && noise(x + 78, y, 4, 0.7f, 35f, 1f) > 0.67f && block == Blocks.carbonWall){
|
if(noise(x + 150, y + x*2 + 100, 4, 0.8f, 40f, 1f) > 0.71f/* && floor == Blocks.yellowStone*/){
|
||||||
block = Blocks.graphiticWall;
|
|
||||||
}else if(empty && noise(x + 782, y, 4, 0.8f, 40f, 1f) > 0.7f && block != Blocks.carbonWall){
|
|
||||||
ore = Blocks.wallOreBeryl;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
boolean empty = true;
|
|
||||||
for(Point2 p : Geometry.d8){
|
|
||||||
Tile other = tiles.get(x + p.x, y + p.y);
|
|
||||||
if(other != null && other.block() != Blocks.air){
|
|
||||||
empty = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(empty && noise(x + 150, y + x*2 + 100, 4, 0.8f, 40f, 1f) > 0.71f/* && floor == Blocks.yellowStone*/){
|
|
||||||
ore = Blocks.oreTungsten;
|
ore = Blocks.oreTungsten;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO design ore generation so it doesn't overlap
|
//TODO design ore generation so it doesn't overlap
|
||||||
if(empty && noise(x + 999, y + 600, 4, 0.63f, 37f, 1f) < 0.25f/* && floor == Blocks.yellowStone*/){
|
if(noise(x + 999, y + 600, 4, 0.63f, 37f, 1f) < 0.25f/* && floor == Blocks.yellowStone*/){
|
||||||
ore = Blocks.oreThorium;
|
ore = Blocks.oreThorium;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,6 +230,8 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
decoration(0.015f);
|
||||||
|
|
||||||
//not allowed
|
//not allowed
|
||||||
state.rules.hiddenBuildItems.addAll(Items.copper, Items.titanium, Items.coal, Items.lead, Items.blastCompound, Items.pyratite, Items.sporePod, Items.metaglass, Items.plastanium);
|
state.rules.hiddenBuildItems.addAll(Items.copper, Items.titanium, Items.coal, Items.lead, Items.blastCompound, Items.pyratite, Items.sporePod, Items.metaglass, Items.plastanium);
|
||||||
|
|
||||||
|
|||||||
20
core/src/mindustry/type/TeamEntry.java
Normal file
20
core/src/mindustry/type/TeamEntry.java
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
package mindustry.type;
|
||||||
|
|
||||||
|
import mindustry.ctype.*;
|
||||||
|
import mindustry.game.*;
|
||||||
|
|
||||||
|
/** This class is only for displaying team lore in the content database. */
|
||||||
|
//TODO
|
||||||
|
public class TeamEntry extends UnlockableContent{
|
||||||
|
public final Team team;
|
||||||
|
|
||||||
|
public TeamEntry(Team team){
|
||||||
|
super(team.name);
|
||||||
|
this.team = team;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContentType getContentType(){
|
||||||
|
return ContentType.team;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -115,6 +115,11 @@ public class Floor extends Block{
|
|||||||
//keep default value if not found...
|
//keep default value if not found...
|
||||||
if(wall == null) wall = Blocks.air;
|
if(wall == null) wall = Blocks.air;
|
||||||
|
|
||||||
|
//try to load the default boulder
|
||||||
|
if(decoration == null){
|
||||||
|
decoration = content.block(name + "-boulder");
|
||||||
|
}
|
||||||
|
|
||||||
if(isLiquid && walkEffect == Fx.none){
|
if(isLiquid && walkEffect == Fx.none){
|
||||||
walkEffect = Fx.ripple;
|
walkEffect = Fx.ripple;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user