Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

 Conflicts:
	core/assets/icons/icons.properties
	core/src/mindustry/content/Blocks.java
	core/src/mindustry/world/meta/StatValues.java
This commit is contained in:
Anuken
2021-09-04 23:12:28 -04:00
12 changed files with 70 additions and 75 deletions

View File

@@ -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, rhyolite, rhyoliteCrater, regolith, yellowStone, redIce,
redmat, bluemat,
stoneWall, dirtWall, sporeWall, iceWall, daciteWall, sporePine, snowPine, pine, shrubs, whiteTree, whiteTreeDead, sporeCluster,
@@ -156,7 +156,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;
@@ -384,7 +396,9 @@ public class Blocks implements ContentList{
attributes.set(Attribute.silicate, 1f);
}};
sporeWall = new StaticWall("spore-wall");
sporeWall = new StaticWall("spore-wall"){{
taintedWater.asFloor().wall = deepTaintedWater.asFloor().wall = this;
}};
dirtWall = new StaticWall("dirt-wall");
@@ -547,7 +561,7 @@ public class Blocks implements ContentList{
Seq.with(metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor4, metalFloor5, darkPanel1, darkPanel2, darkPanel3, darkPanel4, darkPanel5, darkPanel6)
.each(b -> b.asFloor().wall = darkMetal);
pebbles = new DoubleOverlayFloor("pebbles");
pebbles = new OverlayFloor("pebbles");
tendrils = new OverlayFloor("tendrils");
@@ -819,10 +833,10 @@ public class Blocks implements ContentList{
disassembler = new Separator("disassembler"){{
requirements(Category.crafting, with(Items.plastanium, 40, Items.titanium, 100, Items.silicon, 150, Items.thorium, 80));
results = with(
Items.sand, 4,
Items.graphite, 2,
Items.titanium, 2,
Items.thorium, 2
Items.sand, 2,
Items.graphite, 1,
Items.titanium, 1,
Items.thorium, 1
);
hasPower = true;
craftTime = 15f;

View File

@@ -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){

View File

@@ -368,7 +368,7 @@ public class ModsDialog extends BaseDialog{
Seq<UnlockableContent> all = Seq.with(content.getContentMap()).<Content>flatten().select(c -> c.minfo.mod == mod && c instanceof UnlockableContent).as();
if(all.any()){
dialog.cont.row();
dialog.cont.button( "@mods.viewcontent", Icon.book, () -> {
dialog.cont.button("@mods.viewcontent", Icon.book, () -> {
BaseDialog d = new BaseDialog(mod.meta.displayName());
d.cont.pane(cs -> {
int i = 0;

View File

@@ -13,6 +13,7 @@ public class AirBlock extends Floor{
hasShadow = false;
useColor = false;
wall = this;
needsSurface = false;
}
@Override

View File

@@ -1,20 +1,10 @@
package mindustry.world.blocks.environment;
import arc.graphics.g2d.*;
import arc.math.*;
import mindustry.world.*;
/** @deprecated pointless, just use your own sprite instead */
@Deprecated
public class DoubleOverlayFloor extends OverlayFloor{
public DoubleOverlayFloor(String name){
super(name);
}
@Override
public void drawBase(Tile tile){
Draw.colorl(0.4f);
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy() - 0.75f);
Draw.color();
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy());
}
}

View File

@@ -128,8 +128,9 @@ public class ItemLiquidGenerator extends PowerGenerator{
liquids.remove(liquid, used * power.graph.getUsageFraction());
productionEfficiency = baseLiquidEfficiency * used / maximumPossible;
if(used > 0.001f && Mathf.chance(0.05 * delta())){
if(used > 0.001f && (generateTime -= delta()) <= 0f){
generateEffect.at(x + Mathf.range(generateEffectRnd), y + Mathf.range(generateEffectRnd));
generateTime = 1f;
}
}else if(hasItems){
// No liquids accepted or none supplied, try using items if accepted

View File

@@ -130,7 +130,7 @@ public class StatValues{
if(state.isGame()){
var blocks = Vars.content.blocks()
.select(block -> (!checkFloors || block instanceof Floor) && indexer.isBlockPresent(block) && block.attributes.get(attr) != 0 && !((block instanceof Floor f && f.isLiquid) && !floating))
.select(block -> (!checkFloors || block instanceof Floor) && indexer.isBlockPresent(block) && block.attributes.get(attr) != 0 && !((block instanceof Floor f && f.isDeep()) && !floating))
.<Floor>as().with(s -> s.sort(f -> f.attributes.get(attr)));
if(blocks.any()){