diff --git a/core/assets/maps/craters.msav b/core/assets/maps/craters.msav index 17f07a58b6..c0bd73e09b 100644 Binary files a/core/assets/maps/craters.msav and b/core/assets/maps/craters.msav differ diff --git a/core/assets/maps/groundZero.msav b/core/assets/maps/groundZero.msav index a09d2bfcc7..4e6900b4c3 100644 Binary files a/core/assets/maps/groundZero.msav and b/core/assets/maps/groundZero.msav differ diff --git a/core/assets/maps/ruinousShores.msav b/core/assets/maps/ruinousShores.msav index 9e85303605..9d8708c6f0 100644 Binary files a/core/assets/maps/ruinousShores.msav and b/core/assets/maps/ruinousShores.msav differ diff --git a/core/assets/maps/saltFlats.msav b/core/assets/maps/saltFlats.msav index 4d63be50cd..6c2ae62d65 100644 Binary files a/core/assets/maps/saltFlats.msav and b/core/assets/maps/saltFlats.msav differ diff --git a/core/src/io/anuke/mindustry/content/Zones.java b/core/src/io/anuke/mindustry/content/Zones.java index bb0a5a692f..46dcd7fbfd 100644 --- a/core/src/io/anuke/mindustry/content/Zones.java +++ b/core/src/io/anuke/mindustry/content/Zones.java @@ -78,14 +78,14 @@ public class Zones implements ContentList{ }}; saltFlats = new Zone("saltFlats", new MapGenerator("saltFlats")){{ - startingItems = ItemStack.list(Items.copper, 200, Items.silicon, 100, Items.lead, 200); + startingItems = ItemStack.list(Items.copper, 200, Items.silicon, 200, Items.lead, 200); alwaysUnlocked = true; conditionWave = 5; launchPeriod = 5; loadout = Loadouts.basicFoundation; zoneRequirements = ZoneRequirement.with(desertWastes, 60); - blockRequirements = new Block[]{Blocks.daggerFactory, Blocks.draugFactory}; - resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand}; + blockRequirements = new Block[]{Blocks.daggerFactory, Blocks.draugFactory, Blocks.door}; + resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand, Items.titanium}; }}; frozenForest = new Zone("frozenForest", new MapGenerator("frozenForest", 1) diff --git a/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java index 2b0e1b9fcf..1ff47ea3d7 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java @@ -170,7 +170,7 @@ public class DeployDialog extends FloatingDialog{ button.setDisabled(() -> hidden(zone)); button.clicked(() -> info.show(zone)); - if(zone.unlocked()){ + if(zone.unlocked() && !hidden(zone)){ button.labelWrap(zone.localizedName()).style("outline").width(140).growX().get().setAlignment(Align.center); }else{ button.addImage("icon-locked"); diff --git a/core/src/io/anuke/mindustry/ui/fragments/FadeInFragment.java b/core/src/io/anuke/mindustry/ui/fragments/FadeInFragment.java index 111eeb9454..4d903430dc 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/FadeInFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/FadeInFragment.java @@ -5,7 +5,6 @@ import io.anuke.arc.graphics.g2d.*; import io.anuke.arc.math.*; import io.anuke.arc.scene.*; import io.anuke.arc.scene.event.*; -import io.anuke.arc.util.*; /** Fades in a black overlay.*/ public class FadeInFragment extends Fragment{ @@ -30,7 +29,7 @@ public class FadeInFragment extends Fragment{ @Override public void act(float delta){ super.act(delta); - time += Time.delta() / duration; + time += 1f / duration; if(time > 1){ remove(); } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/MendProjector.java b/core/src/io/anuke/mindustry/world/blocks/defense/MendProjector.java index d5909925fd..7721d95510 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/MendProjector.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/MendProjector.java @@ -78,12 +78,12 @@ public class MendProjector extends Block{ float realRange = range + entity.phaseHeat * phaseRangeBoost; entity.charge = 0f; - int tileRange = (int)(realRange / tilesize); + int tileRange = (int)(realRange / tilesize + 1); healed.clear(); for(int x = -tileRange + tile.x; x <= tileRange + tile.x; x++){ for(int y = -tileRange + tile.y; y <= tileRange + tile.y; y++){ - if(Mathf.dst(x, y, tile.x, tile.y) > tileRange) continue; + if(!Mathf.within(x * tilesize, y * tilesize, tile.drawx(), tile.drawy(), realRange)) continue; Tile other = world.ltile(x, y); diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/OverdriveProjector.java b/core/src/io/anuke/mindustry/world/blocks/defense/OverdriveProjector.java index c27f786103..5ff8c2ba94 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/OverdriveProjector.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/OverdriveProjector.java @@ -84,12 +84,12 @@ public class OverdriveProjector extends Block{ entity.charge = 0f; - int tileRange = (int)(realRange / tilesize); + int tileRange = (int)(realRange / tilesize + 1); healed.clear(); for(int x = -tileRange + tile.x; x <= tileRange + tile.x; x++){ for(int y = -tileRange + tile.y; y <= tileRange + tile.y; y++){ - if(Mathf.dst(x, y, tile.x, tile.y) > tileRange) continue; + if(!Mathf.within(x * tilesize, y * tilesize, tile.drawx(), tile.drawy(), realRange)) continue; Tile other = world.ltile(x, y); diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java index f3517801a3..172ad36f28 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java @@ -209,6 +209,7 @@ public class PowerGraph{ } public void add(Tile tile){ + if(tile.entity == null || tile.entity.power == null) return; tile.entity.power.graph = this; all.add(tile); diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java index aa5941aca8..f3816f9a15 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java @@ -2,6 +2,7 @@ package io.anuke.mindustry.world.blocks.power; import io.anuke.annotations.Annotations.*; import io.anuke.arc.*; +import io.anuke.arc.function.*; import io.anuke.arc.graphics.*; import io.anuke.arc.graphics.g2d.*; import io.anuke.arc.math.*; @@ -105,14 +106,20 @@ public class PowerNode extends PowerBlock{ Call.linkPowerNodes(null, tile, before); } + Predicate valid = other -> other != null && other != tile && ((!other.block().outputsPower && other.block().consumesPower) || (other.block().outputsPower && !other.block().consumesPower)) && linkValid(tile, other) + && !other.entity.proximity().contains(tile) && other.entity.power.graph != tile.entity.power.graph; + + tempTiles.clear(); Geometry.circle(tile.x, tile.y, (int)(laserRange + 1), (x, y) -> { Tile other = world.ltile(x, y); - if(other != null && other != tile && ((!other.block().outputsPower && other.block().consumesPower) || (other.block().outputsPower && !other.block().consumesPower)) && linkValid(tile, other) - && !other.entity.proximity().contains(tile) && other.entity.power.graph != tile.entity.power.graph){ - Call.linkPowerNodes(null, tile, other); + if(valid.test(other)){ + tempTiles.add(other); } }); + tempTiles.sort(Structs.comparingFloat(t -> t.dst2(tile))); + tempTiles.each(valid, other -> Call.linkPowerNodes(null, tile, other)); + lastPlaced = tile.pos(); super.playerPlaced(tile); }