Misc map creation utilities
This commit is contained in:
@@ -395,6 +395,7 @@ waves.title = Waves
|
|||||||
waves.remove = Remove
|
waves.remove = Remove
|
||||||
waves.every = every
|
waves.every = every
|
||||||
waves.waves = wave(s)
|
waves.waves = wave(s)
|
||||||
|
waves.health = health: {0}%
|
||||||
waves.perspawn = per spawn
|
waves.perspawn = per spawn
|
||||||
waves.shields = shields/wave
|
waves.shields = shields/wave
|
||||||
waves.to = to
|
waves.to = to
|
||||||
@@ -510,6 +511,7 @@ filter.option.circle-scale = Circle Scale
|
|||||||
filter.option.octaves = Octaves
|
filter.option.octaves = Octaves
|
||||||
filter.option.falloff = Falloff
|
filter.option.falloff = Falloff
|
||||||
filter.option.angle = Angle
|
filter.option.angle = Angle
|
||||||
|
filter.option.tilt = Tilt
|
||||||
filter.option.rotate = Rotate
|
filter.option.rotate = Rotate
|
||||||
filter.option.amount = Amount
|
filter.option.amount = Amount
|
||||||
filter.option.block = Block
|
filter.option.block = Block
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ public class WaveSpawner{
|
|||||||
return spawning && !net.client();
|
return spawning && !net.client();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reset(){
|
public void reset(){
|
||||||
spawning = false;
|
spawning = false;
|
||||||
spawns.clear();
|
spawns.clear();
|
||||||
|
|
||||||
|
|||||||
@@ -3387,7 +3387,7 @@ public class Blocks{
|
|||||||
|
|
||||||
//TODO requirements
|
//TODO requirements
|
||||||
tankAssembler = new UnitAssembler("tank-assembler"){{
|
tankAssembler = new UnitAssembler("tank-assembler"){{
|
||||||
requirements(Category.units, with(Items.graphite, 10));
|
requirements(Category.units, with(Items.graphite, 600, Items.beryllium, 600, Items.oxide, 200, Items.tungsten, 500));
|
||||||
size = 5;
|
size = 5;
|
||||||
plans.add(new AssemblerUnitPlan(UnitTypes.vanquish, 60f * 10f, BlockStack.list(Blocks.tungstenWallLarge, 5, Blocks.duct, 2)));
|
plans.add(new AssemblerUnitPlan(UnitTypes.vanquish, 60f * 10f, BlockStack.list(Blocks.tungstenWallLarge, 5, Blocks.duct, 2)));
|
||||||
consumes.power(2f);
|
consumes.power(2f);
|
||||||
@@ -3399,7 +3399,7 @@ public class Blocks{
|
|||||||
|
|
||||||
//TODO requirements
|
//TODO requirements
|
||||||
shipAssembler = new UnitAssembler("ship-assembler"){{
|
shipAssembler = new UnitAssembler("ship-assembler"){{
|
||||||
requirements(Category.units, with(Items.graphite, 10));
|
requirements(Category.units, with(Items.graphite, 600, Items.beryllium, 600, Items.oxide, 200, Items.tungsten, 500));
|
||||||
size = 5;
|
size = 5;
|
||||||
plans.add(new AssemblerUnitPlan(UnitTypes.quell, 60f * 4f, BlockStack.list(Blocks.tungstenWallLarge, 5, Blocks.plasmaBore, 2)));
|
plans.add(new AssemblerUnitPlan(UnitTypes.quell, 60f * 4f, BlockStack.list(Blocks.tungstenWallLarge, 5, Blocks.plasmaBore, 2)));
|
||||||
consumes.power(2f);
|
consumes.power(2f);
|
||||||
@@ -3412,7 +3412,7 @@ public class Blocks{
|
|||||||
|
|
||||||
//TODO requirements
|
//TODO requirements
|
||||||
mechAssembler = new UnitAssembler("mech-assembler"){{
|
mechAssembler = new UnitAssembler("mech-assembler"){{
|
||||||
requirements(Category.units, with(Items.graphite, 10));
|
requirements(Category.units, with(Items.graphite, 600, Items.carbide, 600, Items.oxide, 200, Items.tungsten, 500));
|
||||||
size = 5;
|
size = 5;
|
||||||
plans.add(new AssemblerUnitPlan(UnitTypes.bulwark, 60f * 4f, BlockStack.list(Blocks.tungstenWallLarge, 5, Blocks.duct, 2)));
|
plans.add(new AssemblerUnitPlan(UnitTypes.bulwark, 60f * 4f, BlockStack.list(Blocks.tungstenWallLarge, 5, Blocks.duct, 2)));
|
||||||
consumes.power(2f);
|
consumes.power(2f);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package mindustry.content;
|
package mindustry.content;
|
||||||
|
|
||||||
import mindustry.ctype.*;
|
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
|
|
||||||
import static mindustry.content.Planets.*;
|
import static mindustry.content.Planets.*;
|
||||||
@@ -11,7 +10,10 @@ public class SectorPresets{
|
|||||||
craters, biomassFacility, frozenForest, ruinousShores, windsweptIslands, stainedMountains, tarFields,
|
craters, biomassFacility, frozenForest, ruinousShores, windsweptIslands, stainedMountains, tarFields,
|
||||||
fungalPass, extractionOutpost, saltFlats, overgrowth,
|
fungalPass, extractionOutpost, saltFlats, overgrowth,
|
||||||
impact0078, desolateRift, nuclearComplex, planetaryTerminal,
|
impact0078, desolateRift, nuclearComplex, planetaryTerminal,
|
||||||
coastline, navalFortress;
|
coastline, navalFortress,
|
||||||
|
|
||||||
|
onset
|
||||||
|
;
|
||||||
|
|
||||||
public static void load(){
|
public static void load(){
|
||||||
//region serpulo
|
//region serpulo
|
||||||
@@ -108,5 +110,15 @@ public class SectorPresets{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
|
//region erekir
|
||||||
|
|
||||||
|
/*
|
||||||
|
onset = new SectorPreset("onset", erekir, 15){{
|
||||||
|
addStartingItems = true;
|
||||||
|
captureWave = 10;
|
||||||
|
difficulty = 1;
|
||||||
|
}};*/
|
||||||
|
|
||||||
|
//endreigon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import arc.scene.ui.TextField.*;
|
|||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
import mindustry.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
@@ -36,12 +37,16 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
private Sort sort = Sort.begin;
|
private Sort sort = Sort.begin;
|
||||||
private boolean reverseSort = false;
|
private boolean reverseSort = false;
|
||||||
private float updateTimer, updatePeriod = 1f;
|
private float updateTimer, updatePeriod = 1f;
|
||||||
|
private boolean checkedSpawns;
|
||||||
private WaveGraph graph = new WaveGraph();
|
private WaveGraph graph = new WaveGraph();
|
||||||
|
|
||||||
public WaveInfoDialog(){
|
public WaveInfoDialog(){
|
||||||
super("@waves.title");
|
super("@waves.title");
|
||||||
|
|
||||||
shown(this::setup);
|
shown(() -> {
|
||||||
|
checkedSpawns = false;
|
||||||
|
setup();
|
||||||
|
});
|
||||||
hidden(() -> state.rules.spawns = groups);
|
hidden(() -> state.rules.spawns = groups);
|
||||||
|
|
||||||
addCloseListener();
|
addCloseListener();
|
||||||
@@ -321,25 +326,66 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
|
|
||||||
//spawn positions are clunky and thus experimental for now
|
//spawn positions are clunky and thus experimental for now
|
||||||
if(experimental){
|
if(experimental){
|
||||||
|
//health fractions are generally not useful
|
||||||
|
t.table(p -> {
|
||||||
|
p.stack(new Slider(0f, 1f, 0.01f, false){{
|
||||||
|
setValue(group.healthFraction);
|
||||||
|
moved(val -> group.healthFraction = val);
|
||||||
|
}}, new Label("", Styles.outlineLabel){{
|
||||||
|
update(() -> setText(Core.bundle.format("waves.health", (int)(group.healthFraction * 100))));
|
||||||
|
touchable = Touchable.disabled;
|
||||||
|
setAlignment(Align.center);
|
||||||
|
setColor(Color.white);
|
||||||
|
}}).width(300f).height(44f);
|
||||||
|
}).row();
|
||||||
|
|
||||||
t.table(a -> {
|
t.table(a -> {
|
||||||
a.add("spawn at ");
|
a.add("spawn: ");
|
||||||
|
|
||||||
a.field(group.spawn == -1 ? "" : Point2.x(group.spawn) + "", TextFieldFilter.digitsOnly, text -> {
|
a.button("", () -> {
|
||||||
if(Strings.canParsePositiveInt(text)){
|
if(!checkedSpawns){
|
||||||
group.spawn = Point2.pack(Strings.parseInt(text), Point2.y(group.spawn));
|
//recalculate waves when changed
|
||||||
Log.info(group.spawn);
|
Vars.spawner.reset();
|
||||||
|
checkedSpawns = true;
|
||||||
}
|
}
|
||||||
}).width(70f);
|
|
||||||
|
|
||||||
a.add(",");
|
BaseDialog dialog = new BaseDialog("Spawn Select");
|
||||||
|
dialog.cont.pane(p -> {
|
||||||
|
p.background(Tex.button).margin(10f);
|
||||||
|
int i = 0;
|
||||||
|
int cols = 4;
|
||||||
|
int max = 20;
|
||||||
|
|
||||||
a.field(group.spawn == -1 ? "" : Point2.y(group.spawn) + "", TextFieldFilter.digitsOnly, text -> {
|
if(spawner.getSpawns().size >= max){
|
||||||
if(Strings.canParsePositiveInt(text)){
|
p.add("[lightgray](first " + max + ")").colspan(cols).padBottom(4).row();
|
||||||
group.spawn = Point2.pack(Point2.x(group.spawn), Strings.parseInt(text));
|
}
|
||||||
Log.info(group.spawn);
|
|
||||||
}
|
for(var spawn : spawner.getSpawns()){
|
||||||
}).width(70f);
|
p.button(spawn.x + ", " + spawn.y, Styles.clearTogglet, () -> {
|
||||||
}).padBottom(8f).padTop(-8f).row();
|
group.spawn = Point2.pack(spawn.x, spawn.y);
|
||||||
|
dialog.hide();
|
||||||
|
}).size(110f, 45f).checked(spawn.pos() == group.spawn);
|
||||||
|
|
||||||
|
if(++i % cols == 0){
|
||||||
|
p.row();
|
||||||
|
}
|
||||||
|
|
||||||
|
//only display first 20 spawns, you don't need to see more.
|
||||||
|
if(i >= 20){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(spawner.getSpawns().isEmpty()){
|
||||||
|
p.add("[scarlet]no spawns found in map");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.setFillParent(false);
|
||||||
|
dialog.addCloseButton();
|
||||||
|
dialog.show();
|
||||||
|
}).width(160f).height(36f).get().getLabel().setText(() -> group.spawn == -1 ? "<all>" : Point2.x(group.spawn) + ", " + Point2.y(group.spawn));
|
||||||
|
|
||||||
|
}).padBottom(8f).row();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).width(340f).pad(8);
|
}).width(340f).pad(8);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class ClearFilter extends GenerateFilter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FilterOption[] options(){
|
public FilterOption[] options(){
|
||||||
return new BlockOption[]{
|
return new FilterOption[]{
|
||||||
new BlockOption("target", () -> target, b -> target = b, anyOptional),
|
new BlockOption("target", () -> target, b -> target = b, anyOptional),
|
||||||
new BlockOption("replacement", () -> replace, b -> replace = b, anyOptional)
|
new BlockOption("replacement", () -> replace, b -> replace = b, anyOptional)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -111,6 +111,10 @@ public abstract class GenerateFilter{
|
|||||||
return Simplex.noise2d(seed, octaves, persistence, 1f / scl, in.x, in.y) * mag;
|
return Simplex.noise2d(seed, octaves, persistence, 1f / scl, in.x, in.y) * mag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected float noise(float x, float y, float scl, float mag, float octaves, float persistence){
|
||||||
|
return Simplex.noise2d(seed, octaves, persistence, 1f / scl, x, y) * mag;
|
||||||
|
}
|
||||||
|
|
||||||
protected float rnoise(float x, float y, float scl, float mag){
|
protected float rnoise(float x, float y, float scl, float mag){
|
||||||
return Ridged.noise2d(seed + 1, (int)(x), (int)(y), 1f / scl) * mag;
|
return Ridged.noise2d(seed + 1, (int)(x), (int)(y), 1f / scl) * mag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import mindustry.world.*;
|
|||||||
import static mindustry.maps.filters.FilterOption.*;
|
import static mindustry.maps.filters.FilterOption.*;
|
||||||
|
|
||||||
public class NoiseFilter extends GenerateFilter{
|
public class NoiseFilter extends GenerateFilter{
|
||||||
float scl = 40, threshold = 0.5f, octaves = 3f, falloff = 0.5f;
|
public float scl = 40, threshold = 0.5f, octaves = 3f, falloff = 0.5f, tilt = 0f;
|
||||||
Block floor = Blocks.stone, block = Blocks.stoneWall, target = Blocks.air;
|
public Block floor = Blocks.stone, block = Blocks.stoneWall, target = Blocks.air;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FilterOption[] options(){
|
public FilterOption[] options(){
|
||||||
@@ -17,6 +17,7 @@ public class NoiseFilter extends GenerateFilter{
|
|||||||
new SliderOption("threshold", () -> threshold, f -> threshold = f, 0f, 1f),
|
new SliderOption("threshold", () -> threshold, f -> threshold = f, 0f, 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 SliderOption("tilt", () -> tilt, f -> tilt = f, -4f, 4f),
|
||||||
new BlockOption("target", () -> target, b -> target = b, anyOptional),
|
new BlockOption("target", () -> target, b -> target = b, anyOptional),
|
||||||
new BlockOption("floor", () -> floor, b -> floor = b, floorsOptional),
|
new BlockOption("floor", () -> floor, b -> floor = b, floorsOptional),
|
||||||
new BlockOption("wall", () -> block, b -> block = b, wallsOptional)
|
new BlockOption("wall", () -> block, b -> block = b, wallsOptional)
|
||||||
@@ -30,7 +31,7 @@ public class NoiseFilter extends GenerateFilter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply(GenerateInput in){
|
public void apply(GenerateInput in){
|
||||||
float noise = noise(in, scl, 1f, octaves, falloff);
|
float noise = noise(in.x, in.y + in.x * tilt, scl, 1f, octaves, falloff);
|
||||||
|
|
||||||
if(noise > threshold && (target == Blocks.air || in.floor == target || in.block == target)){
|
if(noise > threshold && (target == Blocks.air || in.floor == target || in.block == target)){
|
||||||
if(floor != Blocks.air) in.floor = floor;
|
if(floor != Blocks.air) in.floor = floor;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import mindustry.world.*;
|
|||||||
import static mindustry.maps.filters.FilterOption.*;
|
import static mindustry.maps.filters.FilterOption.*;
|
||||||
|
|
||||||
public class OreFilter extends GenerateFilter{
|
public class OreFilter extends GenerateFilter{
|
||||||
public float scl = 23, threshold = 0.81f, octaves = 2f, falloff = 0.3f;
|
public float scl = 23, threshold = 0.81f, octaves = 2f, falloff = 0.3f, tilt = 0f;
|
||||||
public Block ore = Blocks.oreCopper, target = Blocks.air;
|
public Block ore = Blocks.oreCopper, target = Blocks.air;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -17,6 +17,7 @@ public class OreFilter extends GenerateFilter{
|
|||||||
new SliderOption("threshold", () -> threshold, f -> threshold = f, 0f, 1f),
|
new SliderOption("threshold", () -> threshold, f -> threshold = f, 0f, 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 SliderOption("tilt", () -> tilt, f -> tilt = f, -4f, 4f),
|
||||||
new BlockOption("ore", () -> ore, b -> ore = b, oresOnly),
|
new BlockOption("ore", () -> ore, b -> ore = b, oresOnly),
|
||||||
new BlockOption("target", () -> target, b -> target = b, oresFloorsOptional)
|
new BlockOption("target", () -> target, b -> target = b, oresFloorsOptional)
|
||||||
};
|
};
|
||||||
@@ -29,7 +30,7 @@ public class OreFilter extends GenerateFilter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply(GenerateInput in){
|
public void apply(GenerateInput in){
|
||||||
float noise = noise(in, scl, 1f, octaves, falloff);
|
float noise = noise(in.x, in.y + in.x * tilt, scl, 1f, octaves, falloff);
|
||||||
|
|
||||||
if(noise > threshold && in.overlay != Blocks.spawn && (target == Blocks.air || in.floor == target || in.overlay == target) && in.floor.asFloor().hasSurface()){
|
if(noise > threshold && in.overlay != Blocks.spawn && (target == Blocks.air || in.floor == target || in.overlay == target) && in.floor.asFloor().hasSurface()){
|
||||||
in.overlay = ore;
|
in.overlay = ore;
|
||||||
|
|||||||
@@ -7,20 +7,22 @@ import mindustry.*;
|
|||||||
import mindustry.ai.*;
|
import mindustry.ai.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.maps.filters.FilterOption.*;
|
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
import mindustry.world.blocks.storage.*;
|
import mindustry.world.blocks.storage.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
import static mindustry.maps.filters.FilterOption.*;
|
||||||
|
|
||||||
/** Selects X spawns from the spawn pool.*/
|
/** Selects X spawns from the spawn pool.*/
|
||||||
public class SpawnPathFilter extends GenerateFilter{
|
public class SpawnPathFilter extends GenerateFilter{
|
||||||
int radius = 3;
|
public int radius = 3;
|
||||||
|
public Block block = Blocks.air;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FilterOption[] options(){
|
public FilterOption[] options(){
|
||||||
return new SliderOption[]{
|
return new FilterOption[]{
|
||||||
new SliderOption("radius", () -> radius, f -> radius = (int)f, 1, 20).display()
|
new SliderOption("radius", () -> radius, f -> radius = (int)f, 1, 20).display(),
|
||||||
|
new BlockOption("wall", () -> block, b -> block = b, wallsOnly)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +55,7 @@ public class SpawnPathFilter extends GenerateFilter{
|
|||||||
if(Structs.inBounds(wx, wy, world.width(), world.height()) && Mathf.within(x, y, radius)){
|
if(Structs.inBounds(wx, wy, world.width(), world.height()) && Mathf.within(x, y, radius)){
|
||||||
Tile other = tiles.getn(wx, wy);
|
Tile other = tiles.getn(wx, wy);
|
||||||
if(!other.synthetic()){
|
if(!other.synthetic()){
|
||||||
other.setBlock(Blocks.air);
|
other.setBlock(block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import mindustry.world.*;
|
|||||||
import static mindustry.maps.filters.FilterOption.*;
|
import static mindustry.maps.filters.FilterOption.*;
|
||||||
|
|
||||||
public class TerrainFilter extends GenerateFilter{
|
public class TerrainFilter extends GenerateFilter{
|
||||||
float scl = 40, threshold = 0.9f, octaves = 3f, falloff = 0.5f, magnitude = 1f, circleScl = 2.1f;
|
float scl = 40, threshold = 0.9f, octaves = 3f, falloff = 0.5f, magnitude = 1f, circleScl = 2.1f, tilt = 0f;
|
||||||
Block floor = Blocks.air, block = Blocks.stoneWall;
|
Block floor = Blocks.air, block = Blocks.stoneWall;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -20,6 +20,7 @@ public class TerrainFilter extends GenerateFilter{
|
|||||||
new SliderOption("circle-scale", () -> circleScl, f -> circleScl = f, 0f, 3f),
|
new SliderOption("circle-scale", () -> circleScl, f -> circleScl = f, 0f, 3f),
|
||||||
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 SliderOption("tilt", () -> tilt, f -> tilt = f, -4f, 4f),
|
||||||
new BlockOption("floor", () -> floor, b -> floor = b, floorsOptional),
|
new BlockOption("floor", () -> floor, b -> floor = b, floorsOptional),
|
||||||
new BlockOption("wall", () -> block, b -> block = b, wallsOnly)
|
new BlockOption("wall", () -> block, b -> block = b, wallsOnly)
|
||||||
};
|
};
|
||||||
@@ -32,7 +33,7 @@ public class TerrainFilter extends GenerateFilter{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply(GenerateInput in){
|
public void apply(GenerateInput in){
|
||||||
float noise = noise(in, scl, magnitude, octaves, falloff) + Mathf.dst((float)in.x / in.width, (float)in.y / in.height, 0.5f, 0.5f) * circleScl;
|
float noise = noise(in.x, in.y + in.x * tilt, scl, magnitude, octaves, falloff) + Mathf.dst((float)in.x / in.width, (float)in.y / in.height, 0.5f, 0.5f) * circleScl;
|
||||||
|
|
||||||
if(floor != Blocks.air){
|
if(floor != Blocks.air){
|
||||||
in.floor = floor;
|
in.floor = floor;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class UnitAssembler extends PayloadBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceOn(Tile tile, Team team, int rotation){
|
public boolean canPlaceOn(Tile tile, Team team, int rotation){
|
||||||
//overlapping construction areas not allowed.
|
//overlapping construction areas not allowed; grow by a tiny amount so edges can't overlap either.
|
||||||
Rect rect = getRect(Tmp.r1, tile.worldx() + offset, tile.worldy() + offset, rotation).grow(0.1f);
|
Rect rect = getRect(Tmp.r1, tile.worldx() + offset, tile.worldy() + offset, rotation).grow(0.1f);
|
||||||
return !indexer.getFlagged(team, BlockFlag.unitAssembler).contains(b -> getRect(Tmp.r2, b.x, b.y, b.rotation).overlaps(rect));
|
return !indexer.getFlagged(team, BlockFlag.unitAssembler).contains(b -> getRect(Tmp.r2, b.x, b.y, b.rotation).overlaps(rect));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ android.useAndroidX=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
archash=b139bee16f
|
archash=35c3b682a1
|
||||||
|
|||||||
Reference in New Issue
Block a user