Fixed turret cooling

This commit is contained in:
Anuken 2019-09-18 08:49:48 -04:00
parent 5d0cfc3599
commit c6a4bf69ee
4 changed files with 9 additions and 4 deletions

View File

@ -122,8 +122,6 @@ public class Vars implements Loadable{
public static FileHandle saveDirectory;
/** data subdirectory used for plugins */
public static FileHandle pluginDirectory;
/** old map file extension, for conversion */
public static final String oldMapExtension = "mmap";
/** map file extension */
public static final String mapExtension = "msav";
/** save file extension */

View File

@ -55,7 +55,7 @@ public class CooledTurret extends Turret{
Liquid liquid = entity.liquids.current();
float used = Math.min(Math.min(entity.liquids.get(liquid), maxUsed * Time.delta()), Math.max(0, ((reload - entity.reload) / coolantMultiplier) / liquid.heatCapacity)) * baseReloadSpeed(tile);
entity.reload += (used * liquid.heatCapacity) / liquid.heatCapacity;
entity.reload += used * liquid.heatCapacity * coolantMultiplier;
entity.liquids.remove(liquid, used);
if(Mathf.chance(0.06 * used)){

View File

@ -100,7 +100,7 @@ public abstract class Turret extends Block{
stats.add(BlockStat.shootRange, range / tilesize, StatUnit.blocks);
stats.add(BlockStat.inaccuracy, (int)inaccuracy, StatUnit.degrees);
stats.add(BlockStat.reload, 60f / reload * shots, StatUnit.none);
stats.add(BlockStat.reload, 60f / reload, StatUnit.none);
stats.add(BlockStat.shots, shots, StatUnit.none);
stats.add(BlockStat.targetsAir, targetAir);
stats.add(BlockStat.targetsGround, targetGround);

View File

@ -127,6 +127,13 @@ public class GenericCrafter extends Block{
}
}
@Override
public boolean outputsItems(){
return outputItem != null;
}
@Override
public boolean canProduce(Tile tile){
if(outputItem != null && tile.entity.items.get(outputItem.item) >= itemCapacity){