Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -25,6 +25,7 @@ public abstract class BulletType extends Content{
|
||||
public float drawSize = 40f;
|
||||
public float drag = 0f;
|
||||
public boolean pierce, pierceBuilding;
|
||||
public int pierceCap = -1;
|
||||
public Effect hitEffect, despawnEffect;
|
||||
|
||||
/** Effect created when shooting. */
|
||||
@@ -235,6 +236,11 @@ public abstract class BulletType extends Content{
|
||||
}
|
||||
|
||||
public void init(Bullet b){
|
||||
if(pierceCap >= 1) {
|
||||
pierce = true;
|
||||
pierceBuilding = true;
|
||||
}
|
||||
|
||||
if(killShooter && b.owner() instanceof Healthc){
|
||||
((Healthc)b.owner()).kill();
|
||||
}
|
||||
|
||||
@@ -507,15 +507,15 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
}
|
||||
}
|
||||
|
||||
public float moveLiquidForward(float leakResistance, Liquid liquid){
|
||||
public float moveLiquidForward(boolean leaks, Liquid liquid){
|
||||
Tile next = tile.getNearby(rotation);
|
||||
|
||||
if(next == null) return 0;
|
||||
|
||||
if(next.build != null){
|
||||
return moveLiquid(next.build, liquid);
|
||||
}else if(leakResistance != 100f && !next.block().solid && !next.block().hasLiquids){
|
||||
float leakAmount = liquids.get(liquid) / leakResistance;
|
||||
}else if(leaks && !next.block().solid && !next.block().hasLiquids){
|
||||
float leakAmount = liquids.get(liquid) / 1.5f;
|
||||
Puddles.deposit(next, tile, liquid, leakAmount);
|
||||
liquids.remove(liquid, leakAmount);
|
||||
}
|
||||
|
||||
@@ -144,6 +144,10 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
if(type.pierceCap != -1 && collided.size >= type.pierceCap) {
|
||||
remove();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,7 @@ public class ArmoredConduit extends Conduit{
|
||||
|
||||
public ArmoredConduit(String name){
|
||||
super(name);
|
||||
leakResistance = 10f;
|
||||
leaks = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,7 +27,7 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
||||
public @Load(value = "@-top-#", length = 5) TextureRegion[] topRegions;
|
||||
public @Load(value = "@-bottom-#", length = 5, fallback = "conduit-bottom-#") TextureRegion[] botRegions;
|
||||
|
||||
public float leakResistance = 1.5f;
|
||||
public boolean leaks = true;
|
||||
|
||||
public Conduit(String name){
|
||||
super(name);
|
||||
@@ -131,7 +131,7 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
||||
smoothLiquid = Mathf.lerpDelta(smoothLiquid, liquids.currentAmount() / liquidCapacity, 0.05f);
|
||||
|
||||
if(liquids.total() > 0.001f && timer(timerFlow, 1)){
|
||||
moveLiquidForward(leakResistance, liquids.current());
|
||||
moveLiquidForward(leaks, liquids.current());
|
||||
noSleep();
|
||||
}else{
|
||||
sleep();
|
||||
|
||||
Reference in New Issue
Block a user