From 12180ec7d0af03cc96dcb1b09632c19d4182f78a Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 24 May 2019 20:54:43 -0400 Subject: [PATCH] Implemented Archmage's Charms --- .../src/mage/cards/a/ArchmagesCharm.java | 60 +++++++++++++++++++ Mage.Sets/src/mage/sets/ModernHorizons.java | 1 + 2 files changed, 61 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/ArchmagesCharm.java diff --git a/Mage.Sets/src/mage/cards/a/ArchmagesCharm.java b/Mage.Sets/src/mage/cards/a/ArchmagesCharm.java new file mode 100644 index 0000000000..20905a9a29 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArchmagesCharm.java @@ -0,0 +1,60 @@ +package mage.cards.a; + +import mage.abilities.Mode; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.DrawCardTargetEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Duration; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.target.TargetPermanent; +import mage.target.TargetPlayer; +import mage.target.TargetSpell; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ArchmagesCharm extends CardImpl { + + private static final FilterPermanent filter + = new FilterNonlandPermanent("nonland permanent with converted mana cost 1 or less"); + + static { + filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 2)); + } + + public ArchmagesCharm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{U}{U}"); + + // Choose one — + // • Counter target spell. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + + // • Target player draws two cards. + Mode mode = new Mode(new DrawCardTargetEffect(2)); + mode.addTarget(new TargetPlayer()); + this.getSpellAbility().addMode(mode); + + // • Gain control of target nonland permanent with converted mana cost 1 or less. + mode = new Mode(new GainControlTargetEffect(Duration.Custom, true)); + mode.addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addMode(mode); + } + + private ArchmagesCharm(final ArchmagesCharm card) { + super(card); + } + + @Override + public ArchmagesCharm copy() { + return new ArchmagesCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons.java b/Mage.Sets/src/mage/sets/ModernHorizons.java index a7fe8ee6c8..0c5ce46c47 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons.java @@ -28,6 +28,7 @@ public final class ModernHorizons extends ExpansionSet { cards.add(new SetCardInfo("Abominable Treefolk", 194, Rarity.UNCOMMON, mage.cards.a.AbominableTreefolk.class)); cards.add(new SetCardInfo("Altar of Dementia", 218, Rarity.RARE, mage.cards.a.AltarOfDementia.class)); + cards.add(new SetCardInfo("Archmage's Charm", 40, Rarity.RARE, mage.cards.a.ArchmagesCharm.class)); cards.add(new SetCardInfo("Ayula's Influence", 156, Rarity.RARE, mage.cards.a.AyulasInfluence.class)); cards.add(new SetCardInfo("Ayula, Queen Among Bears", 155, Rarity.RARE, mage.cards.a.AyulaQueenAmongBears.class)); cards.add(new SetCardInfo("Battle Screech", 4, Rarity.UNCOMMON, mage.cards.b.BattleScreech.class));