Other tweaks

This commit is contained in:
Anuken 2020-04-10 19:17:40 -04:00
parent 758ace353e
commit 7dca6b2a30

View File

@ -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.<ConsumeLiquidBase>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.<ConsumeLiquidBase>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));
}
}
}