diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index ee7278fa6a..0a6e6c38e7 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -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(); } diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 6c506ef6de..4a8e23e6cf 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -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); } diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index ac831ef507..4deb7cc9dc 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -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 diff --git a/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java b/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java index a84148af09..c2af911324 100644 --- a/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java +++ b/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java @@ -11,7 +11,7 @@ public class ArmoredConduit extends Conduit{ public ArmoredConduit(String name){ super(name); - leakResistance = 10f; + leaks = false; } @Override diff --git a/core/src/mindustry/world/blocks/liquid/Conduit.java b/core/src/mindustry/world/blocks/liquid/Conduit.java index b2fa75b045..2af6613212 100644 --- a/core/src/mindustry/world/blocks/liquid/Conduit.java +++ b/core/src/mindustry/world/blocks/liquid/Conduit.java @@ -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(); diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index 1e0aa942ab..48f529b187 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -55,6 +55,8 @@ public class ServerControl implements ApplicationListener{ private ServerSocket serverSocket; private PrintWriter socketOutput; + private String yes; + public ServerControl(String[] args){ Core.settings.defaults( "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); }); + 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)); } @@ -937,6 +947,7 @@ public class ServerControl implements ApplicationListener{ if(closest != null){ err("Command not found. Did you mean \"" + closest.text + "\"?"); + yes = line.replace(response.runCommand, closest.text); }else{ 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); }else if(response.type == ResponseType.manyArguments){ err("Too many command arguments. Usage: " + response.command.text + " " + response.command.paramText); + }else if(response.type == ResponseType.valid){ + yes = null; } }