diff --git a/Mage.Sets/src/mage/cards/g/GandalfTheGrey.java b/Mage.Sets/src/mage/cards/g/GandalfTheGrey.java new file mode 100644 index 0000000000..1b2fad0f27 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GandalfTheGrey.java @@ -0,0 +1,73 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.CopyTargetSpellEffect; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.abilities.effects.common.PutOnLibrarySourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.constants.TargetController; +import mage.filter.FilterSpell; +import mage.filter.StaticFilters; +import mage.filter.common.FilterInstantOrSorcerySpell; +import mage.target.TargetPermanent; +import mage.target.TargetSpell; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GandalfTheGrey extends CardImpl { + + private static final FilterSpell filter + = new FilterInstantOrSorcerySpell("instant or sorcery spell you control"); + + static { + filter.add(TargetController.YOU.getControllerPredicate()); + } + + public GandalfTheGrey(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.AVATAR); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Whenever you cast an instant or sorcery spell, choose one that hasn't been chosen -- + // * You may tap or untap target permanent. + Ability ability = new SpellCastControllerTriggeredAbility( + new MayTapOrUntapTargetEffect(), StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false + ); + ability.addTarget(new TargetPermanent()); + ability.getModes().setEachModeOnlyOnce(true); + + // * Gandalf the Grey deals 3 damage to each opponent. + ability.addMode(new Mode(new DamagePlayersEffect(3, TargetController.OPPONENT))); + + // * Copy target instant or sorcery spell you control. You may choose new targets for the copy. + ability.addMode(new Mode(new CopyTargetSpellEffect()).addTarget(new TargetSpell(filter))); + + // * Put Gandalf on top of its owner's library. + ability.addMode(new Mode(new PutOnLibrarySourceEffect(true))); + this.addAbility(ability); + } + + private GandalfTheGrey(final GandalfTheGrey card) { + super(card); + } + + @Override + public GandalfTheGrey copy() { + return new GandalfTheGrey(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index ec021b5174..5bc7606a8f 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -20,6 +20,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Aragorn and Arwen, Wed", 287, Rarity.MYTHIC, mage.cards.a.AragornAndArwenWed.class)); cards.add(new SetCardInfo("Forest", 280, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); + cards.add(new SetCardInfo("Gandalf the Grey", 207, Rarity.RARE, mage.cards.g.GandalfTheGrey.class)); cards.add(new SetCardInfo("Island", 274, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Mountain", 278, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Plains", 272, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));