diff --git a/core/assets-raw/sprites/blocks/power/pressure-turbine-rotator-blur-green.png b/core/assets-raw/sprites/blocks/power/pressure-turbine-rotator-blur-green.png deleted file mode 100644 index 448225de08..0000000000 Binary files a/core/assets-raw/sprites/blocks/power/pressure-turbine-rotator-blur-green.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/production/electric-heater.png b/core/assets-raw/sprites/blocks/production/electric-heater.png new file mode 100644 index 0000000000..e90c2b62a8 Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/electric-heater.png differ diff --git a/core/assets-raw/sprites/blocks/production/slag-heater-heat.png b/core/assets-raw/sprites/blocks/production/eletric-heater-heat.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/slag-heater-heat.png rename to core/assets-raw/sprites/blocks/production/eletric-heater-heat.png diff --git a/core/assets-raw/sprites/blocks/production/slag-heater-bottom.png b/core/assets-raw/sprites/blocks/production/slag-heater-bottom.png deleted file mode 100644 index 16e718a939..0000000000 Binary files a/core/assets-raw/sprites/blocks/production/slag-heater-bottom.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/production/slag-heater.png b/core/assets-raw/sprites/blocks/production/slag-heater.png deleted file mode 100644 index d559a894d4..0000000000 Binary files a/core/assets-raw/sprites/blocks/production/slag-heater.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/production/vent-condenser-rotator-blur.png b/core/assets-raw/sprites/blocks/production/vent-condenser-rotator-blur.png new file mode 100644 index 0000000000..c0121f90bf Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/vent-condenser-rotator-blur.png differ diff --git a/core/assets-raw/sprites/blocks/production/vent-condenser-rotator.png b/core/assets-raw/sprites/blocks/production/vent-condenser-rotator.png new file mode 100644 index 0000000000..f9ec07df8b Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/vent-condenser-rotator.png differ diff --git a/core/assets-raw/sprites/blocks/production/vent-condenser.png b/core/assets-raw/sprites/blocks/production/vent-condenser.png new file mode 100644 index 0000000000..c663d14363 Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/vent-condenser.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/fracture/fracture-glow-heat.png b/core/assets-raw/sprites/blocks/turrets/fracture/fracture-glow-heat.png new file mode 100644 index 0000000000..8e58dcdf6d Binary files /dev/null and b/core/assets-raw/sprites/blocks/turrets/fracture/fracture-glow-heat.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/fracture/fracture-heat.png b/core/assets-raw/sprites/blocks/turrets/fracture/fracture-heat.png new file mode 100644 index 0000000000..07c199f4ac Binary files /dev/null and b/core/assets-raw/sprites/blocks/turrets/fracture/fracture-heat.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/fracture.png b/core/assets-raw/sprites/blocks/turrets/fracture/fracture.png similarity index 100% rename from core/assets-raw/sprites/blocks/turrets/fracture.png rename to core/assets-raw/sprites/blocks/turrets/fracture/fracture.png diff --git a/core/assets-raw/sprites/effects/square-shadow.png b/core/assets-raw/sprites/effects/square-shadow.png new file mode 100644 index 0000000000..035ab4abae Binary files /dev/null and b/core/assets-raw/sprites/effects/square-shadow.png differ diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index a41bca283a..6234b6f393 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -477,3 +477,6 @@ 63229=horde|block-horde-ui 63228=small-deconstructor|block-small-deconstructor-ui 63227=barrier-projector|block-barrier-projector-ui +63226=eletric-heater|block-eletric-heater-ui +63225=vent-condenser|block-vent-condenser-ui +63224=electric-heater|block-electric-heater-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index 9f8fb3668a..be4c828ec6 100644 Binary files a/core/assets/logicids.dat and b/core/assets/logicids.dat differ diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 2c972f0d9c..3657b1dd2f 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -64,8 +64,8 @@ public class Blocks{ melter, separator, disassembler, sporePress, pulverizer, incinerator, coalCentrifuge, //erekir - siliconArcFurnace, electrolyzer, oxidationChamber, atmosphericConcentrator, slagHeater, slagIncinerator, heatReactor, - carbideCrucible, slagCentrifuge, surgeCrucible, cyanogenSynthesizer, phaseSynthesizer, + siliconArcFurnace, electrolyzer, oxidationChamber, atmosphericConcentrator, electricHeater, slagIncinerator, + carbideCrucible, slagCentrifuge, surgeCrucible, cyanogenSynthesizer, phaseSynthesizer, heatReactor, cellSynthesisChamber, //sandbox @@ -104,7 +104,7 @@ public class Blocks{ //power - erekir //TODO rename chemicalCombustionChamber - turbineCondenser, chemicalCombustionChamber, pyrolysisGenerator, + turbineCondenser, ventCondenser, chemicalCombustionChamber, pyrolysisGenerator, beamNode, beamTower, //production @@ -1055,7 +1055,7 @@ public class Blocks{ outputItem = new ItemStack(Items.oxide, 1); - consumes.liquid(Liquids.ozone, 2f / 60f); + consumes.liquid(Liquids.ozone, 1f / 60f); consumes.item(Items.beryllium); consumes.power(1f); @@ -1069,15 +1069,13 @@ public class Blocks{ heatOutput = 5f; }}; - slagHeater = new HeatProducer("slag-heater"){{ + electricHeater = new HeatProducer("electric-heater"){{ requirements(Category.crafting, with(Items.tungsten, 30, Items.graphite, 30)); - drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.slag, 9f), new DrawHeatOutput(true)); - drawer.iconOverride = new String[]{"-bottom", ""}; + drawer = new DrawMulti(new DrawHeatOutput(true)); + drawer.iconOverride = new String[]{""}; size = 2; - craftTime = 60f * 1f; heatOutput = 2f; - consumes.liquid(Liquids.slag, 20f / 60f); consumes.power(0.5f / 60f); }}; @@ -1087,20 +1085,6 @@ public class Blocks{ consumes.liquid(Liquids.slag, 2f / 60f); }}; - heatReactor = new HeatProducer("heat-reactor"){{ - //TODO gas/liquid requirement? - requirements(Category.crafting, with(Items.oxide, 70, Items.graphite, 20, Items.carbide, 10, Items.thorium, 80)); - size = 3; - craftTime = 60f * 10f; - - craftEffect = new RadialEffect(Fx.heatReactorSmoke, 4, 90f, 7f); - - itemCapacity = 20; - consumes.item(Items.thorium, 3); - consumes.liquid(Liquids.nitrogen, 1f / 60f); - outputItem = new ItemStack(Items.fissileMatter, 1); - }}; - carbideCrucible = new HeatCrafter("carbide-crucible"){{ requirements(Category.crafting, with(Items.tungsten, 90, Items.thorium, 70, Items.oxide, 50)); craftEffect = Fx.none; @@ -1256,6 +1240,20 @@ public class Blocks{ consumes.power(8f); }}; + heatReactor = new HeatProducer("heat-reactor"){{ + //TODO gas/liquid requirement? + requirements(Category.crafting, with(Items.oxide, 70, Items.graphite, 20, Items.carbide, 10, Items.thorium, 80)); + size = 3; + craftTime = 60f * 10f; + + craftEffect = new RadialEffect(Fx.heatReactorSmoke, 4, 90f, 7f); + + itemCapacity = 20; + consumes.item(Items.thorium, 3); + consumes.liquid(Liquids.nitrogen, 1f / 60f); + outputItem = new ItemStack(Items.fissileMatter, 1); + }}; + //TODO needs to be completely redone from the ground up if(false) cellSynthesisChamber = new LiquidConverter("cell-synthesis-chamber"){{ @@ -2017,7 +2015,7 @@ public class Blocks{ spinSpeed = 0.6f; spinners = true; hasLiquids = true; - liquidOutput = new LiquidStack(Liquids.water, 10f / 60f / 9f); + outputLiquid = new LiquidStack(Liquids.water, 10f / 60f / 9f); liquidCapacity = 20f; }}; @@ -2132,23 +2130,6 @@ public class Blocks{ consumes.liquid(Liquids.water, 0.1f).boost(); }}; - //TODO should be crusher or something - impactDrill = new BurstDrill("impact-drill"){{ - requirements(Category.production, with(Items.silicon, 60, Items.beryllium, 90, Items.graphite, 50)); - drillTime = 60f * 12f; - size = 4; - hasPower = true; - tier = 6; - drillEffect = new MultiEffect(Fx.mineImpact, Fx.drillSteam); - shake = 4f; - itemCapacity = 40; - - consumes.power(3f); - consumes.liquid(Liquids.water, 0.2f); - }}; - - //TODO higher tier impact drill, 5x5 - waterExtractor = new SolidPump("water-extractor"){{ requirements(Category.production, with(Items.metaglass, 30, Items.graphite, 30, Items.lead, 30, Items.copper, 30)); result = Liquids.water; @@ -2200,6 +2181,31 @@ public class Blocks{ consumes.liquid(Liquids.water, 0.15f); }}; + //TODO output heat + ventCondenser = new AttributeCrafter("vent-condenser"){{ + requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 60)); + attribute = Attribute.vent; + displayEfficiencyScale = 1f / 9f; + minEfficiency = 9f - 0.0001f; + displayEfficiency = false; + craftEffect = Fx.turbinegenerate; + drawer = new DrawMulti(new DrawBlock(), new DrawRegion("-rotator-blur"){{ + spinSprite = true; + drawPlan = false; + rotateSpeed = 6f; + }}); + drawer.iconOverride = new String[]{"", "-rotator"}; + ignoreLiquidFullness = true; + craftTime = 30f; + size = 3; + ambientSound = Sounds.hum; + ambientSoundVolume = 0.06f; + hasLiquids = true; + outputLiquid = new LiquidStack(Liquids.water, 30f / 60f / 9f); + consumes.power(0.5f); + liquidCapacity = 20f; + }}; + cliffCrusher = new WallCrafter("cliff-crusher"){{ requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 20)); @@ -2236,6 +2242,23 @@ public class Blocks{ consumes.liquid(Liquids.hydrogen, 2f / 60f).boost(); }}; + //TODO should be crusher or something + impactDrill = new BurstDrill("impact-drill"){{ + requirements(Category.production, with(Items.silicon, 60, Items.beryllium, 90, Items.graphite, 50)); + drillTime = 60f * 12f; + size = 4; + hasPower = true; + tier = 6; + drillEffect = new MultiEffect(Fx.mineImpact, Fx.drillSteam); + shake = 4f; + itemCapacity = 40; + + consumes.power(3f); + consumes.liquid(Liquids.water, 0.2f); + }}; + + //TODO higher tier impact drill, 5x5 + //endregion //region storage @@ -2891,15 +2914,22 @@ public class Blocks{ consumes.liquid(Liquids.hydrogen, 1.5f / 60f); shots = 1; - //TODO cool reload animation - draw = new DrawTurret("reinforced-"); + draw = new DrawTurret("reinforced-"){{ + parts.addAll(new RegionPart("-glow"){{ + drawRegion = false; + heatColor = Color.valueOf("768a9a"); + useReload = false; + useProgressHeat = true; + }}); + }}; shootShake = 1f; - shootLength = 5f; + shootLength = 4f; outlineColor = Pal.darkOutline; size = 2; envEnabled |= Env.space; reloadTime = 25f; restitution = 0.1f; + cooldown = 0.04f; recoilAmount = 2.5f; range = 90; shootCone = 15f; diff --git a/core/src/mindustry/content/ErekirTechTree.java b/core/src/mindustry/content/ErekirTechTree.java index 984135db69..1d01dab76a 100644 --- a/core/src/mindustry/content/ErekirTechTree.java +++ b/core/src/mindustry/content/ErekirTechTree.java @@ -75,27 +75,29 @@ public class ErekirTechTree{ }); }); - node(siliconArcFurnace, () -> { - node(electrolyzer, () -> { - node(oxidationChamber, () -> { - node(atmosphericConcentrator, () -> { - node(cyanogenSynthesizer, () -> { + node(ventCondenser, () -> { + node(siliconArcFurnace, () -> { + node(electrolyzer, () -> { + node(oxidationChamber, () -> { + node(electricHeater, () -> { + node(atmosphericConcentrator, () -> { + node(cyanogenSynthesizer, () -> { - }); - }); + }); + }); - node(carbideCrucible, () -> { - node(surgeCrucible, () -> { - node(phaseSynthesizer, () -> { + node(carbideCrucible, () -> { + node(surgeCrucible, () -> { + node(phaseSynthesizer, () -> { + }); + }); }); }); }); - }); - node(slagIncinerator, () -> { - //when is this actually needed? - node(slagHeater, () -> { + node(slagIncinerator, () -> { + node(slagCentrifuge, () -> { }); diff --git a/core/src/mindustry/content/TechTree.java b/core/src/mindustry/content/TechTree.java index c77e786b32..0621e511d9 100644 --- a/core/src/mindustry/content/TechTree.java +++ b/core/src/mindustry/content/TechTree.java @@ -1,10 +1,12 @@ package mindustry.content; import arc.*; +import arc.scene.style.*; import arc.struct.*; import arc.util.*; import mindustry.ctype.*; import mindustry.game.Objectives.*; +import mindustry.gen.*; import mindustry.type.*; /** Class for storing a list of TechNodes with some utility tree builder methods; context dependent. See {@link SerpuloTechTree#load} source for example usage. */ @@ -75,6 +77,8 @@ public class TechTree{ public static class TechNode{ /** Depth in tech tree. */ public int depth; + /** Icon displayed in tech tree selector. */ + public @Nullable Drawable icon; /** Name for root node - used in tech tree selector. */ public @Nullable String name; /** Requirement node. */ @@ -111,6 +115,10 @@ public class TechTree{ all.add(this); } + public Drawable icon(){ + return icon == null ? Icon.tree : icon; + } + public String localizedName(){ return Core.bundle.get("techtree." + name); } diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 9b01e985ef..df994eac68 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -995,7 +995,7 @@ public class UnitTypes{ accel = 0.08f; drag = 0.016f; flying = true; - hitSize = 9f; + hitSize = 10f; targetAir = false; engineOffset = 7.8f; range = 140f; diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index c43b820824..f8a9e780a7 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -71,6 +71,7 @@ public class UnitType extends UnlockableContent{ public boolean createWreck = true; public boolean useUnitCap = true; public boolean destructibleWreck = true; + public boolean squareShadow = false; public float groundLayer = Layer.groundUnit; public float payloadCapacity = 8; public float aimDst = -1f; @@ -496,7 +497,13 @@ public class UnitType extends UnlockableContent{ legBaseRegion = Core.atlas.find(name + "-leg-base", name + "-leg"); baseRegion = Core.atlas.find(name + "-base"); cellRegion = Core.atlas.find(name + "-cell", Core.atlas.find("power-cell")); - softShadowRegion = Core.atlas.find("circle-shadow"); + //when linear filtering is on, it's acceptable to use the relatively low-res 'particle' region + softShadowRegion = + squareShadow ? Core.atlas.find("square-shadow") : + hitSize <= 10f || (Core.settings != null && Core.settings.getBool("linear", true)) ? + Core.atlas.find("particle") : + Core.atlas.find("circle-shadow"); + outlineRegion = Core.atlas.find(name + "-outline"); shadowRegion = fullIcon; diff --git a/core/src/mindustry/ui/dialogs/ResearchDialog.java b/core/src/mindustry/ui/dialogs/ResearchDialog.java index fab74aa679..7d3d095994 100644 --- a/core/src/mindustry/ui/dialogs/ResearchDialog.java +++ b/core/src/mindustry/ui/dialogs/ResearchDialog.java @@ -48,7 +48,7 @@ public class ResearchDialog extends BaseDialog{ titleTable.clear(); titleTable.button(b -> { //TODO custom icon here. - b.image(Icon.tree).padRight(8).size(iconMed); + b.imageDraw(() -> root.node.icon()).padRight(8).size(iconMed); b.add().growX(); b.label(() -> root.node.localizedName()).color(Pal.accent); b.add().growX(); diff --git a/core/src/mindustry/world/blocks/heat/HeatConductor.java b/core/src/mindustry/world/blocks/heat/HeatConductor.java new file mode 100644 index 0000000000..67d8f6a75e --- /dev/null +++ b/core/src/mindustry/world/blocks/heat/HeatConductor.java @@ -0,0 +1,80 @@ +package mindustry.world.blocks.heat; + +import arc.graphics.g2d.*; +import arc.util.*; +import mindustry.entities.units.*; +import mindustry.gen.*; +import mindustry.graphics.*; +import mindustry.ui.*; +import mindustry.world.*; +import mindustry.world.draw.*; + +public class HeatConductor extends Block{ + public float visualMaxHeat = 10f; + public DrawBlock drawer = new DrawBlock(); + + public HeatConductor(String name){ + super(name); + update = solid = rotate = true; + size = 3; + } + + @Override + public void setBars(){ + super.setBars(); + + bars.add("heat", (HeatConductorBuild entity) -> new Bar("bar.heat", Pal.lightOrange, () -> entity.heat / visualMaxHeat)); + } + + @Override + public void load(){ + super.load(); + + drawer.load(this); + } + + @Override + public void drawRequestRegion(BuildPlan plan, Eachable list){ + drawer.drawPlan(this, plan, list); + } + + @Override + public TextureRegion[] icons(){ + return drawer.finalIcons(this); + } + + public class HeatConductorBuild extends Building implements HeatBlock{ + public float heat = 0f; + + @Override + public void draw(){ + drawer.drawBase(this); + } + + @Override + public void drawLight(){ + super.drawLight(); + drawer.drawLights(this); + } + + @Override + public void updateTile(){ + heat = calculateHeat(null); + } + + @Override + public float warmup(){ + return heat; + } + + @Override + public float heat(){ + return heat; + } + + @Override + public float heatFrac(){ + return heat / visualMaxHeat; + } + } +} diff --git a/core/src/mindustry/world/blocks/power/ThermalGenerator.java b/core/src/mindustry/world/blocks/power/ThermalGenerator.java index bb653323a3..422093d700 100644 --- a/core/src/mindustry/world/blocks/power/ThermalGenerator.java +++ b/core/src/mindustry/world/blocks/power/ThermalGenerator.java @@ -22,7 +22,7 @@ public class ThermalGenerator extends PowerGenerator{ public float displayEfficiencyScale = 1f; public boolean spinners = false; public boolean displayEfficiency = true; - public @Nullable LiquidStack liquidOutput; + public @Nullable LiquidStack outputLiquid; public Attribute attribute = Attribute.heat; public @Load("@-rotator") TextureRegion rotatorRegion; @@ -34,7 +34,7 @@ public class ThermalGenerator extends PowerGenerator{ @Override public void init(){ - if(liquidOutput != null){ + if(outputLiquid != null){ outputsLiquid = true; hasLiquids = true; } @@ -49,8 +49,8 @@ public class ThermalGenerator extends PowerGenerator{ stats.add(Stat.tiles, attribute, floating, size * size * displayEfficiencyScale, !displayEfficiency); - if(liquidOutput != null){ - stats.add(Stat.output, StatValues.liquid(liquidOutput.liquid, liquidOutput.amount * size * size * 60f, true)); + if(outputLiquid != null){ + stats.add(Stat.output, StatValues.liquid(outputLiquid.liquid, outputLiquid.amount * size * size * 60f, true)); } } @@ -88,10 +88,10 @@ public class ThermalGenerator extends PowerGenerator{ spinRotation += productionEfficiency * spinSpeed; - if(liquidOutput != null){ - float added = Math.min(productionEfficiency * delta() * liquidOutput.amount, liquidCapacity - liquids.get(liquidOutput.liquid)); - liquids.add(liquidOutput.liquid, added); - dumpLiquid(liquidOutput.liquid); + if(outputLiquid != null){ + float added = Math.min(productionEfficiency * delta() * outputLiquid.amount, liquidCapacity - liquids.get(outputLiquid.liquid)); + liquids.add(outputLiquid.liquid, added); + dumpLiquid(outputLiquid.liquid); } } diff --git a/core/src/mindustry/world/blocks/production/AttributeCrafter.java b/core/src/mindustry/world/blocks/production/AttributeCrafter.java index e11ba156ed..17a98870f6 100644 --- a/core/src/mindustry/world/blocks/production/AttributeCrafter.java +++ b/core/src/mindustry/world/blocks/production/AttributeCrafter.java @@ -1,8 +1,10 @@ package mindustry.world.blocks.production; import arc.*; +import mindustry.game.*; import mindustry.graphics.*; import mindustry.ui.*; +import mindustry.world.*; import mindustry.world.meta.*; /** A crafter that gains efficiency from attribute tiles. */ @@ -11,6 +13,9 @@ public class AttributeCrafter extends GenericCrafter{ public float baseEfficiency = 1f; public float boostScale = 1f; public float maxBoost = 1f; + public float minEfficiency = -1f; + public float displayEfficiencyScale = 1f; + public boolean displayEfficiency = true; public AttributeCrafter(String name){ super(name); @@ -18,6 +23,10 @@ public class AttributeCrafter extends GenericCrafter{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ + super.drawPlace(x, y, rotation, valid); + + if(!displayEfficiency) return; + drawPlaceText(Core.bundle.format("bar.efficiency", (int)((baseEfficiency + Math.min(maxBoost, boostScale * sumAttribute(attribute, x, y))) * 100f)), x, y, valid); } @@ -28,11 +37,17 @@ public class AttributeCrafter extends GenericCrafter{ bars.add("efficiency", (AttributeCrafterBuild entity) -> new Bar(() -> - Core.bundle.format("bar.efficiency", (int)(entity.efficiencyScale() * 100)), + Core.bundle.format("bar.efficiency", (int)(entity.efficiencyScale() * 100 * displayEfficiencyScale)), () -> Pal.lightOrange, entity::efficiencyScale)); } + @Override + public boolean canPlaceOn(Tile tile, Team team, int rotation){ + //make sure there's enough efficiency at this location + return tile.getLinkedTilesAs(this, tempTiles).sumf(other -> other.floor().attributes.get(attribute)) > minEfficiency; + } + @Override public void setStats(){ super.setStats(); diff --git a/core/src/mindustry/world/blocks/production/GenericCrafter.java b/core/src/mindustry/world/blocks/production/GenericCrafter.java index 91599aa142..f04bbf1314 100644 --- a/core/src/mindustry/world/blocks/production/GenericCrafter.java +++ b/core/src/mindustry/world/blocks/production/GenericCrafter.java @@ -30,6 +30,7 @@ public class GenericCrafter extends Block{ /** if true, crafters with multiple liquid outputs will dump excess when there's still space for at least one liquid type */ public boolean dumpExtraLiquid = true; + public boolean ignoreLiquidFullness = false; public float craftTime = 80; public Effect craftEffect = Fx.none; public Effect updateEffect = Fx.none; @@ -115,10 +116,6 @@ public class GenericCrafter extends Block{ super.init(); } - public void drawPlanBase(BuildPlan req, Eachable list){ - super.drawRequestRegion(req, list); - } - @Override public void drawRequestRegion(BuildPlan plan, Eachable list){ drawer.drawPlan(this, plan, list); @@ -164,7 +161,7 @@ public class GenericCrafter extends Block{ } } } - if(outputLiquids != null){ + if(outputLiquids != null && !ignoreLiquidFullness){ boolean allFull = true; for(var output : outputLiquids){ if(liquids.get(output.liquid) >= liquidCapacity - 0.001f){ diff --git a/core/src/mindustry/world/draw/DrawRegion.java b/core/src/mindustry/world/draw/DrawRegion.java index b575cac450..d7b4b0aabb 100644 --- a/core/src/mindustry/world/draw/DrawRegion.java +++ b/core/src/mindustry/world/draw/DrawRegion.java @@ -13,6 +13,7 @@ public class DrawRegion extends DrawBlock{ public TextureRegion region; public String suffix = ""; public boolean spinSprite = false; + public boolean drawPlan = true; public float rotateSpeed, x, y; /** Any number <=0 disables layer changes. */ public float layer = -1; @@ -38,6 +39,7 @@ public class DrawRegion extends DrawBlock{ @Override public void drawPlan(Block block, BuildPlan plan, Eachable list){ + if(!drawPlan) return; Draw.rect(region, plan.drawx(), plan.drawy()); } diff --git a/core/src/mindustry/world/draw/DrawTurret.java b/core/src/mindustry/world/draw/DrawTurret.java index b4abef4048..d1c54930b0 100644 --- a/core/src/mindustry/world/draw/DrawTurret.java +++ b/core/src/mindustry/world/draw/DrawTurret.java @@ -168,6 +168,7 @@ public class DrawTurret extends DrawBlock{ progress = interp.apply(progress); for(int i = 0; i < regions.length; i++){ + //can be null if drawRegion == false var region = regions[i]; float sign = i == 1 ? -1 : 1; Tmp.v1.set((x + moveX * progress) * sign, y + moveY * progress).rotate((build.rotation - 90)); @@ -218,6 +219,8 @@ public class DrawTurret extends DrawBlock{ regions = new TextureRegion[]{Core.atlas.find(block.name + suffix)}; outlines = new TextureRegion[]{Core.atlas.find(block.name + suffix + "-outline")}; } + }else{ + regions = new TextureRegion[1]; } heat = Core.atlas.find(block.name + suffix + "-heat");