From cd78fd63409a398c3bc462fa3e806345e366621b Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 12 May 2022 10:10:11 -0400 Subject: [PATCH] Misc bugfixes --- core/src/mindustry/content/UnitTypes.java | 1 - core/src/mindustry/world/Block.java | 2 ++ .../world/blocks/distribution/DirectionalUnloader.java | 1 + core/src/mindustry/world/blocks/distribution/Duct.java | 6 ++++-- .../src/mindustry/world/blocks/distribution/DuctBridge.java | 1 + core/src/mindustry/world/blocks/production/Drill.java | 2 +- 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 585fa38eac..85f3b8856c 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -684,7 +684,6 @@ public class UnitTypes{ hitSize = 15f; rotateSpeed = 3f; health = 1000; - immunities = ObjectSet.with(StatusEffects.burning, StatusEffects.melting); legCount = 6; legLength = 13f; legForwardScl = 0.8f; diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index a72e53d056..cf4ed7e7b3 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -90,6 +90,8 @@ public class Block extends UnlockableContent implements Senseable{ public boolean destructible; /** whether unloaders work on this block */ public boolean unloadable = true; + /** if true, this block acts a duct and will connect to armored ducts from the side. */ + public boolean isDuct = false; /** whether units can resupply by taking items from this block */ public boolean allowResupply = false; /** whether this is solid */ diff --git a/core/src/mindustry/world/blocks/distribution/DirectionalUnloader.java b/core/src/mindustry/world/blocks/distribution/DirectionalUnloader.java index b803006c68..5867f9b5d4 100644 --- a/core/src/mindustry/world/blocks/distribution/DirectionalUnloader.java +++ b/core/src/mindustry/world/blocks/distribution/DirectionalUnloader.java @@ -36,6 +36,7 @@ public class DirectionalUnloader extends Block{ itemCapacity = 0; noUpdateDisabled = true; unloadable = false; + isDuct = true; envDisabled = Env.none; clearOnDoubleTap = true; priority = TargetPriority.transport; diff --git a/core/src/mindustry/world/blocks/distribution/Duct.java b/core/src/mindustry/world/blocks/distribution/Duct.java index cdf6e68f70..735bf222b3 100644 --- a/core/src/mindustry/world/blocks/distribution/Duct.java +++ b/core/src/mindustry/world/blocks/distribution/Duct.java @@ -44,6 +44,7 @@ public class Duct extends Block implements Autotiler{ underBullets = true; rotate = true; noSideBlend = true; + isDuct = true; priority = TargetPriority.transport; envEnabled = Env.space | Env.terrestrial | Env.underwater; } @@ -74,7 +75,7 @@ public class Duct extends Block implements Autotiler{ return Point2.equals(tile.x + Geometry.d4(rotation).x, tile.y + Geometry.d4(rotation).y, otherx, othery) || ((!otherblock.rotatedOutput(otherx, othery) && Edges.getFacingEdge(otherblock, otherx, othery, tile) != null && Edges.getFacingEdge(otherblock, otherx, othery, tile).relativeTo(tile) == rotation) || - //basically the only change here is that it treats overflow ducts specially, since they're... weird + ((otherblock.rotatedOutput(otherx, othery)) && Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y))); } @@ -175,7 +176,8 @@ public class Duct extends Block implements Autotiler{ return current == null && items.total() == 0 && (armored ? //armored acceptance - ((source.block.rotate && source.front() == this && source.block.hasItems && (source.block instanceof Duct)) || Edges.getFacingEdge(source.tile(), tile).relativeTo(tile) == rotation) : + ((source.block.rotate && source.front() == this && source.block.hasItems && source.block.isDuct) || + Edges.getFacingEdge(source.tile(), tile).relativeTo(tile) == rotation) : //standard acceptance - do not accept from front !(source.block.rotate && next == source) && Math.abs(Edges.getFacingEdge(source.tile, tile).relativeTo(tile.x, tile.y) - rotation) != 2 ); diff --git a/core/src/mindustry/world/blocks/distribution/DuctBridge.java b/core/src/mindustry/world/blocks/distribution/DuctBridge.java index f47196d5f6..3e4c5a3b91 100644 --- a/core/src/mindustry/world/blocks/distribution/DuctBridge.java +++ b/core/src/mindustry/world/blocks/distribution/DuctBridge.java @@ -12,6 +12,7 @@ public class DuctBridge extends DirectionBridge{ itemCapacity = 4; hasItems = true; underBullets = true; + isDuct = true; } public class DuctBridgeBuild extends DirectionBridgeBuild{ diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index 537547ee8e..ca9b125839 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -160,7 +160,7 @@ public class Drill extends Block{ public void setStats(){ super.setStats(); - stats.add(Stat.drillTier, StatValues.blocks(b -> b instanceof Floor f && f.itemDrop != null && f.itemDrop.hardness <= tier && f.itemDrop != blockedItem)); + stats.add(Stat.drillTier, StatValues.blocks(b -> b instanceof Floor f && !f.wallOre && f.itemDrop != null && f.itemDrop.hardness <= tier && f.itemDrop != blockedItem)); stats.add(Stat.drillSpeed, 60f / drillTime * size * size, StatUnit.itemsSecond); if(liquidBoostIntensity != 1){