diff --git a/core/assets/version.properties b/core/assets/version.properties index bf8eeea52b..dd383e4504 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,5 +1,5 @@ #Autogenerated file. Do not modify. -#Mon Apr 02 23:01:45 EDT 2018 +#Tue Apr 03 18:35:41 EDT 2018 version=release androidBuildCode=815 name=Mindustry diff --git a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java index 834bfa47a6..0684db9c56 100644 --- a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java @@ -12,7 +12,7 @@ public class TurretBullets { @Override public void draw(Bullet b) { Draw.color(Color.valueOf("f3d47f")); - Draw.rect("bullet", b.x, b.y, b.angle() - 90); + Draw.rect("bullet", b.x, b.y, 9f, 5f + b.fract()*7f, b.angle() - 90); Draw.color(); } }; diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index 2ac3cd5e15..3197dacdef 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -188,7 +188,7 @@ public class NetServer extends Module{ Block block = Block.getByID(packet.block); - if(!Placement.validPlace(placer.team, packet.x, packet.y, block)) return; + if(!Placement.validPlace(placer.team, packet.x, packet.y, block, packet.rotation)) return; Recipe recipe = Recipes.getByResult(block); diff --git a/core/src/io/anuke/mindustry/entities/BulletType.java b/core/src/io/anuke/mindustry/entities/BulletType.java index d67dbca858..c8f210eea7 100644 --- a/core/src/io/anuke/mindustry/entities/BulletType.java +++ b/core/src/io/anuke/mindustry/entities/BulletType.java @@ -7,14 +7,21 @@ import io.anuke.ucore.entities.BaseBulletType; public abstract class BulletType extends BaseBulletType{ public Effect hitEffect = BulletFx.hit; + public Effect despawnEffect = BulletFx.despawn; public BulletType(float speed, int damage){ this.speed = speed; this.damage = damage; + lifetime = 40f; } @Override public void hit(Bullet b, float hitx, float hity){ Effects.effect(hitEffect, hitx, hity, b.angle()); } + + @Override + public void despawned(Bullet b){ + Effects.effect(despawnEffect, b.x, b.y, b.angle()); + } } diff --git a/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java b/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java index 8bece9b4c3..28a7aaeac7 100644 --- a/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java +++ b/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java @@ -54,6 +54,18 @@ public class BulletFx { Lines.lineAngle(e.x + x, e.y + y, ang, e.fract()*3 + 1f); }); + Draw.reset(); + }), + + despawn = new Effect(12, e -> { + Draw.color(lighterOrange, Color.GRAY, e.ifract()); + Lines.stroke(e.fract()); + + Angles.randLenVectors(e.id, 7, e.ifract()*7f, e.rotation, 40f, (x, y) -> { + float ang = Mathf.atan2(x, y); + Lines.lineAngle(e.x + x, e.y + y, ang, e.fract()*2 + 1f); + }); + Draw.reset(); }); } diff --git a/core/src/io/anuke/mindustry/input/InputHandler.java b/core/src/io/anuke/mindustry/input/InputHandler.java index d0f913f6d9..18e4e8a85c 100644 --- a/core/src/io/anuke/mindustry/input/InputHandler.java +++ b/core/src/io/anuke/mindustry/input/InputHandler.java @@ -91,7 +91,7 @@ public abstract class InputHandler extends InputAdapter{ return false; } - return Placement.validPlace(player.team, x, y, type); + return Placement.validPlace(player.team, x, y, type, rotation); } public boolean validBreak(int x, int y){ diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 84b035712a..b90a3a98d0 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -181,7 +181,7 @@ public class Block extends BaseBlock { } public boolean canReplace(Block other){ - return other != this && this.group != BlockGroup.none && other.group == this.group; + return (other != this || rotate) && this.group != BlockGroup.none && other.group == this.group; } public int handleDamage(Tile tile, int amount){ diff --git a/core/src/io/anuke/mindustry/world/Placement.java b/core/src/io/anuke/mindustry/world/Placement.java index 8eabe2e81e..95a3d356b7 100644 --- a/core/src/io/anuke/mindustry/world/Placement.java +++ b/core/src/io/anuke/mindustry/world/Placement.java @@ -89,7 +89,7 @@ public class Placement { if(effects && sound) threads.run(() -> Effects.sound("place", x * tilesize, y * tilesize)); } - public static boolean validPlace(Team team, int x, int y, Block type){ + public static boolean validPlace(Team team, int x, int y, Block type, int rotation){ Recipe recipe = Recipes.getByResult(type); if(recipe == null || !state.inventory.hasItems(recipe.requirements)){ @@ -134,8 +134,8 @@ public class Placement { } return true; }else { - return tile.block() != type && (tile.getTeam() == Team.none || tile.getTeam() == team) - && (type.canReplace(tile.block()) || tile.block().alwaysReplace) + return (tile.getTeam() == Team.none || tile.getTeam() == team) + && ((type.canReplace(tile.block()) && !(type == tile.block() && rotation == tile.getRotation() && type.rotate)) || tile.block().alwaysReplace) && tile.block().isMultiblock() == type.isMultiblock() || tile.block() == Blocks.air; } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Splitter.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Splitter.java index b1752445a6..73fa303af7 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Splitter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Splitter.java @@ -2,6 +2,7 @@ package io.anuke.mindustry.world.blocks.types.distribution; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.BlockGroup; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.util.Mathf; @@ -13,6 +14,7 @@ public class Splitter extends Block{ instantTransfer = true; destructible = true; hasInventory = false; + group = BlockGroup.transportation; } @Override