From c7c0c479ad1fe4afb209f87ea1cc15e156e39a76 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Mon, 13 Sep 2021 19:35:18 -0500 Subject: [PATCH] [MID] Implemented Florian, Voldaren Scion --- .../mage/cards/f/FlorianVoldarenScion.java | 102 ++++++++++++++++++ .../src/mage/sets/InnistradMidnightHunt.java | 1 + 2 files changed, 103 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FlorianVoldarenScion.java diff --git a/Mage.Sets/src/mage/cards/f/FlorianVoldarenScion.java b/Mage.Sets/src/mage/cards/f/FlorianVoldarenScion.java new file mode 100644 index 00000000000..e9c9c7355cd --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FlorianVoldarenScion.java @@ -0,0 +1,102 @@ +package mage.cards.f; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfPostCombatMainTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect; +import mage.cards.*; +import mage.constants.*; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.watchers.common.PlayerLostLifeWatcher; + +/** + * + * @author weirddan455 + */ +public final class FlorianVoldarenScion extends CardImpl { + + public FlorianVoldarenScion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.NOBLE); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // At the beginning of your postcombat main phase, look at the top X cards of your library, where X is the total amount of life your opponents lost this turn. + // Exile one of those cards and put the rest on the bottom of your library in a random order. You may play the exiled card this turn. + this.addAbility(new BeginningOfPostCombatMainTriggeredAbility(new FlorianVoldarenScionEffect(), TargetController.YOU, false)); + } + + private FlorianVoldarenScion(final FlorianVoldarenScion card) { + super(card); + } + + @Override + public FlorianVoldarenScion copy() { + return new FlorianVoldarenScion(this); + } +} + +class FlorianVoldarenScionEffect extends OneShotEffect { + + public FlorianVoldarenScionEffect() { + super(Outcome.Benefit); + staticText = "look at the top X cards of your library, where X is the total amount of life your opponents lost this turn. " + + "Exile one of those cards and put the rest on the bottom of your library in a random order. You may play the exiled card this turn"; + } + + private FlorianVoldarenScionEffect(final FlorianVoldarenScionEffect effect) { + super(effect); + } + + @Override + public FlorianVoldarenScionEffect copy() { + return new FlorianVoldarenScionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + PlayerLostLifeWatcher watcher = game.getState().getWatcher(PlayerLostLifeWatcher.class); + if (controller != null && watcher != null) { + int lifeLost = watcher.getAllOppLifeLost(controller.getId(), game); + if (lifeLost > 0) { + Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, lifeLost)); + int numCards = cards.size(); + if (numCards > 0) { + controller.lookAtCards(source, null, cards, game); + Card selectedCard; + if (numCards == 1) { + selectedCard = game.getCard(cards.iterator().next()); + } else { + TargetCard target = new TargetCard(Zone.LIBRARY, StaticFilters.FILTER_CARD); + controller.chooseTarget(outcome, cards, target, source, game); + selectedCard = game.getCard(target.getFirstTarget()); + } + if (selectedCard != null) { + cards.remove(selectedCard); + PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile( + game, source, selectedCard, TargetController.YOU, Duration.EndOfTurn, false, false, false + ); + } + if (!cards.isEmpty()) { + controller.putCardsOnBottomOfLibrary(cards, game, source, false); + } + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index 0b7f79bcf2c..8b186f6fc2c 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -141,6 +141,7 @@ public final class InnistradMidnightHunt extends ExpansionSet { cards.add(new SetCardInfo("Flare of Faith", 19, Rarity.COMMON, mage.cards.f.FlareOfFaith.class)); cards.add(new SetCardInfo("Fleshtaker", 222, Rarity.UNCOMMON, mage.cards.f.Fleshtaker.class)); cards.add(new SetCardInfo("Flip the Switch", 54, Rarity.COMMON, mage.cards.f.FlipTheSwitch.class)); + cards.add(new SetCardInfo("Florian, Voldaren Scion", 223, Rarity.RARE, mage.cards.f.FlorianVoldarenScion.class)); cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Foul Play", 101, Rarity.UNCOMMON, mage.cards.f.FoulPlay.class)); cards.add(new SetCardInfo("Frenzied Trapbreaker", 190, Rarity.UNCOMMON, mage.cards.f.FrenziedTrapbreaker.class));