From 79ea2480cb82dce4fa7869968e6b4dc79d338eaf Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 10 Jan 2023 21:25:23 -0500 Subject: [PATCH] unitCrashDamage rule --- core/src/mindustry/entities/comp/UnitComp.java | 2 +- core/src/mindustry/game/Rules.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 8a68125f31..2d71e65f84 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -617,7 +617,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I } //if this unit crash landed (was flying), damage stuff in a radius - if(type.flying && !spawnedByCore && type.createWreck){ + if(type.flying && !spawnedByCore && type.createWreck && state.rules.unitCrashDamage){ Damage.damage(team, x, y, Mathf.pow(hitSize, 0.94f) * 1.25f, Mathf.pow(hitSize, 0.75f) * type.crashDamageMultiplier * 5f * state.rules.unitDamage(team), true, false, true); } diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 80c5146027..86db132969 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -51,6 +51,8 @@ public class Rules{ public boolean damageExplosions = true; /** Whether fire (and neoplasm spread) is enabled. */ public boolean fire = true; + /** Whether unit crash damage is enabled. */ + public boolean unitCrashDamage = true; /** Whether units use and require ammo. */ public boolean unitAmmo = false; /** EXPERIMENTAL! If true, blocks will update in units and share power. */