From 16a1483f55a6ea8a92809f193a8eea903ee3333a Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Sat, 18 Apr 2020 13:28:32 +0200 Subject: [PATCH] Require 4 loading docks to saturate a belt Which encourages using them right from the factory, instead of simply connecting it up to a full titanium belt. --- core/src/mindustry/content/Blocks.java | 1 + .../world/blocks/distribution/CraterConveyor.java | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 46c0095133..d70b71e33c 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -914,6 +914,7 @@ public class Blocks implements ContentList{ requirements(Category.distribution, ItemStack.with(Items.plastanium, 1, Items.silicon, 1, Items.graphite, 1)); health = 75; speed = 0.04f; + recharge = 4f; }}; armoredConveyor = new ArmoredConveyor("armored-conveyor"){{ diff --git a/core/src/mindustry/world/blocks/distribution/CraterConveyor.java b/core/src/mindustry/world/blocks/distribution/CraterConveyor.java index 4129a0125b..eddfb2d583 100644 --- a/core/src/mindustry/world/blocks/distribution/CraterConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/CraterConveyor.java @@ -22,6 +22,7 @@ public class CraterConveyor extends Block implements Autotiler{ private TextureRegion[] regions = new TextureRegion[8]; public float speed = 0f; + public float recharge = 4f; public CraterConveyor(String name){ super(name); @@ -114,7 +115,7 @@ public class CraterConveyor extends Block implements Autotiler{ @Override public void updateTile(){ // reel in crater - if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed, 0f, 1f); + if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed, 0f, recharge); // sleep when idle if(link == -1){ @@ -147,7 +148,8 @@ public class CraterConveyor extends Block implements Autotiler{ link = -1; items.clear(); - e.cooldown = cooldown = 1; + cooldown = recharge; + e.cooldown = 1; e.noSleep(); bump(); } @@ -258,7 +260,7 @@ public class CraterConveyor extends Block implements Autotiler{ @Override public boolean acceptItem(Tilec source, Item item){ if (this == source) return true; // player threw items - if (cooldown > 0f) return false; // still cooling down + if (cooldown > recharge - 1f) return false; // still cooling down return!((blendbit2 != 5) // not a loading dock || (items.total() > 0 && !items.has(item)) // incompatible items || (items.total() >= getMaximumAccepted(item)) // filled to capacity