[MOM] Implement Invasion of Arcavios / Invocation of the Founders

This commit is contained in:
theelk801 2023-04-19 08:37:12 -04:00
parent 33da1f1fe1
commit 64b39b07e2
3 changed files with 160 additions and 0 deletions

View file

@ -0,0 +1,80 @@
package mage.cards.i;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SiegeAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.WishEffect;
import mage.abilities.effects.common.search.SearchLibraryGraveyardPutInHandEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class InvasionOfArcavios extends CardImpl {
public InvasionOfArcavios(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.BATTLE}, "{3}{U}{U}");
this.subtype.add(SubType.SIEGE);
this.setStartingDefense(7);
this.secondSideCardClazz = mage.cards.i.InvocationOfTheFounders.class;
// (As a Siege enters, choose an opponent to protect it. You and others can attack it. When it's defeated, exile it, then cast it transformed.)
this.addAbility(new SiegeAbility());
// When Invasion of Arcavios enters the battlefield, search your library, graveyard, and/or outside the game for an instant or sorcery card you own, reveal it, and put it into your hand. If you search your library this way, shuffle.
this.addAbility(new EntersBattlefieldTriggeredAbility(new InvasionOfArcaviosEffect()));
}
private InvasionOfArcavios(final InvasionOfArcavios card) {
super(card);
}
@Override
public InvasionOfArcavios copy() {
return new InvasionOfArcavios(this);
}
}
class InvasionOfArcaviosEffect extends OneShotEffect {
InvasionOfArcaviosEffect() {
super(Outcome.Benefit);
staticText = "search your library, graveyard, and/or outside the game for an instant or sorcery card you own, " +
"reveal it, and put it into your hand. If you search your library this way, shuffle";
}
private InvasionOfArcaviosEffect(final InvasionOfArcaviosEffect effect) {
super(effect);
}
@Override
public InvasionOfArcaviosEffect copy() {
return new InvasionOfArcaviosEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
if (player.chooseUse(outcome, "Look outside the game?", source, game)
&& new WishEffect(StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY).apply(game, source)) {
return true;
}
return new SearchLibraryGraveyardPutInHandEffect(
StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, false
).apply(game, source);
}
}

View file

@ -0,0 +1,78 @@
package mage.cards.i;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.common.FilterInstantOrSorcerySpell;
import mage.filter.predicate.card.CastFromZonePredicate;
import mage.game.Game;
import mage.game.stack.Spell;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class InvocationOfTheFounders extends CardImpl {
private static final FilterSpell filter
= new FilterInstantOrSorcerySpell("an instant or sorcery spell from your hand");
static {
filter.add(new CastFromZonePredicate(Zone.HAND));
}
public InvocationOfTheFounders(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "");
this.color.setBlue(true);
this.nightCard = true;
// Whenever you cast an instant or sorcery spell from your hand, you may copy that spell. You may choose new targets for the copy.
this.addAbility(new SpellCastControllerTriggeredAbility(
new InvocationOfTheFoundersEffect(), filter, true
));
}
private InvocationOfTheFounders(final InvocationOfTheFounders card) {
super(card);
}
@Override
public InvocationOfTheFounders copy() {
return new InvocationOfTheFounders(this);
}
}
class InvocationOfTheFoundersEffect extends OneShotEffect {
InvocationOfTheFoundersEffect() {
super(Outcome.Benefit);
staticText = "copy that spell. You may choose new targets for the copy";
}
private InvocationOfTheFoundersEffect(final InvocationOfTheFoundersEffect effect) {
super(effect);
}
@Override
public InvocationOfTheFoundersEffect copy() {
return new InvocationOfTheFoundersEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Spell spell = (Spell) getValue("spellCast");
if (spell != null) {
spell.createCopyOnStack(game, source, source.getControllerId(), true);
return true;
}
return false;
}
}

View file

@ -168,6 +168,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Into the Fire", 144, Rarity.RARE, mage.cards.i.IntoTheFire.class));
cards.add(new SetCardInfo("Invasion of Alara", 230, Rarity.RARE, mage.cards.i.InvasionOfAlara.class));
cards.add(new SetCardInfo("Invasion of Amonkhet", 231, Rarity.UNCOMMON, mage.cards.i.InvasionOfAmonkhet.class));
cards.add(new SetCardInfo("Invasion of Arcavios", 61, Rarity.RARE, mage.cards.i.InvasionOfArcavios.class));
cards.add(new SetCardInfo("Invasion of Azgol", 232, Rarity.UNCOMMON, mage.cards.i.InvasionOfAzgol.class));
cards.add(new SetCardInfo("Invasion of Belenon", 20, Rarity.UNCOMMON, mage.cards.i.InvasionOfBelenon.class));
cards.add(new SetCardInfo("Invasion of Dominaria", 21, Rarity.UNCOMMON, mage.cards.i.InvasionOfDominaria.class));
@ -201,6 +202,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Invasion of Vryn", 64, Rarity.UNCOMMON, mage.cards.i.InvasionOfVryn.class));
cards.add(new SetCardInfo("Invasion of Xerex", 242, Rarity.UNCOMMON, mage.cards.i.InvasionOfXerex.class));
cards.add(new SetCardInfo("Invasion of Zendikar", 194, Rarity.UNCOMMON, mage.cards.i.InvasionOfZendikar.class));
cards.add(new SetCardInfo("Invocation of the Founders", 61, Rarity.RARE, mage.cards.i.InvocationOfTheFounders.class));
cards.add(new SetCardInfo("Iridescent Blademaster", 195, Rarity.COMMON, mage.cards.i.IridescentBlademaster.class));
cards.add(new SetCardInfo("Island", 278, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Jin-Gitaxias", 65, Rarity.MYTHIC, mage.cards.j.JinGitaxias.class));