From e5d74cc10b02f165b1489e3a5264138a849eeb5a Mon Sep 17 00:00:00 2001 From: Mythril382 <77225817+Mythril382@users.noreply.github.com> Date: Sat, 1 Oct 2022 20:24:52 +0800 Subject: [PATCH] status effect applyEffect field for json (#7642) * field for json * another field * aaaaaaa --- core/src/mindustry/type/StatusEffect.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/type/StatusEffect.java b/core/src/mindustry/type/StatusEffect.java index 3b882c4b7b..d9aad9d90a 100644 --- a/core/src/mindustry/type/StatusEffect.java +++ b/core/src/mindustry/type/StatusEffect.java @@ -35,7 +35,7 @@ public class StatusEffect extends UnlockableContent{ public float damage; /** Chance of effect appearing. */ public float effectChance = 0.15f; - /** Should the effect be given a parent */ + /** Should the effect be given a parent. */ public boolean parentizeEffect; /** If true, the effect never disappears. */ public boolean permanent; @@ -47,6 +47,14 @@ public class StatusEffect extends UnlockableContent{ public Color color = Color.white.cpy(); /** Effect that happens randomly on top of the affected unit. */ public Effect effect = Fx.none; + /** Effect that is displayed once when applied to a unit. */ + public Effect applyEffect = Fx.none; + /** Whether the apply effect should display even if effect is already on the unit. */ + public boolean applyExtend; + /** Tint color of apply effect. */ + public Color applyColor = Color.white.cpy(); + /** Should the apply effect be given a parent. */ + public boolean parentizeApplyEffect; /** Affinity & opposite values for stat displays. */ public ObjectSet affinities = new ObjectSet<>(), opposites = new ObjectSet<>(); /** Set to false to disable outline generation. */ @@ -187,7 +195,9 @@ public class StatusEffect extends UnlockableContent{ return false; } - public void applied(Unit unit, float time, boolean extend){} + public void applied(Unit unit, float time, boolean extend){ + if(!extend || applyExtend) applyEffect.at(unit.x, unit.y, 0, applyColor, parentizeApplyEffect ? unit : null); + } @Override public void createIcons(MultiPacker packer){