From 9d8168dbf55469ed1485575b1a6f5288e218956e Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:03:07 -0800 Subject: [PATCH 01/12] Scorch effect --- .../world/blocks/power/PowerGenerator.java | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index 9b0ef63732..25754db127 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -38,6 +38,8 @@ public class PowerGenerator extends PowerDistributor{ public float explosionMinWarmup = 0f; public float explosionShake = 0f, explosionShakeDuration = 6f; + /** Size of scorch effect on the ground after explosion. Value from 1-9. < 1 to disable. */ + public int explosionScorchSize = 0; public PowerGenerator(String name){ super(name); @@ -120,25 +122,33 @@ public class PowerGenerator extends PowerDistributor{ public void createExplosion(){ if(shouldExplode()){ - if(explosionDamage > 0){ - Damage.damage(x, y, explosionRadius * tilesize, explosionDamage); - } + onExplosion(); + } + } - explodeEffect.at(this); - explodeSound.at(this); + public void onExplosion(){ + if(explosionDamage > 0){ + Damage.damage(x, y, explosionRadius * tilesize, explosionDamage); + } - if(explosionPuddleLiquid != null){ - for(int i = 0; i < explosionPuddles; i++){ - Tmp.v1.trns(Mathf.random(360f), Mathf.random(explosionPuddleRange)); - Tile tile = world.tileWorld(x + Tmp.v1.x, y + Tmp.v1.y); - Puddles.deposit(tile, explosionPuddleLiquid, explosionPuddleAmount); - } - } + explodeEffect.at(this); + explodeSound.at(this); - if(explosionShake > 0){ - Effect.shake(explosionShake, explosionShakeDuration, this); + if(explosionPuddleLiquid != null){ + for(int i = 0; i < explosionPuddles; i++){ + Tmp.v1.trns(Mathf.random(360f), Mathf.random(explosionPuddleRange)); + Tile tile = world.tileWorld(x + Tmp.v1.x, y + Tmp.v1.y); + Puddles.deposit(tile, explosionPuddleLiquid, explosionPuddleAmount); } } + + if(explosionShake > 0){ + Effect.shake(explosionShake, explosionShakeDuration, this); + } + + if(explosionScorchSize > 0){ + Effect.scorch(x, y, explosionScorchSize); + } } @Override From 515a3073d513c5f89251f2912bbdf3ddc408777e Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:10:46 -0800 Subject: [PATCH 02/12] Ignition --- .../world/blocks/power/PowerGenerator.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index 25754db127..6393f22b6f 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -4,9 +4,11 @@ import arc.*; import arc.audio.*; import arc.graphics.g2d.*; import arc.math.*; +import arc.math.geom.*; import arc.struct.*; import arc.util.*; import arc.util.io.*; +import mindustry.*; import mindustry.content.*; import mindustry.entities.*; import mindustry.entities.units.*; @@ -40,6 +42,10 @@ public class PowerGenerator extends PowerDistributor{ public float explosionShake = 0f, explosionShakeDuration = 6f; /** Size of scorch effect on the ground after explosion. Value from 1-9. < 1 to disable. */ public int explosionScorchSize = 0; + /** Chance for each tile in the explosion radius to catch on fire. */ + public float explosionIgnitionChance = 0f; + /** If true, the ignition chance decreases with distance. */ + public boolean explosionScaleIgnitionChance = true; public PowerGenerator(String name){ super(name); @@ -131,6 +137,15 @@ public class PowerGenerator extends PowerDistributor{ Damage.damage(x, y, explosionRadius * tilesize, explosionDamage); } + if(explosionIgnitionChance > 0){ + Geometry.circle(tileX(), tileY(), explosionRadius, (tx, ty) -> { + if(Mathf.chance(explosionIgnitionChance * + (explosionScaleIgnitionChance ? 1 - Mathf.dst(tileX(), tileY(), tx, ty) / explosionRadius : 1))){ + Fires.create(Vars.world.tile(tx, ty)); + } + }); + } + explodeEffect.at(this); explodeSound.at(this); From 5a3304d006d0df5900b32886e704e2b304a06e0b Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:21:25 -0800 Subject: [PATCH 03/12] Better chance scaling --- core/src/mindustry/world/blocks/power/PowerGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index 6393f22b6f..5cd70f4a0c 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -140,7 +140,7 @@ public class PowerGenerator extends PowerDistributor{ if(explosionIgnitionChance > 0){ Geometry.circle(tileX(), tileY(), explosionRadius, (tx, ty) -> { if(Mathf.chance(explosionIgnitionChance * - (explosionScaleIgnitionChance ? 1 - Mathf.dst(tileX(), tileY(), tx, ty) / explosionRadius : 1))){ + (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(Mathf.dst(tileX(), tileY(), tx, ty) / explosionRadius) : 1))){ Fires.create(Vars.world.tile(tx, ty)); } }); From 11e3f522b3e129eb0af492652ae5b410818b3c75 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:30:32 -0800 Subject: [PATCH 04/12] Apply to generators --- core/src/mindustry/content/Blocks.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index ae8f695ec0..7514036b7f 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2503,6 +2503,10 @@ public class Blocks{ ambientSoundVolume = 0.03f; generateEffect = Fx.generatespark; + explosionShake = 1f; + explosionScorchSize = 1; + explosionIgnitionChance = 0.1f; + consume(new ConsumeItemFlammable()); consume(new ConsumeItemExplode()); @@ -2532,6 +2536,10 @@ public class Blocks{ ambientSound = Sounds.smelter; ambientSoundVolume = 0.06f; + explosionShake = 1f; + explosionScorchSize = 2; + explosionIgnitionChance = 0.1f; + consume(new ConsumeItemFlammable()); consume(new ConsumeItemExplode()); @@ -2601,6 +2609,10 @@ public class Blocks{ powerProduction = 15f; heating = 0.02f; + explosionShake = 4f; + explosionScorchSize = 8; + explosionIgnitionChance = 0.5f; + consumeItem(Items.thorium); consumeLiquid(Liquids.cryofluid, heating / coolantPower).update(false); }}; From debae7c6a1aff288bbc618f2b1bb1d5c82bb02a8 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:32:15 -0800 Subject: [PATCH 05/12] Tiny radius, raise chance --- core/src/mindustry/content/Blocks.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 7514036b7f..f200c744c6 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2505,7 +2505,7 @@ public class Blocks{ explosionShake = 1f; explosionScorchSize = 1; - explosionIgnitionChance = 0.1f; + explosionIgnitionChance = 0.5f; consume(new ConsumeItemFlammable()); consume(new ConsumeItemExplode()); @@ -2538,7 +2538,7 @@ public class Blocks{ explosionShake = 1f; explosionScorchSize = 2; - explosionIgnitionChance = 0.1f; + explosionIgnitionChance = 0.5f; consume(new ConsumeItemFlammable()); consume(new ConsumeItemExplode()); From 9cafff14c68214ceb4b6bacbbe931e1cee5b557a Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:34:20 -0800 Subject: [PATCH 06/12] Less --- core/src/mindustry/content/Blocks.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index f200c744c6..ddcc2bbe6d 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2505,7 +2505,7 @@ public class Blocks{ explosionShake = 1f; explosionScorchSize = 1; - explosionIgnitionChance = 0.5f; + explosionIgnitionChance = 0.2f; consume(new ConsumeItemFlammable()); consume(new ConsumeItemExplode()); @@ -2538,7 +2538,7 @@ public class Blocks{ explosionShake = 1f; explosionScorchSize = 2; - explosionIgnitionChance = 0.5f; + explosionIgnitionChance = 0.2f; consume(new ConsumeItemFlammable()); consume(new ConsumeItemExplode()); From e87687ea04adb6a0a8f22dba9ae7257bc24a06b0 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:49:54 -0800 Subject: [PATCH 07/12] Break boulders --- .../world/blocks/power/PowerGenerator.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index 5cd70f4a0c..b073ef3480 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -17,6 +17,7 @@ import mindustry.graphics.*; import mindustry.type.*; import mindustry.ui.*; import mindustry.world.*; +import mindustry.world.blocks.*; import mindustry.world.draw.*; import mindustry.world.meta.*; @@ -137,14 +138,21 @@ public class PowerGenerator extends PowerDistributor{ Damage.damage(x, y, explosionRadius * tilesize, explosionDamage); } - if(explosionIgnitionChance > 0){ - Geometry.circle(tileX(), tileY(), explosionRadius, (tx, ty) -> { - if(Mathf.chance(explosionIgnitionChance * - (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(Mathf.dst(tileX(), tileY(), tx, ty) / explosionRadius) : 1))){ - Fires.create(Vars.world.tile(tx, ty)); - } - }); - } + Geometry.circle(tileX(), tileY(), explosionRadius, (tx, ty) -> { + Tile t = Vars.world.tile(tx, ty); + //Create fires + if(explosionIgnitionChance > 0){ + if(Mathf.chance(explosionIgnitionChance * + (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(Mathf.dst(tileX(), tileY(), tx, ty) / explosionRadius) : 1))){ + Fires.create(t); + } + } + + //Break boulders + if(t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator + ConstructBlock.deconstructFinish(t, t.block(), null); + } + }); explodeEffect.at(this); explodeSound.at(this); From 2a360a8113c945b185b18e929a960d695ae54e95 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 13:07:23 -0800 Subject: [PATCH 08/12] Explosion propagation time --- .../world/blocks/power/PowerGenerator.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index b073ef3480..c4942eeb50 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -43,6 +43,8 @@ public class PowerGenerator extends PowerDistributor{ public float explosionShake = 0f, explosionShakeDuration = 6f; /** Size of scorch effect on the ground after explosion. Value from 1-9. < 1 to disable. */ public int explosionScorchSize = 0; + /** The time for ignition and boulder breaking spread to reach max range. */ + public float explosionTime = 15f; /** Chance for each tile in the explosion radius to catch on fire. */ public float explosionIgnitionChance = 0f; /** If true, the ignition chance decreases with distance. */ @@ -140,18 +142,21 @@ public class PowerGenerator extends PowerDistributor{ Geometry.circle(tileX(), tileY(), explosionRadius, (tx, ty) -> { Tile t = Vars.world.tile(tx, ty); - //Create fires - if(explosionIgnitionChance > 0){ + float dst = Mathf.dst(tileX(), tileY(), tx, ty); + Time.run(dst / explosionRadius * explosionTime, () -> { + //Create fires + if(explosionIgnitionChance > 0){ if(Mathf.chance(explosionIgnitionChance * - (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(Mathf.dst(tileX(), tileY(), tx, ty) / explosionRadius) : 1))){ + (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(dst / explosionRadius) : 1))){ Fires.create(t); } - } + } - //Break boulders - if(t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator - ConstructBlock.deconstructFinish(t, t.block(), null); - } + //Break boulders + if(t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator + ConstructBlock.deconstructFinish(t, t.block(), null); + } + }); }); explodeEffect.at(this); From 30d02787a65cd5c603ee6e3a7e49f4068e6c3473 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 13:10:37 -0800 Subject: [PATCH 09/12] Slower default time, don't apply to boulders --- .../world/blocks/power/PowerGenerator.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index c4942eeb50..092a5ad77a 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -43,8 +43,8 @@ public class PowerGenerator extends PowerDistributor{ public float explosionShake = 0f, explosionShakeDuration = 6f; /** Size of scorch effect on the ground after explosion. Value from 1-9. < 1 to disable. */ public int explosionScorchSize = 0; - /** The time for ignition and boulder breaking spread to reach max range. */ - public float explosionTime = 15f; + /** The time for ignition spread to reach max range. */ + public float explosionTime = 60f; /** Chance for each tile in the explosion radius to catch on fire. */ public float explosionIgnitionChance = 0f; /** If true, the ignition chance decreases with distance. */ @@ -151,12 +151,12 @@ public class PowerGenerator extends PowerDistributor{ Fires.create(t); } } - - //Break boulders - if(t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator - ConstructBlock.deconstructFinish(t, t.block(), null); - } }); + + //Break boulders + if(t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator + ConstructBlock.deconstructFinish(t, t.block(), null); + } }); explodeEffect.at(this); From c02fba3719f4ad4f28f16774ea3cf7ca14666d93 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 16:49:02 -0800 Subject: [PATCH 10/12] Explosion time switched to speed, optimize fire spread --- .../world/blocks/power/PowerGenerator.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index 092a5ad77a..9429b27321 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -43,12 +43,12 @@ public class PowerGenerator extends PowerDistributor{ public float explosionShake = 0f, explosionShakeDuration = 6f; /** Size of scorch effect on the ground after explosion. Value from 1-9. < 1 to disable. */ public int explosionScorchSize = 0; - /** The time for ignition spread to reach max range. */ - public float explosionTime = 60f; /** Chance for each tile in the explosion radius to catch on fire. */ public float explosionIgnitionChance = 0f; /** If true, the ignition chance decreases with distance. */ public boolean explosionScaleIgnitionChance = true; + /** The speed at which ignition spreads. */ + public float explosionSpeed = 0.5f; public PowerGenerator(String name){ super(name); @@ -143,15 +143,16 @@ public class PowerGenerator extends PowerDistributor{ Geometry.circle(tileX(), tileY(), explosionRadius, (tx, ty) -> { Tile t = Vars.world.tile(tx, ty); float dst = Mathf.dst(tileX(), tileY(), tx, ty); - Time.run(dst / explosionRadius * explosionTime, () -> { - //Create fires - if(explosionIgnitionChance > 0){ - if(Mathf.chance(explosionIgnitionChance * - (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(dst / explosionRadius) : 1))){ - Fires.create(t); - } - } - }); + + //Create fires + if(explosionIgnitionChance > 0 && + Mathf.chance(explosionIgnitionChance * + (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(dst / explosionRadius) : 1)) + ){ + Time.run(dst / explosionSpeed, () -> { + Fires.create(t); + }); + } //Break boulders if(t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator From 947375ba52c60223fca2476ea90dcb9501fe2789 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 16:52:24 -0800 Subject: [PATCH 11/12] Option for breaking props --- core/src/mindustry/world/blocks/power/PowerGenerator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index 9429b27321..028a2739fe 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -41,6 +41,7 @@ public class PowerGenerator extends PowerDistributor{ public float explosionMinWarmup = 0f; public float explosionShake = 0f, explosionShakeDuration = 6f; + public boolean explosionBreaksProps = true; /** Size of scorch effect on the ground after explosion. Value from 1-9. < 1 to disable. */ public int explosionScorchSize = 0; /** Chance for each tile in the explosion radius to catch on fire. */ @@ -155,7 +156,7 @@ public class PowerGenerator extends PowerDistributor{ } //Break boulders - if(t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator + if(explosionBreaksProps && t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator ConstructBlock.deconstructFinish(t, t.block(), null); } }); From bb144185a12ed6797d0bfa507e9b6eab4fa84ce9 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 16:54:55 -0800 Subject: [PATCH 12/12] Skip propagation if unnecessary --- .../world/blocks/power/PowerGenerator.java | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index 028a2739fe..20d59c6f59 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -141,25 +141,27 @@ public class PowerGenerator extends PowerDistributor{ Damage.damage(x, y, explosionRadius * tilesize, explosionDamage); } - Geometry.circle(tileX(), tileY(), explosionRadius, (tx, ty) -> { - Tile t = Vars.world.tile(tx, ty); - float dst = Mathf.dst(tileX(), tileY(), tx, ty); + if(explosionIgnitionChance > 0 || explosionBreaksProps){ + Geometry.circle(tileX(), tileY(), explosionRadius, (tx, ty) -> { + Tile t = Vars.world.tile(tx, ty); + float dst = Mathf.dst(tileX(), tileY(), tx, ty); - //Create fires - if(explosionIgnitionChance > 0 && - Mathf.chance(explosionIgnitionChance * - (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(dst / explosionRadius) : 1)) - ){ - Time.run(dst / explosionSpeed, () -> { - Fires.create(t); - }); - } + //Create fires + if(explosionIgnitionChance > 0 && + Mathf.chance(explosionIgnitionChance * + (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(dst / explosionRadius) : 1)) + ){ + Time.run(dst / explosionSpeed, () -> { + Fires.create(t); + }); + } - //Break boulders - if(explosionBreaksProps && t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator - ConstructBlock.deconstructFinish(t, t.block(), null); - } - }); + //Break boulders + if(explosionBreaksProps && t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator + ConstructBlock.deconstructFinish(t, t.block(), null); + } + }); + } explodeEffect.at(this); explodeSound.at(this);