Rename leak rate to leak resistance
Since the higher the number is the slower it leaks.
This commit is contained in:
@@ -138,7 +138,7 @@ public abstract class BlockStorage extends UnlockableContent{
|
||||
return tryMoveLiquid(tile, next, leak ? 1.5f : 0f, liquid);
|
||||
}
|
||||
|
||||
public float tryMoveLiquid(Tile tile, Tile next, float leakrate, Liquid liquid){
|
||||
public float tryMoveLiquid(Tile tile, Tile next, float leakResistance, Liquid liquid){
|
||||
if(next == null) return 0;
|
||||
|
||||
next = next.link();
|
||||
@@ -171,8 +171,8 @@ public abstract class BlockStorage extends UnlockableContent{
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if(leakrate > 0f && !next.block().solid && !next.block().hasLiquids){
|
||||
float leakAmount = tile.entity.liquids.get(liquid) / leakrate;
|
||||
}else if(leakResistance > 0f && !next.block().solid && !next.block().hasLiquids){
|
||||
float leakAmount = tile.entity.liquids.get(liquid) / leakResistance;
|
||||
Puddle.deposit(next, tile, liquid, leakAmount);
|
||||
tile.entity.liquids.remove(liquid, leakAmount);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class ArmoredConduit extends Conduit{
|
||||
|
||||
public ArmoredConduit(String name) {
|
||||
super(name);
|
||||
leakRate = 10f;
|
||||
leakResistance = 10f;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -27,6 +27,7 @@ public class ArmoredConduit extends Conduit{
|
||||
public void draw(Tile tile) {
|
||||
super.draw(tile);
|
||||
|
||||
// draw the cap when a conduit would normally leak
|
||||
Tile next = tile.getNearby(tile.rotation());
|
||||
if (next.getTeam() == tile.getTeam() && next.block().hasLiquids) return;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
||||
protected TextureRegion[] topRegions = new TextureRegion[7];
|
||||
protected TextureRegion[] botRegions = new TextureRegion[7];
|
||||
|
||||
protected float leakRate = 1.5f;
|
||||
protected float leakResistance = 1.5f;
|
||||
|
||||
public Conduit(String name){
|
||||
super(name);
|
||||
@@ -111,7 +111,7 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
||||
entity.smoothLiquid = Mathf.lerpDelta(entity.smoothLiquid, entity.liquids.total() / liquidCapacity, 0.05f);
|
||||
|
||||
if(tile.entity.liquids.total() > 0.001f && tile.entity.timer.get(timerFlow, 1)){
|
||||
tryMoveLiquid(tile, tile.getNearby(tile.rotation()), leakRate, tile.entity.liquids.current());
|
||||
tryMoveLiquid(tile, tile.getNearby(tile.rotation()), leakResistance, tile.entity.liquids.current());
|
||||
entity.noSleep();
|
||||
}else{
|
||||
entity.sleep();
|
||||
|
||||
Reference in New Issue
Block a user