From 49221a1db47c3cde8fd8b50a11c42306b0f4ddc9 Mon Sep 17 00:00:00 2001 From: Elixias <61173114+LixieWulf@users.noreply.github.com> Date: Tue, 4 Feb 2025 11:45:20 -0700 Subject: [PATCH] Customizable death shake (#10375) --- core/src/mindustry/entities/comp/UnitComp.java | 2 +- core/src/mindustry/type/UnitType.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index ef479e2956..bfbb28c18e 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -695,7 +695,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I type.deathExplosionEffect.at(x, y, bounds() / 2f / 8f); } - float shake = hitSize / 3f; + float shake = type.deathShake < 0 ? hitSize / 3f : type.deathShake; if(type.createScorch){ Effect.scorch(x, y, (int)(hitSize / 5)); diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 5ddbbe7763..f70e3c807e 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -66,6 +66,8 @@ public class UnitType extends UnlockableContent implements Senseable{ accel = 0.5f, /** size of one side of the hitbox square */ hitSize = 6f, + /** shake on unit death */ + deathShake = -1f, /** shake on each step for leg/mech units */ stepShake = -1f, /** ripple / dust size for legged units */