diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java index f70da4817a..8362b3e0b2 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -1194,7 +1194,7 @@ public class Blocks implements ContentList{ rotateSpeed = 1.4f; attribute = Attribute.water; - consumes.power(0.90f); + consumes.power(1f); }}; cultivator = new Cultivator("cultivator"){{ diff --git a/core/src/io/anuke/mindustry/entities/traits/DamageTrait.java b/core/src/io/anuke/mindustry/entities/traits/DamageTrait.java index 3f009687d6..fdb41472e8 100644 --- a/core/src/io/anuke/mindustry/entities/traits/DamageTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/DamageTrait.java @@ -1,5 +1,11 @@ package io.anuke.mindustry.entities.traits; +import io.anuke.mindustry.entities.type.*; + public interface DamageTrait{ float damage(); + + default void killed(Entity other){ + + } } diff --git a/core/src/io/anuke/mindustry/entities/traits/KillerTrait.java b/core/src/io/anuke/mindustry/entities/traits/KillerTrait.java new file mode 100644 index 0000000000..17efa31c40 --- /dev/null +++ b/core/src/io/anuke/mindustry/entities/traits/KillerTrait.java @@ -0,0 +1,5 @@ +package io.anuke.mindustry.entities.traits; + +public interface KillerTrait{ + void killed(Entity other); +} diff --git a/core/src/io/anuke/mindustry/entities/type/Bullet.java b/core/src/io/anuke/mindustry/entities/type/Bullet.java index 97051a2faa..a1f4831f66 100644 --- a/core/src/io/anuke/mindustry/entities/type/Bullet.java +++ b/core/src/io/anuke/mindustry/entities/type/Bullet.java @@ -134,6 +134,13 @@ public class Bullet extends SolidEntity implements DamageTrait, ScaleTrait, Pool return 1f; } + @Override + public void killed(Entity other){ + if(owner instanceof KillerTrait){ + ((KillerTrait)owner).killed(other); + } + } + @Override public void absorb(){ supressCollision = true; diff --git a/core/src/io/anuke/mindustry/entities/type/DestructibleEntity.java b/core/src/io/anuke/mindustry/entities/type/DestructibleEntity.java index 350a47f9cf..1db9308eef 100644 --- a/core/src/io/anuke/mindustry/entities/type/DestructibleEntity.java +++ b/core/src/io/anuke/mindustry/entities/type/DestructibleEntity.java @@ -15,8 +15,12 @@ public abstract class DestructibleEntity extends SolidEntity implements HealthTr @Override public void collision(SolidTrait other, float x, float y){ if(other instanceof DamageTrait){ + boolean wasDead = isDead(); onHit(other); damage(((DamageTrait)other).damage()); + if(!wasDead && isDead()){ + ((DamageTrait)other).killed(this); + } } } diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java index c734bfe474..8f671dbc04 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java @@ -35,7 +35,7 @@ import static io.anuke.mindustry.Vars.*; public class DesktopLauncher extends ClientLauncher{ public final static String discordID = "610508934456934412"; - boolean useDiscord = OS.is64Bit, showConsole = true; + boolean useDiscord = OS.is64Bit, showConsole = false; public static void main(String[] arg){ try{ @@ -217,6 +217,7 @@ public class DesktopLauncher extends ClientLauncher{ @Override public NetProvider getNet(){ + if(steam && SVars.net == null) SVars.net = new SNet(new ArcNetImpl()); return steam ? SVars.net : new ArcNetImpl(); }