River noise target field
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
63743=spawn|block-spawn-ui
|
63743=spawn|block-spawn-ui
|
||||||
63742=deepwater|block-deepwater-ui
|
63742=deepwater|block-deepwater-ui
|
||||||
63741=water|block-shallow-water-ui
|
63741=shallow-water|block-shallow-water-ui
|
||||||
63740=tainted-water|block-tainted-water-ui
|
63740=tainted-water|block-tainted-water-ui
|
||||||
63739=darksand-tainted-water|block-darksand-tainted-water-ui
|
63739=darksand-tainted-water|block-darksand-tainted-water-ui
|
||||||
63738=sand-water|block-sand-water-ui
|
63738=sand-water|block-sand-water-ui
|
||||||
@@ -357,7 +357,6 @@
|
|||||||
63357=crux|team-crux
|
63357=crux|team-crux
|
||||||
63358=derelict|team-derelict
|
63358=derelict|team-derelict
|
||||||
63350=deep-water|block-deep-water-ui
|
63350=deep-water|block-deep-water-ui
|
||||||
63349=shallow-water|block-shallow-water-ui
|
|
||||||
63348=molten-slag|block-molten-slag-ui
|
63348=molten-slag|block-molten-slag-ui
|
||||||
63347=crater-stone|block-crater-stone-ui
|
63347=crater-stone|block-crater-stone-ui
|
||||||
63346=deep-tainted-water|block-deep-tainted-water-ui
|
63346=deep-tainted-water|block-deep-tainted-water-ui
|
||||||
|
|||||||
Binary file not shown.
@@ -8,7 +8,7 @@ import static mindustry.maps.filters.FilterOption.*;
|
|||||||
|
|
||||||
public class RiverNoiseFilter extends GenerateFilter{
|
public class RiverNoiseFilter extends GenerateFilter{
|
||||||
float scl = 40, threshold = 0f, threshold2 = 0.1f, octaves = 1, falloff = 0.5f;
|
float scl = 40, threshold = 0f, threshold2 = 0.1f, octaves = 1, falloff = 0.5f;
|
||||||
Block floor = Blocks.water, floor2 = Blocks.deepwater, block = Blocks.sandWall;
|
Block floor = Blocks.water, floor2 = Blocks.deepwater, block = Blocks.sandWall, target = Blocks.air;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FilterOption[] options(){
|
public FilterOption[] options(){
|
||||||
@@ -18,6 +18,7 @@ public class RiverNoiseFilter extends GenerateFilter{
|
|||||||
new SliderOption("threshold2", () -> threshold2, f -> threshold2 = f, -1f, 1f),
|
new SliderOption("threshold2", () -> threshold2, f -> threshold2 = f, -1f, 1f),
|
||||||
new SliderOption("octaves", () -> octaves, f -> octaves = f, 1f, 10f),
|
new SliderOption("octaves", () -> octaves, f -> octaves = f, 1f, 10f),
|
||||||
new SliderOption("falloff", () -> falloff, f -> falloff = f, 0f, 1f),
|
new SliderOption("falloff", () -> falloff, f -> falloff = f, 0f, 1f),
|
||||||
|
new BlockOption("target", () -> target, b -> target = b, anyOptional),
|
||||||
new BlockOption("block", () -> block, b -> block = b, wallsOnly),
|
new BlockOption("block", () -> block, b -> block = b, wallsOnly),
|
||||||
new BlockOption("floor", () -> floor, b -> floor = b, floorsOnly),
|
new BlockOption("floor", () -> floor, b -> floor = b, floorsOnly),
|
||||||
new BlockOption("floor2", () -> floor2, b -> floor2 = b, floorsOnly)
|
new BlockOption("floor2", () -> floor2, b -> floor2 = b, floorsOnly)
|
||||||
@@ -26,14 +27,14 @@ public class RiverNoiseFilter extends GenerateFilter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public char icon(){
|
public char icon(){
|
||||||
return Iconc.blockWater;
|
return Iconc.blockShallowWater;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply(GenerateInput in){
|
public void apply(GenerateInput in){
|
||||||
float noise = rnoise(in.x, in.y, (int)octaves, scl, falloff, 1f);
|
float noise = rnoise(in.x, in.y, (int)octaves, scl, falloff, 1f);
|
||||||
|
|
||||||
if(noise >= threshold){
|
if(noise >= threshold && (target == Blocks.air || in.floor == target || in.block == target)){
|
||||||
in.floor = floor;
|
in.floor = floor;
|
||||||
|
|
||||||
if(in.block.solid){
|
if(in.block.solid){
|
||||||
|
|||||||
Reference in New Issue
Block a user