diff --git a/Mage.Sets/src/mage/cards/u/UntimelyMalfunction.java b/Mage.Sets/src/mage/cards/u/UntimelyMalfunction.java new file mode 100644 index 00000000000..67349e6ff21 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UntimelyMalfunction.java @@ -0,0 +1,53 @@ +package mage.cards.u; + +import mage.abilities.Mode; +import mage.abilities.effects.common.ChooseNewTargetsTargetEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.FilterSpell; +import mage.filter.predicate.other.NumberOfTargetsPredicate; +import mage.target.TargetSpell; +import mage.target.common.TargetArtifactPermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class UntimelyMalfunction extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("spell with a single target"); + + static { + filter.add(new NumberOfTargetsPredicate(1)); + } + + public UntimelyMalfunction(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); + + // Choose one -- + // * Destroy target artifact. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetArtifactPermanent()); + + // * Change the target of target spell or ability with a single target. + this.getSpellAbility().addMode(new Mode(new ChooseNewTargetsTargetEffect(true, true)).addTarget(new TargetSpell(filter))); + + // * One or two target creatures can't block this turn. + this.getSpellAbility().addMode(new Mode(new CantBlockTargetEffect(Duration.EndOfTurn)).addTarget(new TargetCreaturePermanent(1, 2))); + } + + private UntimelyMalfunction(final UntimelyMalfunction card) { + super(card); + } + + @Override + public UntimelyMalfunction copy() { + return new UntimelyMalfunction(this); + } +} diff --git a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java index e0dd41cda21..1ade7bd3c69 100644 --- a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java +++ b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java @@ -101,6 +101,7 @@ public final class DuskmournHouseOfHorror extends ExpansionSet { cards.add(new SetCardInfo("Trapped in the Screen", 36, Rarity.COMMON, mage.cards.t.TrappedInTheScreen.class)); cards.add(new SetCardInfo("Twitching Doll", 201, Rarity.RARE, mage.cards.t.TwitchingDoll.class)); cards.add(new SetCardInfo("Tyvar, the Pummeler", 202, Rarity.MYTHIC, mage.cards.t.TyvarThePummeler.class)); + cards.add(new SetCardInfo("Untimely Malfunction", 161, Rarity.UNCOMMON, mage.cards.u.UntimelyMalfunction.class)); cards.add(new SetCardInfo("Unwanted Remake", 39, Rarity.UNCOMMON, mage.cards.u.UnwantedRemake.class)); cards.add(new SetCardInfo("Unwilling Vessel", 81, Rarity.UNCOMMON, mage.cards.u.UnwillingVessel.class)); cards.add(new SetCardInfo("Valgavoth's Faithful", 121, Rarity.UNCOMMON, mage.cards.v.ValgavothsFaithful.class));