More environmental support

This commit is contained in:
Anuken 2021-06-17 14:34:57 -04:00
parent 23ced8d006
commit b77b89abfb
10 changed files with 14 additions and 2 deletions

View File

@ -16,12 +16,13 @@ public class AsteroidGenerator extends BlankPlanetGenerator{
public void generate(){
int seed = state.rules.sector.planet.id;
int sx = width/2, sy = height/2;
Rand rand = new Rand(seed);
pass((x, y) -> {
floor = Blocks.space;
if(Simplex.noise2d(seed, 5, 0.6f, 1f/ 100f, x, y) + Mathf.dst(x, y, sx, sy) / (float)width / 2f > 0.7f){
floor = Blocks.stone;
if(Simplex.noise2d(seed, 5, 0.5f, 1f / 120f, x, y) - Mathf.dst(x, y, sx, sy) / (width/2f) > 0f){
floor = rand.chance(0.02) ? Blocks.craters : Blocks.stone;
}
});

View File

@ -54,6 +54,7 @@ public class ForceProjector extends Block{
ambientSound = Sounds.shield;
ambientSoundVolume = 0.08f;
consumes.add(new ConsumeCoolant(0.1f)).boost().update(false);
envEnabled |= Env.space;
}
@Override

View File

@ -36,6 +36,7 @@ public class MendProjector extends Block{
hasItems = true;
emitLight = true;
lightRadius = 50f;
envEnabled |= Env.space;
}
@Override

View File

@ -41,6 +41,7 @@ public class OverdriveProjector extends Block{
canOverdrive = false;
emitLight = true;
lightRadius = 50f;
envEnabled |= Env.space;
}
@Override

View File

@ -36,6 +36,7 @@ public class LogicDisplay extends Block{
solid = true;
group = BlockGroup.logic;
drawDisabled = false;
envEnabled = Env.any;
}
@Override

View File

@ -14,6 +14,7 @@ public class MemoryBlock extends Block{
solid = true;
group = BlockGroup.logic;
drawDisabled = false;
envEnabled = Env.any;
}
@Override

View File

@ -17,6 +17,7 @@ public class SwitchBlock extends Block{
drawDisabled = false;
autoResetEnabled = false;
group = BlockGroup.logic;
envEnabled = Env.any;
config(Boolean.class, (SwitchBuild entity, Boolean b) -> entity.enabled = b);
}

View File

@ -11,6 +11,7 @@ import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.logic.*;
import mindustry.world.*;
import mindustry.world.meta.*;
import static mindustry.Vars.*;
@ -25,6 +26,7 @@ public class LightBlock extends Block{
update = true;
configurable = true;
saveConfig = true;
envEnabled |= Env.space;
config(Integer.class, (LightBuild tile, Integer value) -> tile.color = value);
}

View File

@ -20,6 +20,7 @@ public class Pump extends LiquidBlock{
super(name);
group = BlockGroup.liquids;
floating = true;
envEnabled = Env.terrestrial;
}
@Override

View File

@ -59,6 +59,8 @@ public class RepairPoint extends Block{
outlineIcon = true;
//yeah, this isn't the same thing, but it's close enough
group = BlockGroup.projectors;
envEnabled |= Env.space;
}
@Override