From d6fc4bfdb12ee48d550527c296c5d7fab051684b Mon Sep 17 00:00:00 2001 From: BalaM314 <71201189+BalaM314@users.noreply.github.com> Date: Thu, 13 Oct 2022 22:42:03 +0530 Subject: [PATCH] Add Drill.drillEffectChance (for very fast drills) (#7704) --- core/src/mindustry/world/blocks/production/Drill.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index f57aaf9649..7992934ebb 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -50,6 +50,8 @@ public class Drill extends Block{ public Effect drillEffect = Fx.mine; /** Drill effect randomness. Block size by default. */ public float drillEffectRnd = -1f; + /** Chance of displaying the effect. Useful for extremely fast drills. */ + public float drillEffectChance = 1f; /** Speed the drill bit rotates at. */ public float rotateSpeed = 2f; /** Effect randomly played while drilling. */ @@ -306,7 +308,7 @@ public class Drill extends Block{ progress %= delay; - if(wasVisible) drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color); + if(wasVisible && Mathf.chanceDelta(updateEffectChance * warmup)) drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color); } }