[MOC] Implement Begin the Invasion

This commit is contained in:
theelk801 2023-04-09 09:06:39 -04:00
parent 2ff2f69628
commit bc70bfc91e
2 changed files with 69 additions and 0 deletions

View file

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

View file

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