Generator explosion tweaks

This commit is contained in:
Anuken
2026-08-31 21:08:01 -04:00
parent e386a2c85b
commit 06d527a7ca
2 changed files with 14 additions and 3 deletions
+3 -2
View File
@@ -2529,7 +2529,7 @@ public class Blocks{
explosionShake = 1f;
explosionScorchSize = 1;
explosionIgnitionChance = 0.2f;
explosionFireballs = 3;
consume(new ConsumeItemFlammable());
consume(new ConsumeItemExplode());
@@ -2563,7 +2563,7 @@ public class Blocks{
explosionShake = 1f;
explosionScorchSize = 2;
explosionIgnitionChance = 0.2f;
explosionFireballs = 6;
consume(new ConsumeItemFlammable());
consume(new ConsumeItemExplode());
@@ -2639,6 +2639,7 @@ public class Blocks{
explosionShake = 4f;
explosionScorchSize = 8;
explosionIgnitionChance = 0.5f;
explosionFireballs = 11;
consumeItem(Items.thorium);
consumeLiquid(Liquids.cryofluid, heating / coolantPower).update(false);
@@ -12,6 +12,7 @@ import mindustry.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.entities.units.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
@@ -49,7 +50,9 @@ public class PowerGenerator extends PowerDistributor{
/** If true, the ignition chance decreases with distance. */
public boolean explosionScaleIgnitionChance = true;
/** The speed at which ignition spreads. */
public float explosionSpeed = 0.5f;
public float explosionSpeed = 0.4f;
/** Extra number of fireballs spawned from explosions. */
public int explosionFireballs = 0;
public PowerGenerator(String name){
super(name);
@@ -163,6 +166,13 @@ public class PowerGenerator extends PowerDistributor{
});
}
if(explosionFireballs > 0){
int amount = Mathf.random(1, explosionFireballs);
for(int i = 0; i < amount; i++){
Bullets.fireball.createNet(Team.derelict, x, y, Mathf.random(360f), -1f, Mathf.random(0.5f, 1f), 1);
}
}
explodeEffect.at(this);
explodeSound.at(this);