diff --git a/core/assets/version.properties b/core/assets/version.properties index e0bd984881..3f11b069d3 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,7 +1,7 @@ #Autogenerated file. Do not modify. -#Thu Apr 05 22:30:42 EDT 2018 +#Fri Apr 06 10:14:01 EDT 2018 version=release -androidBuildCode=853 +androidBuildCode=856 name=Mindustry code=3.4 build=custom build diff --git a/core/src/io/anuke/mindustry/content/Liquids.java b/core/src/io/anuke/mindustry/content/Liquids.java index 28101ccff3..1920495cca 100644 --- a/core/src/io/anuke/mindustry/content/Liquids.java +++ b/core/src/io/anuke/mindustry/content/Liquids.java @@ -13,13 +13,6 @@ public class Liquids { heatCapacity = 0.4f; } }, - plasma = new Liquid("plasma", Color.CORAL) { - { - flammability = 0.4f; - viscosity = 0.1f; - heatCapacity = 0.2f; - } - }, lava = new Liquid("lava", Color.valueOf("e37341")) { { temperature = 0.7f; @@ -38,12 +31,5 @@ public class Liquids { heatCapacity = 0.75f; temperature = 0.5f; } - }, - sulfuricAcid = new Liquid("sulfuricAcid", Color.YELLOW) { - { - flammability = 0.4f; - explosiveness = 0.4f; - heatCapacity = 0.4f; - } }; } diff --git a/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java b/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java index 793053cb3f..a01601c5a4 100644 --- a/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java @@ -131,17 +131,18 @@ public class WeaponBlocks{ }; }}, - chainturret = new Turret("chainturret"){ + chainturret = new Turret("chainturret"){{ - }, + }}, - titanturret = new Turret("titancannon"){ + titanturret = new Turret("titancannon"){{ - }, + }}, fornaxcannon = new PowerTurret("fornaxcannon") { }, + missileturret = new PowerTurret("missileturret") { }; diff --git a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java index 7b79307dd3..fb53e13a94 100644 --- a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java @@ -8,6 +8,7 @@ import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.entities.Bullet; import io.anuke.mindustry.entities.BulletType; import io.anuke.mindustry.entities.effect.DamageArea; +import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.resource.Liquid; import io.anuke.ucore.core.Effects; @@ -168,6 +169,21 @@ public class TurretBullets { status = StatusEffects.oiled; statusIntensity = 0.5f; } + }, + lightning = new BulletType(0.001f, 5) { + { + lifetime = 1; + } + + @Override + public void draw(Bullet b) { + + } + + @Override + public void init(Bullet b) { + new Lightning(b.team, b, b.x, b.y, b.angle(), 30); + } }; private static void drawBullet(Color first, Color second, String name, float x, float y, float w, float h, float rot){ diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index c42d5cbab2..9beb6219b4 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -99,12 +99,6 @@ public class Player extends Unit{ @Override public boolean collides(SolidEntity other){ - if(other instanceof Bullet){ - Bullet b = (Bullet)other; - if(!state.friendlyFire && b.owner instanceof Player){ - return false; - } - } return !isDead() && super.collides(other) && !mech.flying; } diff --git a/core/src/io/anuke/mindustry/entities/Unit.java b/core/src/io/anuke/mindustry/entities/Unit.java index 8a0e619625..d4805fb02b 100644 --- a/core/src/io/anuke/mindustry/entities/Unit.java +++ b/core/src/io/anuke/mindustry/entities/Unit.java @@ -2,6 +2,9 @@ package io.anuke.mindustry.entities; import com.badlogic.gdx.math.Vector2; import io.anuke.mindustry.game.Team; +import io.anuke.ucore.entities.SolidEntity; + +import static io.anuke.mindustry.Vars.state; public abstract class Unit extends SyncEntity { //total duration of hit effect @@ -18,6 +21,11 @@ public abstract class Unit extends SyncEntity { hitTime = hitDuration; } + @Override + public boolean collides(SolidEntity other){ + return other instanceof Bullet && state.teams.areEnemies((((Bullet) other).team), team); + } + public void damage(float amount, boolean withEffect){ if(withEffect){ damage(amount); diff --git a/core/src/io/anuke/mindustry/entities/effect/Lightning.java b/core/src/io/anuke/mindustry/entities/effect/Lightning.java new file mode 100644 index 0000000000..efeb534ebc --- /dev/null +++ b/core/src/io/anuke/mindustry/entities/effect/Lightning.java @@ -0,0 +1,34 @@ +package io.anuke.mindustry.entities.effect; + +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.utils.Array; +import io.anuke.mindustry.game.Team; +import io.anuke.ucore.entities.Entity; +import io.anuke.ucore.entities.SolidEntity; +import io.anuke.ucore.util.Angles; +import io.anuke.ucore.util.Mathf; + +public class Lightning extends Entity { + private Array lines = new Array(); + + public Lightning(Team team, SolidEntity damager, float x, float y, float angle, int length){ + float step = 3f; + + for(int i = 0; i < length; i ++){ + lines.add(new Vector2(x, y)); + + float x2 = x + Angles.trnsx(angle, step); + float y2 = y + Angles.trnsy(angle, step); + angle += Mathf.range(30f); + + if(Mathf.chance(0.1)){ + new Lightning(team, damager, x2, y2, angle + Mathf.range(100f), length/2).add(); + } + + x = x2; + y = y2; + } + + lines.add(new Vector2(x, y)); + } +} diff --git a/core/src/io/anuke/mindustry/entities/units/BaseUnit.java b/core/src/io/anuke/mindustry/entities/units/BaseUnit.java index 273a6197e8..54dda77ce6 100644 --- a/core/src/io/anuke/mindustry/entities/units/BaseUnit.java +++ b/core/src/io/anuke/mindustry/entities/units/BaseUnit.java @@ -5,13 +5,11 @@ import io.anuke.mindustry.entities.BulletType; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.game.Team; import io.anuke.ucore.entities.Entity; -import io.anuke.ucore.entities.SolidEntity; import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Timer; import java.nio.ByteBuffer; -import static io.anuke.mindustry.Vars.state; import static io.anuke.mindustry.Vars.unitGroups; public class BaseUnit extends Unit { @@ -74,11 +72,6 @@ public class BaseUnit extends Unit { return 14; } - @Override - public boolean collides(SolidEntity other){ - return other instanceof Bullet && state.teams.areEnemies((((Bullet) other).team), team); - } - @Override public void onRemoteShoot(BulletType type, float x, float y, float rotation, short data) { new Bullet(type, this, x, y, rotation).add().damage = data; diff --git a/gradle.properties b/gradle.properties index 2124de9a6e..7259665617 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,4 +2,5 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms512m -Xmx1536m org.gradle.configureondemand=true android.enableAapt2=false -android.injected.build.model.only.versioned=3 \ No newline at end of file +android.injected.build.model.only.versioned=3 +android.enableD8=true