diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index a64b7a755763..36ae017d35e9 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="23" + android:versionName="3.07b" > diff --git a/core/assets-raw/sprites/blocks/conveyortunnel.png b/core/assets-raw/sprites/blocks/conveyortunnel.png index 59bdfcee8cf3..f1f4bf4e4884 100644 Binary files a/core/assets-raw/sprites/blocks/conveyortunnel.png and b/core/assets-raw/sprites/blocks/conveyortunnel.png differ diff --git a/core/assets/maps/out-1512096271461.png b/core/assets/maps/out-1512096271461.png deleted file mode 100644 index 399ec16f150a..000000000000 Binary files a/core/assets/maps/out-1512096271461.png and /dev/null differ diff --git a/core/assets/maps/scorch.png b/core/assets/maps/scorch.png index 9dfefc47d7be..6ad8e9551448 100644 Binary files a/core/assets/maps/scorch.png and b/core/assets/maps/scorch.png differ diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 56ad4c3b64c2..91b3d66ddfbb 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index b0371e17a455..70fafe0276aa 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -154,9 +154,9 @@ public void update(){ camera.position.set(lastx - deltax, lasty - deltay, 0); - if(Vars.debug){ - record(); - } + //if(Vars.debug){ + record(); + //} } } diff --git a/core/src/io/anuke/mindustry/entities/WaveCreator.java b/core/src/io/anuke/mindustry/entities/WaveCreator.java index 016b89333440..22d4b7278082 100644 --- a/core/src/io/anuke/mindustry/entities/WaveCreator.java +++ b/core/src/io/anuke/mindustry/entities/WaveCreator.java @@ -28,14 +28,14 @@ public static Array getSpawns(){ after = 4; amount = 3; spacing = 5; - scaling = 1; + scaling = 2; tierscaleback = 0; }}, new EnemySpawn(TankEnemy.class){{ after = 5; spacing = 5; - scaling = 1; + scaling = 2; amount = 2; }}, @@ -64,7 +64,7 @@ public static Array getSpawns(){ after = 6; amount = 2; spacing = 5; - scaling = 2; + scaling = 3; }}, new EnemySpawn(FlamerEnemy.class){{ @@ -78,14 +78,14 @@ public static Array getSpawns(){ after = 15; amount = 1; spacing = 5; - scaling = 1; + scaling = 2; }}, new EnemySpawn(BlastEnemy.class){{ after = 4 + 5 + 5; amount = 3; spacing = 5; - scaling = 1; + scaling = 2; tierscaleback = 0; }}, //boss wave @@ -117,14 +117,14 @@ public static Array getSpawns(){ after = 16 + 5; amount = 1; spacing = 5; - scaling = 2; + scaling = 3; }}, new EnemySpawn(EmpEnemy.class){{ after = 16 + 5; amount = 1; spacing = 5; - scaling = 2; + scaling = 3; }} //end enchanced boss wave ); diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 0693a0a44d5f..bac406c265d0 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -174,7 +174,7 @@ protected boolean tryDump(Tile tile){ * Try dumping any item near the tile. -1 = any direction */ protected boolean tryDump(Tile tile, int direction, Item todump){ - int i = tile.getDump(); + int i = tile.getDump()%4; Tile[] tiles = tile.getNearby(); @@ -186,9 +186,9 @@ protected boolean tryDump(Tile tile, int direction, Item todump){ if(todump != null && item != todump) continue; - if(tile.entity.hasItem(item) && other != null && other.block().acceptItem(item, other, tile) && + if(tile.entity.hasItem(item) && other != null && other.block().acceptItem(item, other, tile) //don't output to things facing this thing - !(other.block().rotate && (other.getRotation() + 2) % 4 == i)){ + /*!(other.block().rotate && (other.getRotation() + 2) % 4 == i)*/){ other.block().handleItem(item, other, tile); tile.entity.removeItem(item, 1); tile.setDump((byte)((i+1)%4)); diff --git a/core/src/io/anuke/mindustry/world/Tile.java b/core/src/io/anuke/mindustry/world/Tile.java index 24a2137957c4..1764ab79132a 100644 --- a/core/src/io/anuke/mindustry/world/Tile.java +++ b/core/src/io/anuke/mindustry/world/Tile.java @@ -17,7 +17,7 @@ public class Tile{ /**Packed block data. Left is floor, right is block.*/ private short blocks; - /**Packed data. Left is rotation, right is dump.*/ + /**Packed data. Left is rotation, right is extra data, packed into two half-bytes: left is dump, right is extra.*/ private short data; /**The coordinates of the core tile this is linked to, in the form of two bytes packed into one. * This is relative to the block it is linked to; negate coords to find the link.*/ diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java index e451a2465918..16b4de59d487 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java @@ -119,8 +119,8 @@ public TileEntity getEntity(){ public boolean acceptItem(Item item, Tile dest, Tile source){ int direction = source == null ? 0 : Math.abs(source.relativeTo(dest.x, dest.y) - dest.getRotation()); float minitem = dest.entity().minitem; - return ((direction == 0) && minitem > 0.05f) || - ((direction %2 == 1) && minitem > 0.52f); + return (((direction == 0) && minitem > 0.05f) || + ((direction %2 == 1) && minitem > 0.52f)) && (source == null || !((source.getRotation() + 2) % 4 == dest.getRotation())); } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerLaser.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerLaser.java index 96f24759cca6..0fb8af6102b0 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerLaser.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerLaser.java @@ -16,6 +16,7 @@ public PowerLaser(String name) { solid = true; explosive = false; laserDirections = 1; + health = 50; } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java index 4d0d0de11930..b1fe47372061 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java @@ -33,9 +33,12 @@ public boolean canReplace(Block other){ @Override public void update(Tile tile){ + //TODO fix, check issue + tile.setRotation((byte)Mathf.mod(tile.getRotation(), 4)); + if(tile.entity.timer.get(timerDump, 2) && tile.entity.totalItems() > 0){ if(tile.getExtra() != tile.getRotation() - || Mathf.chance(0.3)){ //sometimes dump backwards at a 1/4 chance... this somehow works? + || Mathf.chance(0.35)){ //sometimes dump backwards at a 1/4 chance... this somehow works? tryDump(tile, tile.getRotation(), null); } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java index 4599dc3d2ad7..b19b72d9b2f3 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java @@ -6,6 +6,7 @@ import io.anuke.ucore.core.Timers; public class TunnelConveyor extends Block{ + protected int maxdist = 3; protected TunnelConveyor(String name) { super(name); @@ -21,25 +22,37 @@ public boolean canReplace(Block other){ @Override public void handleItem(Item item, Tile tile, Tile source){ - int dir = source.relativeTo(tile.x, tile.y); - Tile to = getOther(tile, dir, 3); - Tile inter = getOther(tile, dir, 2); + Tile tunnel = getDestTunnel(tile); + Tile to = tunnel.getNearby()[tunnel.getRotation()]; Timers.run(25, ()->{ if(to == null || to.entity == null) return; - to.block().handleItem(item, to, inter); + to.block().handleItem(item, to, tunnel); }); } @Override public boolean acceptItem(Item item, Tile dest, Tile source){ - int dir = source.relativeTo(dest.x, dest.y); - Tile to = getOther(dest, dir, 3); - Tile inter = getOther(dest, dir, 2); - return to != null && inter != null && source.getRotation() == (dest.getRotation() + 2)%4 && inter.block() instanceof TunnelConveyor - && (inter.getRotation() + 2) % 4 == dest.getRotation() && - to.block().acceptItem(item, to, inter); + Tile tunnel = getDestTunnel(dest); + if(tunnel != null){ + Tile to = tunnel.getNearby()[tunnel.getRotation()]; + return to != null && to.block().acceptItem(item, to, tunnel); + }else{ + return false; + } + } + + Tile getDestTunnel(Tile tile){ + Tile dest = tile; + int rel = (tile.getRotation() + 2)%4; + for(int i = 0; i < maxdist; i ++){ + dest = dest.getNearby()[rel]; + if(dest != null && dest.block() instanceof TunnelConveyor && dest.getRotation() == rel){ + return dest; + } + } + return null; } Tile getOther(Tile tile, int dir, int amount){