diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 29a8ff14a0..cd3cf7d7ed 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -464,7 +464,7 @@ mech.delta-mech.description = A fast, lightly-armored mech made for hit-and-run mech.tau-mech.name = Tau mech.tau-mech.weapon = Restruct Laser mech.tau-mech.ability = Repair Burst -mech.tau-mech.description = The support mech. Heals allied blocks by shooting at them. Can extinguish fires and heal allies in a radius with its repair ability. +mech.tau-mech.description = The support mech. Heals allied blocks by shooting at them. Can heal allies in a radius with its repair ability. mech.omega-mech.name = Omega mech.omega-mech.weapon = Swarm Missiles mech.omega-mech.ability = Armored Configuration diff --git a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java index 9b15b070ce..b6a60d8d1f 100644 --- a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java @@ -106,7 +106,7 @@ public class TurretBlocks extends BlockList implements ContentList{ arc = new PowerTurret("arc"){{ shootType = AmmoTypes.arc; - reload = 75f; + reload = 85f; shootShake = 1f; shootCone = 40f; rotatespeed = 8f; @@ -121,7 +121,7 @@ public class TurretBlocks extends BlockList implements ContentList{ swarmer = new BurstTurret("swarmer"){{ ammoTypes = new AmmoType[]{AmmoTypes.missileExplosive, AmmoTypes.missileIncindiary, AmmoTypes.missileSurge}; - reload = 5f; + reload = 50f; shots = 4; burstSpacing = 5; inaccuracy = 10f; diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index b3bd83af65..052e31bc8f 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -16,6 +16,7 @@ import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest; import io.anuke.mindustry.entities.traits.SyncTrait; +import io.anuke.mindustry.game.EventType.WorldLoadEvent; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.game.Version; import io.anuke.mindustry.gen.Call; @@ -24,6 +25,7 @@ import io.anuke.mindustry.net.*; import io.anuke.mindustry.net.Administration.PlayerInfo; import io.anuke.mindustry.net.Packets.*; import io.anuke.mindustry.world.Tile; +import io.anuke.ucore.core.Events; import io.anuke.ucore.core.Timers; import io.anuke.ucore.entities.Entities; import io.anuke.ucore.entities.EntityGroup; @@ -76,6 +78,9 @@ public class NetServer extends Module{ private DataOutputStream dataStream = new DataOutputStream(syncStream); public NetServer(){ + Events.on(WorldLoadEvent.class, event -> { + connections.clear(); + }); Net.handleServer(Connect.class, (id, connect) -> { if(admins.isIPBanned(connect.addressTCP)){ diff --git a/core/src/io/anuke/mindustry/editor/EditorTool.java b/core/src/io/anuke/mindustry/editor/EditorTool.java index c988beb46b..6eca7e8fd4 100644 --- a/core/src/io/anuke/mindustry/editor/EditorTool.java +++ b/core/src/io/anuke/mindustry/editor/EditorTool.java @@ -17,6 +17,8 @@ import static io.anuke.mindustry.Vars.ui; public enum EditorTool{ pick{ public void touched(MapEditor editor, int x, int y){ + if(!Structs.inBounds(x, y, editor.getMap().width(), editor.getMap().height())) return; + byte bf = editor.getMap().read(x, y, DataPosition.floor); byte bw = editor.getMap().read(x, y, DataPosition.wall); byte link = editor.getMap().read(x, y, DataPosition.link); diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index 20a942da00..ea26deb6b0 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -230,7 +230,7 @@ public class MobileInput extends InputHandler implements GestureListener{ player.clearBuilding(); mode = none; recipe = null; - }).visible(() -> player.isBuilding() || recipe != null); + }).visible(() -> player.isBuilding() || recipe != null || mode == breaking); //confirm button table.addImageButton("icon-check", "clear-partial", 16 * 2f, () -> { diff --git a/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java b/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java index 45e0c64bcf..db95af39f7 100644 --- a/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java +++ b/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java @@ -172,6 +172,25 @@ public class WorldGenerator{ prepareTiles(tiles); + for(int x = 0; x < width; x++){ + for(int y = 0; y < height; y++){ + Tile tile = tiles[x][y]; + + byte elevation = tile.getElevation(); + + for(GridPoint2 point : Geometry.d4){ + if(!Structs.inBounds(x + point.x, y + point.y, width, height)) continue; + if(tiles[x + point.x][y + point.y].getElevation() < elevation){ + + if(sim2.octaveNoise2D(1, 1, 1.0 / 8, x, y) > 0.8){ + tile.setElevation(-1); + } + break; + } + } + } + } + world.setBlock(tiles[spawns.get(0).x][spawns.get(0).y], StorageBlocks.core, Team.blue); if(state.mode.isPvp){ diff --git a/core/src/io/anuke/mindustry/net/Net.java b/core/src/io/anuke/mindustry/net/Net.java index 0e152cb18e..bdf55a0888 100644 --- a/core/src/io/anuke/mindustry/net/Net.java +++ b/core/src/io/anuke/mindustry/net/Net.java @@ -356,12 +356,13 @@ public class Net{ Gdx.net.sendHttpRequest(req, new HttpResponseListener(){ @Override public void handleHttpResponse(HttpResponse httpResponse){ - listener.accept(httpResponse.getResultAsString()); + String result = httpResponse.getResultAsString(); + Gdx.app.postRunnable(() -> listener.accept(result)); } @Override public void failed(Throwable t){ - failure.accept(t); + Gdx.app.postRunnable(() -> failure.accept(t)); } @Override diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 6530d5228a..96ddfc2b94 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -153,7 +153,7 @@ public class Block extends BaseBlock { TileEntity entity = tile.entity(); for(Tile other : getPowerConnections(tile, tempTiles)){ - if(other.entity.power != null){ + if(other.entity.power != null && other.entity.power.graph != null){ other.entity.power.graph.add(entity.power.graph); } } 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 1119cf311f..997c821de9 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/MendProjector.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/MendProjector.java @@ -95,8 +95,11 @@ public class MendProjector extends Block{ @Override public void drawSelect(Tile tile){ + MendEntity entity = tile.entity(); + float realRange = range + entity.phaseHeat * phaseRangeBoost; + Draw.color(color); - Lines.dashCircle(tile.drawx(), tile.drawy() - 1f, range); + Lines.dashCircle(tile.drawx(), tile.drawy(), realRange); Draw.color(); } 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 cb340d1e40..615a6fa5a8 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/OverdriveProjector.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/OverdriveProjector.java @@ -36,6 +36,7 @@ public class OverdriveProjector extends Block{ protected float speedBoost = 1.5f; protected float speedBoostPhase = 0.75f; protected float useTime = 400f; + protected float phaseRangeBoost = 20f; public OverdriveProjector(String name){ super(name); @@ -66,7 +67,7 @@ public class OverdriveProjector extends Block{ } if(entity.charge >= reload){ - float realRange = range + entity.phaseHeat * 20f; + float realRange = range + entity.phaseHeat * phaseRangeBoost; float realBoost = speedBoost + entity.phaseHeat*speedBoostPhase; Effects.effect(BlockFx.overdriveWave, Hue.mix(color, phase, entity.phaseHeat), tile.drawx(), tile.drawy(), realRange); @@ -97,8 +98,11 @@ public class OverdriveProjector extends Block{ @Override public void drawSelect(Tile tile){ + OverdriveEntity entity = tile.entity(); + float realRange = range + entity.phaseHeat * phaseRangeBoost; + Draw.color(color); - Lines.dashCircle(tile.drawx(), tile.drawy() - 1f, range); + Lines.dashCircle(tile.drawx(), tile.drawy(), realRange); Draw.color(); }