From 8b5cf5309a883527e9f5bb31cc449aeb0660a190 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 24 Jan 2021 15:22:41 -0500 Subject: [PATCH] Reactive effect flag --- core/src/mindustry/content/StatusEffects.java | 2 ++ core/src/mindustry/entities/comp/StatusComp.java | 10 ++++++---- core/src/mindustry/type/StatusEffect.java | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/content/StatusEffects.java b/core/src/mindustry/content/StatusEffects.java index e7c55055c2..fffdee4018 100644 --- a/core/src/mindustry/content/StatusEffects.java +++ b/core/src/mindustry/content/StatusEffects.java @@ -161,10 +161,12 @@ public class StatusEffects implements ContentList{ shocked = new StatusEffect("shocked"){{ color = Pal.lancerLaser; + reactive = true; }}; blasted = new StatusEffect("blasted"){{ color = Color.valueOf("ff795e"); + reactive = true; }}; corroded = new StatusEffect("corroded"){{ diff --git a/core/src/mindustry/entities/comp/StatusComp.java b/core/src/mindustry/entities/comp/StatusComp.java index feda4c73e0..744da3b386 100644 --- a/core/src/mindustry/entities/comp/StatusComp.java +++ b/core/src/mindustry/entities/comp/StatusComp.java @@ -55,10 +55,12 @@ abstract class StatusComp implements Posc, Flyingc{ } } - //otherwise, no opposites found, add direct effect - StatusEntry entry = Pools.obtain(StatusEntry.class, StatusEntry::new); - entry.set(effect, duration); - statuses.add(entry); + if(!effect.reactive){ + //otherwise, no opposites found, add direct effect + StatusEntry entry = Pools.obtain(StatusEntry.class, StatusEntry::new); + entry.set(effect, duration); + statuses.add(entry); + } } void clearStatuses(){ diff --git a/core/src/mindustry/type/StatusEffect.java b/core/src/mindustry/type/StatusEffect.java index d5b5489e02..19e0135960 100644 --- a/core/src/mindustry/type/StatusEffect.java +++ b/core/src/mindustry/type/StatusEffect.java @@ -25,6 +25,8 @@ public class StatusEffect extends MappableContent{ public float effectChance = 0.15f; /** If true, the effect never disappears. */ public boolean permanent; + /** If true, this effect will only react with other effects and cannot be applied. */ + public boolean reactive; /** Tint color of effect. */ public Color color = Color.white.cpy(); /** Effect that happens randomly on top of the affected unit. */