From 7fd25d5ce8a9eb369614c38eb7819389b0e82339 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 20 May 2019 12:55:09 -0400 Subject: [PATCH] Implemented Seasoned Pyromancer --- .../src/mage/cards/s/SeasonedPyromancer.java | 102 ++++++++++++++++++ Mage.Sets/src/mage/sets/ModernHorizons.java | 1 + 2 files changed, 103 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SeasonedPyromancer.java diff --git a/Mage.Sets/src/mage/cards/s/SeasonedPyromancer.java b/Mage.Sets/src/mage/cards/s/SeasonedPyromancer.java new file mode 100644 index 0000000000..ce77b1812a --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SeasonedPyromancer.java @@ -0,0 +1,102 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileSourceFromGraveCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.*; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.token.YoungPyromancerElementalToken; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInHand; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SeasonedPyromancer extends CardImpl { + + public SeasonedPyromancer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Seasoned Pyromancer enters the battlefield, discard two cards, then draw two cards. For each nonland card discarded this way, create a 1/1 red Elemental creature token. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SeasonedPyromancerEffect())); + + // {3}{R}{R}, Exile Seasoned Pyromancer from your graveyard: Create two 1/1 red Elemental creature tokens. + Ability ability = new SimpleActivatedAbility( + Zone.GRAVEYARD, + new CreateTokenEffect(new YoungPyromancerElementalToken(), 2), + new ManaCostsImpl("{3}{R}{R}") + ); + ability.addCost(new ExileSourceFromGraveCost()); + this.addAbility(ability); + } + + private SeasonedPyromancer(final SeasonedPyromancer card) { + super(card); + } + + @Override + public SeasonedPyromancer copy() { + return new SeasonedPyromancer(this); + } +} + +class SeasonedPyromancerEffect extends OneShotEffect { + + SeasonedPyromancerEffect() { + super(Outcome.Benefit); + staticText = "discard two cards, then draw two cards. " + + "For each nonland card discarded this way, " + + "create a 1/1 red Elemental creature token."; + } + + private SeasonedPyromancerEffect(final SeasonedPyromancerEffect effect) { + super(effect); + } + + @Override + public SeasonedPyromancerEffect copy() { + return new SeasonedPyromancerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + TargetCard target = new TargetCardInHand(2, StaticFilters.FILTER_CARD); + if (!player.choose(outcome, player.getHand(), target, game)) { + return false; + } + Cards cards = new CardsImpl(target.getTargets()); + int nonlands = 0; + for (Card card : cards.getCards(game)) { + if (player.discard(card, source, game) && !card.isLand()) { + nonlands++; + } + } + player.drawCards(2, game); + if (nonlands > 0) { + return new CreateTokenEffect(new YoungPyromancerElementalToken(), nonlands).apply(game, source); + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ModernHorizons.java b/Mage.Sets/src/mage/sets/ModernHorizons.java index ed70b41431..a4e275698f 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons.java @@ -42,6 +42,7 @@ public final class ModernHorizons extends ExpansionSet { cards.add(new SetCardInfo("Martyr's Soul", 19, Rarity.COMMON, mage.cards.m.MartyrsSoul.class)); cards.add(new SetCardInfo("Prismatic View", 244, Rarity.RARE, mage.cards.p.PrismaticView.class)); cards.add(new SetCardInfo("Prohibit", 64, Rarity.COMMON, mage.cards.p.Prohibit.class)); + cards.add(new SetCardInfo("Seasoned Pyromancer", 145, Rarity.MYTHIC, mage.cards.s.SeasonedPyromancer.class)); cards.add(new SetCardInfo("Serra the Benevolent", 26, Rarity.MYTHIC, mage.cards.s.SerraTheBenevolent.class)); cards.add(new SetCardInfo("Snow-Covered Forest", 254, Rarity.COMMON, mage.cards.s.SnowCoveredForest.class)); cards.add(new SetCardInfo("Snow-Covered Island", 251, Rarity.COMMON, mage.cards.s.SnowCoveredIsland.class));