mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-24 13:39:03 +07:00
More environmental support
This commit is contained in:
parent
23ced8d006
commit
b77b89abfb
@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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
|
||||
|
@ -36,6 +36,7 @@ public class MendProjector extends Block{
|
||||
hasItems = true;
|
||||
emitLight = true;
|
||||
lightRadius = 50f;
|
||||
envEnabled |= Env.space;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,6 +41,7 @@ public class OverdriveProjector extends Block{
|
||||
canOverdrive = false;
|
||||
emitLight = true;
|
||||
lightRadius = 50f;
|
||||
envEnabled |= Env.space;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,6 +36,7 @@ public class LogicDisplay extends Block{
|
||||
solid = true;
|
||||
group = BlockGroup.logic;
|
||||
drawDisabled = false;
|
||||
envEnabled = Env.any;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,6 +14,7 @@ public class MemoryBlock extends Block{
|
||||
solid = true;
|
||||
group = BlockGroup.logic;
|
||||
drawDisabled = false;
|
||||
envEnabled = Env.any;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ public class Pump extends LiquidBlock{
|
||||
super(name);
|
||||
group = BlockGroup.liquids;
|
||||
floating = true;
|
||||
envEnabled = Env.terrestrial;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user