diff --git a/Mage.Sets/src/mage/cards/n/NyleasIntervention.java b/Mage.Sets/src/mage/cards/n/NyleasIntervention.java new file mode 100644 index 0000000000..1fbe570745 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NyleasIntervention.java @@ -0,0 +1,84 @@ +package mage.cards.n; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.MultipliedValue; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.game.Game; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class NyleasIntervention extends CardImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + private static final DynamicValue xValue = new MultipliedValue(ManacostVariableValue.instance, 2); + + public NyleasIntervention(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{G}{G}"); + + // Choose one — + // • Search your library for up to X land cards, reveal them, put them into your hand, then shuffle your library. + this.getSpellAbility().addEffect(new NyleasInterventionEffect()); + + // • Nylea's Intervention deals twice X damage to each creature with flying. + this.getSpellAbility().addMode(new Mode(new DamageAllEffect(xValue, filter) + .setText("{this} deals twice X damage to each creature with flying"))); + } + + private NyleasIntervention(final NyleasIntervention card) { + super(card); + } + + @Override + public NyleasIntervention copy() { + return new NyleasIntervention(this); + } +} + +class NyleasInterventionEffect extends OneShotEffect { + + NyleasInterventionEffect() { + super(Outcome.Benefit); + staticText = "search your library for up to X land cards, " + + "reveal them, put them into your hand, then shuffle your library"; + } + + private NyleasInterventionEffect(final NyleasInterventionEffect effect) { + super(effect); + } + + @Override + public NyleasInterventionEffect copy() { + return new NyleasInterventionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int xValue = source.getManaCostsToPay().getX(); + return new SearchLibraryPutInHandEffect(new TargetCardInLibrary( + 0, xValue, StaticFilters.FILTER_CARD_LAND + ), true, true).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index ca8cf2dd72..552d524fbc 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -71,6 +71,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Mire's Grasp", 106, Rarity.COMMON, mage.cards.m.MiresGrasp.class)); cards.add(new SetCardInfo("Mountain", 253, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Nadir Kraken", 55, Rarity.RARE, mage.cards.n.NadirKraken.class)); + cards.add(new SetCardInfo("Nylea's Intervention", 188, Rarity.RARE, mage.cards.n.NyleasIntervention.class)); cards.add(new SetCardInfo("Nylea, Keen-Eyed", 185, Rarity.MYTHIC, mage.cards.n.NyleaKeenEyed.class)); cards.add(new SetCardInfo("Nyx Lotus", 235, Rarity.RARE, mage.cards.n.NyxLotus.class)); cards.add(new SetCardInfo("Nyxborn Colossus", 191, Rarity.COMMON, mage.cards.n.NyxbornColossus.class));