From b60acf2c37ec9f429d7daf957f2443b1cb40cfb7 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 21 Sep 2021 05:36:34 -0700 Subject: [PATCH] Option to parentize status effect effects (#6030) --- core/src/mindustry/type/StatusEffect.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/type/StatusEffect.java b/core/src/mindustry/type/StatusEffect.java index 20d5b1809e..837c08b276 100644 --- a/core/src/mindustry/type/StatusEffect.java +++ b/core/src/mindustry/type/StatusEffect.java @@ -33,6 +33,8 @@ public class StatusEffect extends UnlockableContent{ public float damage; /** Chance of effect appearing. */ public float effectChance = 0.15f; + /** Should the effect be given a parent */ + public boolean parentizeEffect; /** If true, the effect never disappears. */ public boolean permanent; /** If true, this effect will only react with other effects and cannot be applied. */ @@ -120,7 +122,7 @@ public class StatusEffect extends UnlockableContent{ if(effect != Fx.none && Mathf.chanceDelta(effectChance)){ Tmp.v1.rnd(Mathf.range(unit.type.hitSize/2f)); - effect.at(unit.x + Tmp.v1.x, unit.y + Tmp.v1.y, color); + effect.at(unit.x + Tmp.v1.x, unit.y + Tmp.v1.y, 0, color, parentizeEffect ? unit : null); } }