From 7dca6b2a3071b9c1dd184c09bf1a67fbd7b8832c Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 10 Apr 2020 19:17:40 -0400 Subject: [PATCH] Other tweaks --- .../blocks/defense/turrets/LaserTurret.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java b/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java index 66ed79aa8b..3abe53bcf3 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java @@ -59,7 +59,19 @@ public class LaserTurret extends PowerTurret{ if(bulletLife <= 0f){ bullet = null; } + }else if(reload > 0){ + Liquid liquid = liquids().current(); + float maxUsed = consumes.get(ConsumeType.liquid).amount; + + float used = (tile.isEnemyCheat() ? maxUsed * Time.delta() : Math.min(liquids.get(liquid), maxUsed * Time.delta())) * liquid.heatCapacity * coolantMultiplier; + reload -= used; + liquids.remove(liquid, used); + + if(Mathf.chance(0.06 * used)){ + coolEffect.at(x + Mathf.range(size * tilesize / 2f), y + Mathf.range(size * tilesize / 2f)); + } } + } @Override @@ -74,17 +86,6 @@ public class LaserTurret extends PowerTurret{ shoot(type); reload = reloadTime; - }else{ - Liquid liquid = liquids().current(); - float maxUsed = consumes.get(ConsumeType.liquid).amount; - - float used = (tile.isEnemyCheat() ? maxUsed * Time.delta() : Math.min(liquids.get(liquid), maxUsed * Time.delta())) * liquid.heatCapacity * coolantMultiplier; - reload -= used; - liquids.remove(liquid, used); - - if(Mathf.chance(0.06 * used)){ - coolEffect.at(x + Mathf.range(size * tilesize / 2f), y + Mathf.range(size * tilesize / 2f)); - } } }