From c52b966deadf592c05113df7c0246f6481bf5e43 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 24 Aug 2023 15:26:02 -0400 Subject: [PATCH] Different block explosion damage formula --- core/src/mindustry/entities/Damage.java | 3 ++- core/src/mindustry/entities/comp/BuildingComp.java | 2 +- core/src/mindustry/input/MobileInput.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 5c83b1a283..6056a9d6c1 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -94,11 +94,12 @@ public class Damage{ } int waves = explosiveness <= 2 ? 0 : Mathf.clamp((int)(explosiveness / 11), 1, 25); + float damagePerWave = Mathf.pow(explosiveness / 2f, 0.8f); for(int i = 0; i < waves; i++){ int f = i; Time.run(i * 2f, () -> { - damage(ignoreTeam, x, y, Mathf.clamp(radius + explosiveness, 0, 50f) * ((f + 1f) / waves), explosiveness / 2f, false); + damage(ignoreTeam, x, y, Mathf.clamp(radius + explosiveness, 0, 50f) * ((f + 1f) / waves), damagePerWave, false); Fx.blockExplosionSmoke.at(x + Mathf.range(radius), y + Mathf.range(radius)); }); } diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 4cda1271ba..8602e87f1a 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1374,7 +1374,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } //cap explosiveness so fluid tanks/vaults don't instakill units - Damage.dynamicExplosion(x, y, flammability, Math.min(explosiveness * 3.5f, 1000), power, tilesize * block.size / 2f, state.rules.damageExplosions, block.destroyEffect); + Damage.dynamicExplosion(x, y, flammability, explosiveness * 3.5f, power, tilesize * block.size / 2f, state.rules.damageExplosions, block.destroyEffect); if(block.createRubble && !floor().solid && !floor().isLiquid){ Effect.rubble(x, y, block.size); diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index 5551325616..a720406c44 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -415,7 +415,7 @@ public class MobileInput extends InputHandler implements GestureListener{ //draw last placed plan if(!plan.breaking && plan == lastPlaced && plan.block != null){ - int rot = plan.block.planRotation(rotation); + int rot = plan.block.planRotation(plan.rotation); boolean valid = validPlace(tile.x, tile.y, plan.block, rot); Draw.mixcol(); plan.block.drawPlace(tile.x, tile.y, rot, valid);