From 530505c3a0b3da3ac6a96c3cfe4f2eec140088df Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 8 Jan 2018 19:51:36 -0500 Subject: [PATCH] Made flak actually flak-like --- .../io/anuke/mindustry/AndroidLauncher.java | 2 - core/src/io/anuke/mindustry/core/Control.java | 6 --- .../anuke/mindustry/entities/BulletType.java | 49 +++++++++++++++++++ .../mindustry/world/blocks/DefenseBlocks.java | 2 +- .../world/blocks/ProductionBlocks.java | 8 +-- .../mindustry/world/blocks/WeaponBlocks.java | 8 +-- .../types/production/NuclearReactor.java | 13 +++-- 7 files changed, 65 insertions(+), 23 deletions(-) diff --git a/android/src/io/anuke/mindustry/AndroidLauncher.java b/android/src/io/anuke/mindustry/AndroidLauncher.java index b439264212..175a173aa7 100644 --- a/android/src/io/anuke/mindustry/AndroidLauncher.java +++ b/android/src/io/anuke/mindustry/AndroidLauncher.java @@ -86,8 +86,6 @@ public class AndroidLauncher extends AndroidApplication{ } }; - Mindustry.platforms.requestWritePerms(); - if(doubleScaleTablets && isTablet(this.getContext())){ Unit.dp.addition = 0.5f; } diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 46906b3fe7..2b21075d41 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -225,12 +225,6 @@ public class Control extends Module{ weapons.add(Weapon.blaster); player.weaponLeft = player.weaponRight = weapons.first(); - - if(debug){ - //weapons.add(Weapon.triblaster, Weapon.clustergun, Weapon.beam, Weapon.vulcan); - //weapons.add(Weapon.shockgun); - player.weaponLeft = player.weaponRight = weapons.peek(); - } lastUpdated = -1; wave = 1; diff --git a/core/src/io/anuke/mindustry/entities/BulletType.java b/core/src/io/anuke/mindustry/entities/BulletType.java index c072a834ce..2d321330b8 100644 --- a/core/src/io/anuke/mindustry/entities/BulletType.java +++ b/core/src/io/anuke/mindustry/entities/BulletType.java @@ -124,6 +124,55 @@ public abstract class BulletType extends BaseBulletType{ DamageArea.damage(!(b.owner instanceof Enemy), b.x, b.y, 25f, (int)(damage * 2f/3f)); } }, + flak = new BulletType(3f, 8) { + + public void init(Bullet b) { + b.velocity.scl(Mathf.random(0.6f, 1f)); + } + + public void update(Bullet b){ + if(Timers.get(b, "smoke", 7)){ + Effects.effect(Fx.smoke, b.x + Mathf.range(2), b.y + Mathf.range(2)); + } + } + + public void draw(Bullet b) { + Draw.color(Color.GRAY); + Draw.thick(3f); + Draw.lineAngleCenter(b.x, b.y, b.angle(), 2f); + Draw.thick(1.5f); + Draw.lineAngleCenter(b.x, b.y, b.angle(), 5f); + Draw.reset(); + } + + public void removed(Bullet b) { + despawned(b); + } + + public void despawned(Bullet b) { + Effects.effect(shellsmoke, b); + for(int i = 0; i < 3; i ++){ + Bullet bullet = new Bullet(flakspark, b.owner, b.x, b.y, b.angle() + Mathf.range(120f)); + bullet.add(); + } + } + }, + flakspark = new BulletType(2f, 2) { + { + drag = 0.05f; + } + + public void init(Bullet b) { + b.velocity.scl(Mathf.random(0.6f, 1f)); + } + + public void draw(Bullet b) { + Draw.color(Color.LIGHT_GRAY, Color.GRAY, b.ifract()); + Draw.thick(2f - b.ifract()); + Draw.lineAngleCenter(b.x, b.y, b.angle(), 2f); + Draw.reset(); + } + }, titanshell = new BulletType(1.8f, 38){ { lifetime = 70f; diff --git a/core/src/io/anuke/mindustry/world/blocks/DefenseBlocks.java b/core/src/io/anuke/mindustry/world/blocks/DefenseBlocks.java index 67b24c60f8..4fdacf8d6f 100644 --- a/core/src/io/anuke/mindustry/world/blocks/DefenseBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/DefenseBlocks.java @@ -59,7 +59,7 @@ public class DefenseBlocks{ megarepairturret = new RepairTurret("megarepairturret"){ { range = 44; - reload = 20f; + reload = 20f; health = 90; powerUsed = 0.13f; } diff --git a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java index 159de661e1..be0158cc4f 100644 --- a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java @@ -163,7 +163,7 @@ public class ProductionBlocks{ coalgenerator = new ItemPowerGenerator("coalgenerator"){ { generateItem = Item.coal; - powerOutput = 0.05f; + powerOutput = 0.04f; powerCapacity = 40f; } }, @@ -171,7 +171,7 @@ public class ProductionBlocks{ { generateLiquid = Liquid.lava; maxLiquidGenerate = 0.5f; - powerPerLiquid = 0.09f; + powerPerLiquid = 0.08f; powerCapacity = 40f; generateEffect = Fx.redgeneratespark; } @@ -180,7 +180,7 @@ public class ProductionBlocks{ { generateLiquid = Liquid.oil; maxLiquidGenerate = 0.4f; - powerPerLiquid = 0.13f; + powerPerLiquid = 0.12f; powerCapacity = 40f; } }, @@ -188,7 +188,7 @@ public class ProductionBlocks{ { generateItem = Item.uranium; powerCapacity = 40f; - powerOutput = 0.04f; + powerOutput = 0.03f; itemDuration = 240f; } }, diff --git a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java b/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java index 5f3984b5fe..64f165f4ef 100644 --- a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java @@ -100,10 +100,12 @@ public class WeaponBlocks{ mortarturret = new Turret("mortarturret"){ { shootsound = "bigshot"; - rotatespeed = 0.1f; + rotatespeed = 0.2f; range = 120; - reload = 100f; - bullet = BulletType.shell; + reload = 50f; + bullet = BulletType.flak; + shots = 3; + inaccuracy = 8f; ammo = Item.coal; ammoMultiplier = 5; health = 110; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java b/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java index f8417e8c4a..ae91c0e4a7 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java @@ -1,12 +1,7 @@ package io.anuke.mindustry.world.blocks.types.production; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.math.Vector2; - import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.TileEntity; @@ -21,6 +16,10 @@ import io.anuke.ucore.core.Timers; import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Tmp; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + //TODO possibly proken public class NuclearReactor extends LiquidPowerGenerator{ protected final int timerFuel = timers++; @@ -30,8 +29,8 @@ public class NuclearReactor extends LiquidPowerGenerator{ protected int itemCapacity = 30; protected Color coolColor = new Color(1, 1, 1, 0f); protected Color hotColor = Color.valueOf("ff9575a3"); - protected int fuelUseTime = 140; //time to consume 1 fuel - protected float powerMultiplier = 0.4f; //power per frame, depends on full capacity + protected int fuelUseTime = 130; //time to consume 1 fuel + protected float powerMultiplier = 0.45f; //power per frame, depends on full capacity protected float heating = 0.007f; //heating per frame protected float coolantPower = 0.007f; //how much heat decreases per coolant unit protected float smokeThreshold = 0.3f; //threshold at which block starts smoking