From 87d322c8e90508bc2e90b5cf6395cfbb98aa35d1 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 4 Apr 2020 21:44:05 -0400 Subject: [PATCH] Implemented Obscuring Haze --- Mage.Sets/src/mage/cards/o/ObscuringHaze.java | 43 +++++++++++++++++++ .../src/mage/sets/Commander2020Edition.java | 1 + 2 files changed, 44 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/o/ObscuringHaze.java diff --git a/Mage.Sets/src/mage/cards/o/ObscuringHaze.java b/Mage.Sets/src/mage/cards/o/ObscuringHaze.java new file mode 100644 index 0000000000..7d6c23596d --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/ObscuringHaze.java @@ -0,0 +1,43 @@ +package mage.cards.o; + +import mage.abilities.condition.common.ControlACommanderCondition; +import mage.abilities.costs.AlternativeCostSourceAbility; +import mage.abilities.effects.common.PreventAllDamageByAllObjectsEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.FilterObject; +import mage.filter.common.FilterOpponentsCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ObscuringHaze extends CardImpl { + + private static final FilterObject filter + = new FilterOpponentsCreaturePermanent("creatures your opponents control"); + + public ObscuringHaze(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}"); + + // If you control a commander, you may cast this spell without paying its mana cost. + this.addAbility(new AlternativeCostSourceAbility(null, ControlACommanderCondition.instance)); + + // Prevent all damage that would be dealt this turn by creatures your opponents control. + this.getSpellAbility().addEffect(new PreventAllDamageByAllObjectsEffect( + filter, Duration.EndOfTurn, false + )); + } + + private ObscuringHaze(final ObscuringHaze card) { + super(card); + } + + @Override + public ObscuringHaze copy() { + return new ObscuringHaze(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Commander2020Edition.java b/Mage.Sets/src/mage/sets/Commander2020Edition.java index 3edc9dca1b..6a9513bca8 100644 --- a/Mage.Sets/src/mage/sets/Commander2020Edition.java +++ b/Mage.Sets/src/mage/sets/Commander2020Edition.java @@ -33,6 +33,7 @@ public final class Commander2020Edition extends ExpansionSet { cards.add(new SetCardInfo("Lifecrafter's Bestiary", 244, Rarity.RARE, mage.cards.l.LifecraftersBestiary.class)); cards.add(new SetCardInfo("Masked Admirers", 163, Rarity.RARE, mage.cards.m.MaskedAdmirers.class)); cards.add(new SetCardInfo("Netherborn Altar", 45, Rarity.RARE, mage.cards.n.NetherbornAltar.class)); + cards.add(new SetCardInfo("Obscuring Haze", 61, Rarity.RARE, mage.cards.o.ObscuringHaze.class)); cards.add(new SetCardInfo("Otrimi, the Ever-Playful", 12, Rarity.COMMON, mage.cards.o.OtrimiTheEverPlayful.class)); cards.add(new SetCardInfo("Path of Ancestry", 298, Rarity.COMMON, mage.cards.p.PathOfAncestry.class)); cards.add(new SetCardInfo("Rashmi, Eternities Crafter", 229, Rarity.RARE, mage.cards.r.RashmiEternitiesCrafter.class));