Implemented Archmage's Charms

This commit is contained in:
Evan Kranzler 2019-05-24 20:54:43 -04:00
parent 60eccf8e27
commit 12180ec7d0
2 changed files with 61 additions and 0 deletions

View file

@ -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);
}
}

View file

@ -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("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("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'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("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)); cards.add(new SetCardInfo("Battle Screech", 4, Rarity.UNCOMMON, mage.cards.b.BattleScreech.class));