From ccccc0b3840a8093afdcbb520c653048292bfec1 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 5 Nov 2021 20:03:59 -0400 Subject: [PATCH] [VOW] Implemented Into the Night --- Mage.Sets/src/mage/cards/i/IntoTheNight.java | 64 +++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 2 files changed, 65 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/i/IntoTheNight.java diff --git a/Mage.Sets/src/mage/cards/i/IntoTheNight.java b/Mage.Sets/src/mage/cards/i/IntoTheNight.java new file mode 100644 index 0000000000..e12fc07489 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IntoTheNight.java @@ -0,0 +1,64 @@ +package mage.cards.i; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class IntoTheNight extends CardImpl { + + public IntoTheNight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}"); + + // It becomes night. Discard any number of cards, then draw that many cards plus one. + this.getSpellAbility().addEffect(new IntoTheNightEffect()); + } + + private IntoTheNight(final IntoTheNight card) { + super(card); + } + + @Override + public IntoTheNight copy() { + return new IntoTheNight(this); + } +} + +class IntoTheNightEffect extends OneShotEffect { + + IntoTheNightEffect() { + super(Outcome.Benefit); + staticText = "it becomes night. Discard any number of cards, then draw that many cards plus one"; + } + + private IntoTheNightEffect(final IntoTheNightEffect effect) { + super(effect); + } + + @Override + public IntoTheNightEffect copy() { + return new IntoTheNightEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + game.setDaytime(false); + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + player.drawCards(player.discard( + 0, Integer.MAX_VALUE, false, source, game + ).size() + 1, source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index 1345091693..54f68ea1db 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -134,6 +134,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Infestation Expert", 206, Rarity.UNCOMMON, mage.cards.i.InfestationExpert.class)); cards.add(new SetCardInfo("Infested Werewolf", 206, Rarity.UNCOMMON, mage.cards.i.InfestedWerewolf.class)); cards.add(new SetCardInfo("Inspired Idea", 64, Rarity.RARE, mage.cards.i.InspiredIdea.class)); + cards.add(new SetCardInfo("Into the Night", 163, Rarity.UNCOMMON, mage.cards.i.IntoTheNight.class)); cards.add(new SetCardInfo("Investigator's Journal", 258, Rarity.RARE, mage.cards.i.InvestigatorsJournal.class)); cards.add(new SetCardInfo("Island", 399, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Kessig Flamebreather", 164, Rarity.COMMON, mage.cards.k.KessigFlamebreather.class));