From 0eb0f349089e8457c64313453a49342d301f5688 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Thu, 8 Oct 2020 19:14:05 -0700 Subject: [PATCH 1/7] add pierceCap --- core/src/mindustry/entities/bullet/BulletType.java | 6 ++++++ core/src/mindustry/entities/comp/BulletComp.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index ee7278fa6a..177c7c5f9f 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; should this be true or not? */ + } + if(killShooter && b.owner() instanceof Healthc){ ((Healthc)b.owner()).kill(); } diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index ac831ef507..a2a584a063 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(collided.size >= type.pierceCap) { + remove(); + } } @Override From af5fd4551ceda4bc8e08ae961f78447f18b5c9e8 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Thu, 8 Oct 2020 19:18:53 -0700 Subject: [PATCH 2/7] true it is --- core/src/mindustry/entities/bullet/BulletType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 177c7c5f9f..9226f77820 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -238,7 +238,7 @@ public abstract class BulletType extends Content{ public void init(Bullet b){ if(pierceCap > 1) { pierce = true; - /** pierceBuilding = true; should this be true or not? */ + pierceBuilding = true; } if(killShooter && b.owner() instanceof Healthc){ From e73a813d693cbb4a854fa423ad39f368d9de1ef1 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Thu, 8 Oct 2020 19:27:01 -0700 Subject: [PATCH 3/7] prevent from breaking other things --- core/src/mindustry/entities/bullet/BulletType.java | 4 ++-- core/src/mindustry/entities/comp/BulletComp.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 9226f77820..0a6e6c38e7 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -25,7 +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 int pierceCap = -1; public Effect hitEffect, despawnEffect; /** Effect created when shooting. */ @@ -236,7 +236,7 @@ public abstract class BulletType extends Content{ } public void init(Bullet b){ - if(pierceCap > 1) { + if(pierceCap >= 1) { pierce = true; pierceBuilding = true; } diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index a2a584a063..4deb7cc9dc 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -145,7 +145,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw }); } - if(collided.size >= type.pierceCap) { + if(type.pierceCap != -1 && collided.size >= type.pierceCap) { remove(); } } From 637317f3a5fb4376795e3ee8c6dbf2fb5b38b4ab Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Fri, 9 Oct 2020 09:29:37 +0200 Subject: [PATCH 4/7] Add a yes command to the server console --- server/src/mindustry/server/ServerControl.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; } } From 1672c70c99046b056bc3776f25552d07d1a5b602 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Fri, 9 Oct 2020 10:07:56 +0200 Subject: [PATCH 5/7] Update BuildingComp.java --- core/src/mindustry/entities/comp/BuildingComp.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 6cc6827424..3cb8a944d7 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); } From f3473e78b4e6a44a404daeb1b2a8c77444c5321a Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Fri, 9 Oct 2020 10:10:34 +0200 Subject: [PATCH 6/7] Update Conduit.java --- core/src/mindustry/world/blocks/liquid/Conduit.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); From ae9093bfd68b3409f48f4602957c8a07beb2df1d Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Fri, 9 Oct 2020 10:10:50 +0200 Subject: [PATCH 7/7] Update ArmoredConduit.java --- core/src/mindustry/world/blocks/liquid/ArmoredConduit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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