diff --git a/Mage.Sets/src/mage/cards/m/Mulch.java b/Mage.Sets/src/mage/cards/m/Mulch.java index 72f1556ddd5..79e10a616d8 100644 --- a/Mage.Sets/src/mage/cards/m/Mulch.java +++ b/Mage.Sets/src/mage/cards/m/Mulch.java @@ -1,16 +1,15 @@ - package mage.cards.m; -import java.util.UUID; import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterLandCard; +import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author North */ public final class Mulch extends CardImpl { @@ -19,7 +18,9 @@ public final class Mulch extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}"); // Reveal the top four cards of your library. Put all land cards revealed this way into your hand and the rest into your graveyard. - this.getSpellAbility().addEffect(new RevealLibraryPutIntoHandEffect(4, new FilterLandCard("land cards"), Zone.GRAVEYARD)); + this.getSpellAbility().addEffect(new RevealLibraryPutIntoHandEffect( + 4, StaticFilters.FILTER_CARD_LANDS, Zone.GRAVEYARD + )); } private Mulch(final Mulch card) { diff --git a/Mage.Sets/src/mage/cards/w/WrennAndSeven.java b/Mage.Sets/src/mage/cards/w/WrennAndSeven.java new file mode 100644 index 00000000000..90f8c76a749 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WrennAndSeven.java @@ -0,0 +1,122 @@ +package mage.cards.w; + +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.CardsImpl; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.command.emblems.WrennAndSevenEmblem; +import mage.game.permanent.token.WrennAndSevenToken; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class WrennAndSeven extends CardImpl { + + public WrennAndSeven(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{G}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.WRENN); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); + + // +1: Reveal the top four cards of your library. Put all land cards revealed this way into your hand and the rest into your graveyard. + this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect( + 4, StaticFilters.FILTER_CARD_LANDS, Zone.GRAVEYARD + ), 1)); + + // 0: Put any number of land cards from your hand onto the battlefield tapped. + this.addAbility(new LoyaltyAbility(new WrennAndSevenLandEffect())); + + // −3: Create a green Treefolk creature token with reach and "This creature's power and toughness are each equal to the number of lands you control." + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new WrennAndSevenToken()), -3)); + + // −8: Return all permanent cards from your graveyard to your hand. You get an emblem with "You have no maximum hand size." + Ability ability = new LoyaltyAbility(new WrennAndSevenReturnEffect(), -8); + ability.addEffect(new GetEmblemEffect(new WrennAndSevenEmblem())); + this.addAbility(ability); + } + + private WrennAndSeven(final WrennAndSeven card) { + super(card); + } + + @Override + public WrennAndSeven copy() { + return new WrennAndSeven(this); + } +} + +class WrennAndSevenLandEffect extends OneShotEffect { + + WrennAndSevenLandEffect() { + super(Outcome.PutLandInPlay); + staticText = "put any number of land cards from your hand onto the battlefield tapped"; + } + + private WrennAndSevenLandEffect(final WrennAndSevenLandEffect effect) { + super(effect); + } + + @Override + public WrennAndSevenLandEffect copy() { + return new WrennAndSevenLandEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null || player.getHand().count(StaticFilters.FILTER_CARD_LAND, game) < 1) { + return false; + } + TargetCardInHand target = new TargetCardInHand( + 0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_LANDS + ); + player.choose(outcome, player.getHand(), target, game); + return player.moveCards( + new CardsImpl(target.getTargets()).getCards(game), + Zone.BATTLEFIELD, source, game, true, + false, true, null + ); + } +} + +class WrennAndSevenReturnEffect extends OneShotEffect { + + WrennAndSevenReturnEffect() { + super(Outcome.Benefit); + staticText = "return all permanent cards from your graveyard to your hand."; + } + + private WrennAndSevenReturnEffect(final WrennAndSevenReturnEffect effect) { + super(effect); + } + + @Override + public WrennAndSevenReturnEffect copy() { + return new WrennAndSevenReturnEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + return player.moveCards(player.getGraveyard().getCards( + StaticFilters.FILTER_CARD_PERMANENT, game + ), Zone.HAND, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index 22bb4ad59d6..cf3f793167b 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -38,5 +38,6 @@ public final class InnistradMidnightHunt extends ExpansionSet { cards.add(new SetCardInfo("Play with Fire", 154, Rarity.UNCOMMON, mage.cards.p.PlayWithFire.class)); cards.add(new SetCardInfo("Swamp", 272, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Triskaidekaphile", 81, Rarity.RARE, mage.cards.t.Triskaidekaphile.class)); + cards.add(new SetCardInfo("Wrenn and Seven", 208, Rarity.MYTHIC, mage.cards.w.WrennAndSeven.class)); } } diff --git a/Mage/src/main/java/mage/game/command/emblems/WrennAndSevenEmblem.java b/Mage/src/main/java/mage/game/command/emblems/WrennAndSevenEmblem.java new file mode 100644 index 00000000000..c3af13d8411 --- /dev/null +++ b/Mage/src/main/java/mage/game/command/emblems/WrennAndSevenEmblem.java @@ -0,0 +1,21 @@ +package mage.game.command.emblems; + +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.game.command.Emblem; + +/** + * @author TheElk801 + */ +public final class WrennAndSevenEmblem extends Emblem { + + // You get an emblem with "You have no maximum hand size." + public WrennAndSevenEmblem() { + this.setName("Emblem Wrenn"); + this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, new MaximumHandSizeControllerEffect( + Integer.MAX_VALUE, Duration.WhileOnBattlefield, MaximumHandSizeControllerEffect.HandSizeModification.SET + ))); + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/DogIllusionToken.java b/Mage/src/main/java/mage/game/permanent/token/DogIllusionToken.java index 8bbb5f561af..2340fbf2ca6 100644 --- a/Mage/src/main/java/mage/game/permanent/token/DogIllusionToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/DogIllusionToken.java @@ -29,7 +29,7 @@ public final class DogIllusionToken extends TokenImpl { toughness = new MageInt(0); addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( DogIllusionValue.instance, Duration.EndOfGame) - .setText("{this}'s power and toughness are each equal to twice the number of cards in your hand") + .setText("this creature's power and toughness are each equal to twice the number of cards in your hand") )); } diff --git a/Mage/src/main/java/mage/game/permanent/token/WrennAndSevenToken.java b/Mage/src/main/java/mage/game/permanent/token/WrennAndSevenToken.java new file mode 100644 index 00000000000..4397ea9050f --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/WrennAndSevenToken.java @@ -0,0 +1,38 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.LandsYouControlCount; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.ReachAbility; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; + +/** + * @author TheElk801 + */ +public final class WrennAndSevenToken extends TokenImpl { + + public WrennAndSevenToken() { + super("Treefolk", "green Treefolk creature token with reach and \"This creature's power and toughness are each equal to the number of lands you control.\""); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add(SubType.TREEFOLK); + power = new MageInt(0); + toughness = new MageInt(0); + this.addAbility(ReachAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( + LandsYouControlCount.instance, Duration.EndOfGame + ).setText("this creature's power and toughness are each equal to the number of lands you control"))); + } + + public WrennAndSevenToken(final WrennAndSevenToken token) { + super(token); + } + + public WrennAndSevenToken copy() { + return new WrennAndSevenToken(this); + } +}