From 061c55614b2814090c4d2e3e05dc20e1bfd5c04e Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 8 Dec 2018 20:11:15 -0500 Subject: [PATCH] Balancing / Tau mech mobile block repair --- core/src/io/anuke/mindustry/content/Items.java | 2 +- core/src/io/anuke/mindustry/content/Liquids.java | 2 +- core/src/io/anuke/mindustry/content/Mechs.java | 5 +++-- core/src/io/anuke/mindustry/content/Weapons.java | 2 +- .../mindustry/content/blocks/CraftingBlocks.java | 4 ++-- .../mindustry/content/blocks/PowerBlocks.java | 2 +- .../content/blocks/ProductionBlocks.java | 4 ++-- .../mindustry/content/blocks/StorageBlocks.java | 2 +- .../mindustry/content/blocks/TurretBlocks.java | 2 +- .../mindustry/content/bullets/TurretBullets.java | 2 +- core/src/io/anuke/mindustry/entities/Player.java | 16 ++++++++++++++-- .../io/anuke/mindustry/input/MobileInput.java | 3 +++ core/src/io/anuke/mindustry/type/Mech.java | 1 + .../world/blocks/distribution/LiquidTank.java | 8 -------- .../world/blocks/power/LiquidHeatGenerator.java | 2 +- .../mindustry/world/blocks/power/PowerNode.java | 3 ++- 16 files changed, 35 insertions(+), 25 deletions(-) diff --git a/core/src/io/anuke/mindustry/content/Items.java b/core/src/io/anuke/mindustry/content/Items.java index a19a2a4048..8c1d7064db 100644 --- a/core/src/io/anuke/mindustry/content/Items.java +++ b/core/src/io/anuke/mindustry/content/Items.java @@ -83,7 +83,7 @@ public class Items implements ContentList{ }}; biomatter = new Item("biomatter", Color.valueOf("648b55")){{ - flammability = 0.4f; + flammability = 0.55f; fluxiness = 0.3f; }}; diff --git a/core/src/io/anuke/mindustry/content/Liquids.java b/core/src/io/anuke/mindustry/content/Liquids.java index f2e8ec6c0f..fc8bb44bfb 100644 --- a/core/src/io/anuke/mindustry/content/Liquids.java +++ b/core/src/io/anuke/mindustry/content/Liquids.java @@ -26,7 +26,7 @@ public class Liquids implements ContentList{ lava = new Liquid("lava", Color.valueOf("e37341")){ { - temperature = 0.8f; + temperature = 1f; viscosity = 0.8f; tier = 2; effect = StatusEffects.melting; diff --git a/core/src/io/anuke/mindustry/content/Mechs.java b/core/src/io/anuke/mindustry/content/Mechs.java index 88fb7b6a9e..589ef08b95 100644 --- a/core/src/io/anuke/mindustry/content/Mechs.java +++ b/core/src/io/anuke/mindustry/content/Mechs.java @@ -123,6 +123,7 @@ public class Mechs implements ContentList{ speed = 0.44f; drag = 0.35f; boostSpeed = 0.8f; + canHeal = true; weapon = Weapons.healBlaster; armor = 15f; trailColorTo = Palette.heal; @@ -287,8 +288,8 @@ public class Mechs implements ContentList{ trident = new Mech("trident-ship", true){ { drillPower = 2; - speed = 0.12f; - drag = 0.035f; + speed = 0.14f; + drag = 0.034f; mass = 2.5f; turnCursor = false; armor = 20f; diff --git a/core/src/io/anuke/mindustry/content/Weapons.java b/core/src/io/anuke/mindustry/content/Weapons.java index bc77a1e784..480c8988bf 100644 --- a/core/src/io/anuke/mindustry/content/Weapons.java +++ b/core/src/io/anuke/mindustry/content/Weapons.java @@ -152,7 +152,7 @@ public class Weapons implements ContentList{ bomberTrident = new Weapon("bomber"){{ length = 0f; width = 2f; - reload = 9f; + reload = 8f; shots = 2; roundrobin = true; ejectEffect = Fx.none; diff --git a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java index b9a0a383e0..de9b602fe2 100644 --- a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java @@ -196,9 +196,9 @@ public class CraftingBlocks extends BlockList implements ContentList{ biomatterCompressor = new Compressor("biomattercompressor"){{ liquidCapacity = 60f; itemCapacity = 50; - craftTime = 25f; + craftTime = 20f; outputLiquid = Liquids.oil; - outputLiquidAmount = 1.5f; + outputLiquidAmount = 2.5f; size = 2; health = 320; hasLiquids = true; diff --git a/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java b/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java index 9e3df7f685..1101a106e8 100644 --- a/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java @@ -21,7 +21,7 @@ public class PowerBlocks extends BlockList implements ContentList{ thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{ maxLiquidGenerate = 2f; powerCapacity = 40f; - powerPerLiquid = 0.3f; + powerPerLiquid = 0.35f; generateEffect = BlockFx.redgeneratespark; size = 2; }}; diff --git a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java index 8bd571620b..389cb425c7 100644 --- a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java @@ -99,13 +99,13 @@ public class ProductionBlocks extends BlockList implements ContentList{ cultivator = new Cultivator("cultivator"){{ result = Items.biomatter; - drillTime = 260; + drillTime = 200; size = 2; hasLiquids = true; hasPower = true; consumes.power(0.08f); - consumes.liquid(Liquids.water, 0.2f); + consumes.liquid(Liquids.water, 0.15f); }}; } diff --git a/core/src/io/anuke/mindustry/content/blocks/StorageBlocks.java b/core/src/io/anuke/mindustry/content/blocks/StorageBlocks.java index a4519d04cb..9972317a99 100644 --- a/core/src/io/anuke/mindustry/content/blocks/StorageBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/StorageBlocks.java @@ -27,7 +27,7 @@ public class StorageBlocks extends BlockList implements ContentList{ }}; unloader = new SortedUnloader("unloader"){{ - speed = 12f; + speed = 7f; }}; } } diff --git a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java index a3a805a557..9569fd7826 100644 --- a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java @@ -69,7 +69,7 @@ public class TurretBlocks extends BlockList implements ContentList{ inaccuracy = 5f; shootCone = 50f; shootEffect = ShootFx.shootLiquid; - range = 70f; + range = 90f; health = 360; drawer = (tile, entity) -> { diff --git a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java index 3b356f3251..1ec5252b02 100644 --- a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java @@ -334,7 +334,7 @@ public class TurretBullets extends BulletList implements ContentList{ lifetime = 200f; despawneffect = BlockFx.smeltsmoke; hiteffect = BulletFx.hitBulletBig; - drag = 0.01f; + drag = 0.005f; } @Override diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index e70562a1db..c4708c9951 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -645,7 +645,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } protected void updateFlying(){ - if(Units.invalidateTarget(target, this)){ + if(Units.invalidateTarget(target, this) && !(target instanceof TileEntity && ((TileEntity) target).damaged() && target.getTeam() == team && + mech.canHeal && distanceTo(target) < getWeapon().getAmmo().getRange())){ target = null; } @@ -726,11 +727,22 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra isShooting = false; if(Settings.getBool("autotarget")){ target = Units.getClosestTarget(team, x, y, getWeapon().getAmmo().getRange()); + + if(mech.canHeal && target == null){ + target = Geometry.findClosest(x, y, world.indexer.getDamaged(Team.blue)); + if(target != null && distanceTo(target) > getWeapon().getAmmo().getRange()){ + target = null; + }else if(target != null){ + target = ((Tile)target).entity; + } + } + if(target != null){ setMineTile(null); } } - }else if(target.isValid()){ + }else if(target.isValid() || (target instanceof TileEntity && ((TileEntity) target).damaged() && target.getTeam() == team && + mech.canHeal && distanceTo(target) < getWeapon().getAmmo().getRange())){ //rotate toward and shoot the target if(mech.turnCursor){ rotation = Mathf.slerpDelta(rotation, angleTo(target), 0.2f); diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index 9379b8c917..f4272a40cb 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -96,6 +96,9 @@ public class MobileInput extends InputHandler implements GestureListener{ TileEntity entity = tile.entity; player.setMineTile(null); player.target = entity; + }else if(tile != null && player.mech.canHeal && tile.entity != null && tile.getTeam() == player.getTeam() && tile.entity.damaged()){ + player.setMineTile(null); + player.target = tile.entity; } } } diff --git a/core/src/io/anuke/mindustry/type/Mech.java b/core/src/io/anuke/mindustry/type/Mech.java index f075f1c2e1..744bf11be1 100644 --- a/core/src/io/anuke/mindustry/type/Mech.java +++ b/core/src/io/anuke/mindustry/type/Mech.java @@ -34,6 +34,7 @@ public class Mech extends UnlockableContent{ public Color trailColorTo = Palette.boostTo; public int itemCapacity = 30; public boolean turnCursor = true; + public boolean canHeal = false; public float weaponOffsetX, weaponOffsetY; public Weapon weapon = Weapons.blaster; diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidTank.java b/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidTank.java index 84ec99523e..c73ab0d2d0 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidTank.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidTank.java @@ -1,16 +1,8 @@ package io.anuke.mindustry.world.blocks.distribution; -import io.anuke.mindustry.type.Liquid; -import io.anuke.mindustry.world.Tile; - public class LiquidTank extends LiquidRouter{ public LiquidTank(String name){ super(name); } - - @Override - public boolean canDumpLiquid(Tile tile, Tile to, Liquid liquid){ - return super.canDumpLiquid(tile, to, liquid) && !(to.block() instanceof LiquidTank); - } } diff --git a/core/src/io/anuke/mindustry/world/blocks/power/LiquidHeatGenerator.java b/core/src/io/anuke/mindustry/world/blocks/power/LiquidHeatGenerator.java index 67a5bed015..87e5275cc9 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/LiquidHeatGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/LiquidHeatGenerator.java @@ -14,7 +14,7 @@ public class LiquidHeatGenerator extends LiquidGenerator{ public void setStats(){ super.setStats(); - stats.add(BlockStat.basePowerGeneration, maxLiquidGenerate * powerPerLiquid * 60f, StatUnit.powerSecond); + stats.add(BlockStat.basePowerGeneration, maxLiquidGenerate * powerPerLiquid * 60f * 0.5f, StatUnit.powerSecond); } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java index 20504efd70..3ac43cc98d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java @@ -47,7 +47,8 @@ public class PowerNode extends PowerBlock{ @Remote(targets = Loc.both, called = Loc.server, forward = true) public static void linkPowerNodes(Player player, Tile tile, Tile other){ - if(tile.entity.power == null || !((PowerNode)tile.block()).linkValid(tile, other)) return; + if(tile.entity.power == null || !((PowerNode)tile.block()).linkValid(tile, other) + || tile.entity.power.links.size >= ((PowerNode)tile.block()).maxNodes) return; TileEntity entity = tile.entity();