diff --git a/Mage.Sets/src/mage/cards/b/BeginTheInvasion.java b/Mage.Sets/src/mage/cards/b/BeginTheInvasion.java new file mode 100644 index 0000000000..e396d38041 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BeginTheInvasion.java @@ -0,0 +1,68 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.target.common.TargetCardWithDifferentNameInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BeginTheInvasion extends CardImpl { + + public BeginTheInvasion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{W}{U}{B}{R}{G}"); + + // Search your library for up to X battle cards with different names, put them onto the battlefield, then shuffle. + this.getSpellAbility().addEffect(new BeginTheInvasionEffect()); + } + + private BeginTheInvasion(final BeginTheInvasion card) { + super(card); + } + + @Override + public BeginTheInvasion copy() { + return new BeginTheInvasion(this); + } +} + +class BeginTheInvasionEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("battle cards with different names"); + + static { + filter.add(CardType.BATTLE.getPredicate()); + } + + BeginTheInvasionEffect() { + super(Outcome.Benefit); + staticText = "search your library for up to X battle cards with different names, " + + "put them onto the battlefield, then shuffle"; + } + + private BeginTheInvasionEffect(final BeginTheInvasionEffect effect) { + super(effect); + } + + @Override + public BeginTheInvasionEffect copy() { + return new BeginTheInvasionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int xValue = source.getManaCostsToPay().getX(); + return new SearchLibraryPutInPlayEffect( + new TargetCardWithDifferentNameInLibrary(0, xValue, filter), false, true + ).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java b/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java index ade60be934..ddc220d0c1 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java @@ -44,6 +44,7 @@ public final class MarchOfTheMachineCommander extends ExpansionSet { cards.add(new SetCardInfo("Austere Command", 172, Rarity.RARE, mage.cards.a.AustereCommand.class)); cards.add(new SetCardInfo("Banisher Priest", 173, Rarity.UNCOMMON, mage.cards.b.BanisherPriest.class)); cards.add(new SetCardInfo("Battle Screech", 174, Rarity.UNCOMMON, mage.cards.b.BattleScreech.class)); + cards.add(new SetCardInfo("Begin the Invasion", 79, Rarity.MYTHIC, mage.cards.b.BeginTheInvasion.class)); cards.add(new SetCardInfo("Blade Splicer", 175, Rarity.RARE, mage.cards.b.BladeSplicer.class)); cards.add(new SetCardInfo("Bloodforged Battle-Axe", 349, Rarity.RARE, mage.cards.b.BloodforgedBattleAxe.class)); cards.add(new SetCardInfo("Bloodline Pretender", 350, Rarity.UNCOMMON, mage.cards.b.BloodlinePretender.class));