mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-23 22:28:08 +07:00
Other tweaks
This commit is contained in:
@ -59,9 +59,21 @@ public class LaserTurret extends PowerTurret{
|
|||||||
if(bulletLife <= 0f){
|
if(bulletLife <= 0f){
|
||||||
bullet = null;
|
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
|
@Override
|
||||||
protected void updateShooting(){
|
protected void updateShooting(){
|
||||||
if(bulletLife > 0 && bullet != null){
|
if(bulletLife > 0 && bullet != null){
|
||||||
@ -74,17 +86,6 @@ public class LaserTurret extends PowerTurret{
|
|||||||
shoot(type);
|
shoot(type);
|
||||||
|
|
||||||
reload = reloadTime;
|
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user