Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2020-10-09 10:02:12 -04:00
6 changed files with 29 additions and 6 deletions

View File

@ -25,6 +25,7 @@ public abstract class BulletType extends Content{
public float drawSize = 40f; public float drawSize = 40f;
public float drag = 0f; public float drag = 0f;
public boolean pierce, pierceBuilding; public boolean pierce, pierceBuilding;
public int pierceCap = -1;
public Effect hitEffect, despawnEffect; public Effect hitEffect, despawnEffect;
/** Effect created when shooting. */ /** Effect created when shooting. */
@ -235,6 +236,11 @@ public abstract class BulletType extends Content{
} }
public void init(Bullet b){ public void init(Bullet b){
if(pierceCap >= 1) {
pierce = true;
pierceBuilding = true;
}
if(killShooter && b.owner() instanceof Healthc){ if(killShooter && b.owner() instanceof Healthc){
((Healthc)b.owner()).kill(); ((Healthc)b.owner()).kill();
} }

View File

@ -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); Tile next = tile.getNearby(rotation);
if(next == null) return 0; if(next == null) return 0;
if(next.build != null){ if(next.build != null){
return moveLiquid(next.build, liquid); return moveLiquid(next.build, liquid);
}else if(leakResistance != 100f && !next.block().solid && !next.block().hasLiquids){ }else if(leaks && !next.block().solid && !next.block().hasLiquids){
float leakAmount = liquids.get(liquid) / leakResistance; float leakAmount = liquids.get(liquid) / 1.5f;
Puddles.deposit(next, tile, liquid, leakAmount); Puddles.deposit(next, tile, liquid, leakAmount);
liquids.remove(liquid, leakAmount); liquids.remove(liquid, leakAmount);
} }

View File

@ -144,6 +144,10 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
return false; return false;
}); });
} }
if(type.pierceCap != -1 && collided.size >= type.pierceCap) {
remove();
}
} }
@Override @Override

View File

@ -11,7 +11,7 @@ public class ArmoredConduit extends Conduit{
public ArmoredConduit(String name){ public ArmoredConduit(String name){
super(name); super(name);
leakResistance = 10f; leaks = false;
} }
@Override @Override

View File

@ -27,7 +27,7 @@ public class Conduit extends LiquidBlock implements Autotiler{
public @Load(value = "@-top-#", length = 5) TextureRegion[] topRegions; public @Load(value = "@-top-#", length = 5) TextureRegion[] topRegions;
public @Load(value = "@-bottom-#", length = 5, fallback = "conduit-bottom-#") TextureRegion[] botRegions; public @Load(value = "@-bottom-#", length = 5, fallback = "conduit-bottom-#") TextureRegion[] botRegions;
public float leakResistance = 1.5f; public boolean leaks = true;
public Conduit(String name){ public Conduit(String name){
super(name); super(name);
@ -131,7 +131,7 @@ public class Conduit extends LiquidBlock implements Autotiler{
smoothLiquid = Mathf.lerpDelta(smoothLiquid, liquids.currentAmount() / liquidCapacity, 0.05f); smoothLiquid = Mathf.lerpDelta(smoothLiquid, liquids.currentAmount() / liquidCapacity, 0.05f);
if(liquids.total() > 0.001f && timer(timerFlow, 1)){ if(liquids.total() > 0.001f && timer(timerFlow, 1)){
moveLiquidForward(leakResistance, liquids.current()); moveLiquidForward(leaks, liquids.current());
noSleep(); noSleep();
}else{ }else{
sleep(); sleep();

View File

@ -55,6 +55,8 @@ public class ServerControl implements ApplicationListener{
private ServerSocket serverSocket; private ServerSocket serverSocket;
private PrintWriter socketOutput; private PrintWriter socketOutput;
private String yes;
public ServerControl(String[] args){ public ServerControl(String[] args){
Core.settings.defaults( Core.settings.defaults(
"bans", "", "bans", "",
@ -907,6 +909,14 @@ public class ServerControl implements ApplicationListener{
info("&ly@&lg MB collected. Memory usage now at &ly@&lg MB.", pre - post, post); info("&ly@&lg MB collected. Memory usage now at &ly@&lg MB.", pre - post, post);
}); });
handler.register("yes", "Run the above \"did you mean\" suggestion.", arg -> {
if(yes == null){
err("There is nothing to say yes to.");
}else{
handleCommandString(yes);
}
});
mods.eachClass(p -> p.registerServerCommands(handler)); mods.eachClass(p -> p.registerServerCommands(handler));
} }
@ -937,6 +947,7 @@ public class ServerControl implements ApplicationListener{
if(closest != null){ if(closest != null){
err("Command not found. Did you mean \"" + closest.text + "\"?"); err("Command not found. Did you mean \"" + closest.text + "\"?");
yes = line.replace(response.runCommand, closest.text);
}else{ }else{
err("Invalid command. Type 'help' for help."); err("Invalid command. Type 'help' for help.");
} }
@ -944,6 +955,8 @@ public class ServerControl implements ApplicationListener{
err("Too few command arguments. Usage: " + response.command.text + " " + response.command.paramText); err("Too few command arguments. Usage: " + response.command.text + " " + response.command.paramText);
}else if(response.type == ResponseType.manyArguments){ }else if(response.type == ResponseType.manyArguments){
err("Too many command arguments. Usage: " + response.command.text + " " + response.command.paramText); err("Too many command arguments. Usage: " + response.command.text + " " + response.command.paramText);
}else if(response.type == ResponseType.valid){
yes = null;
} }
} }