From fdfe381b6eb7a2e9bfe13ab7a51214993e3b410a Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 12 Oct 2021 19:32:58 -0700 Subject: [PATCH] Unhardcode Drill Effect Randomness (#6144) * Unhardcode Drill Effect Randomness * I should start refusing to make prs for people --- core/src/mindustry/world/blocks/production/Drill.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index 407b2715d0..9ee6eb8e6d 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -46,6 +46,8 @@ public class Drill extends Block{ public boolean drawMineItem = true; /** Effect played when an item is produced. This is colored. */ public Effect drillEffect = Fx.mine; + /** Drill effect randomness. Block size by default. */ + public float drillEffectRnd = -1f; /** Speed the drill bit rotates at. */ public float rotateSpeed = 2f; /** Effect randomly played while drilling. */ @@ -73,6 +75,12 @@ public class Drill extends Block{ ambientSoundVolume = 0.018f; } + @Override + public void init(){ + super.init(); + if(drillEffectRnd < 0) drillEffectRnd = size; + } + @Override public void drawRequestConfigTop(BuildPlan req, Eachable list){ if(!req.worldContext) return; @@ -285,7 +293,7 @@ public class Drill extends Block{ progress %= delay; - drillEffect.at(x + Mathf.range(size), y + Mathf.range(size), dominantItem.color); + drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color); } }