diff --git a/Mage.Sets/src/mage/cards/p/PeerIntoTheAbyss.java b/Mage.Sets/src/mage/cards/p/PeerIntoTheAbyss.java new file mode 100644 index 0000000000..7f5e8372ea --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PeerIntoTheAbyss.java @@ -0,0 +1,65 @@ +package mage.cards.p; + +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 mage.target.TargetPlayer; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PeerIntoTheAbyss extends CardImpl { + + public PeerIntoTheAbyss(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}{B}{B}"); + + // Target player draws cards equal to half the number of cards in their library and loses half their life. Round up each time. + this.getSpellAbility().addEffect(new PeerIntoTheAbyssEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + private PeerIntoTheAbyss(final PeerIntoTheAbyss card) { + super(card); + } + + @Override + public PeerIntoTheAbyss copy() { + return new PeerIntoTheAbyss(this); + } +} + +class PeerIntoTheAbyssEffect extends OneShotEffect { + + PeerIntoTheAbyssEffect() { + super(Outcome.Benefit); + staticText = "Target player draws cards equal to half the number of cards in their library " + + "and loses half their life. Round up each time."; + } + + private PeerIntoTheAbyssEffect(final PeerIntoTheAbyssEffect effect) { + super(effect); + } + + @Override + public PeerIntoTheAbyssEffect copy() { + return new PeerIntoTheAbyssEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + player.drawCards((int) Math.ceil(player.getLibrary().size() / 2), source.getSourceId(), game); + player.loseLife((int) Math.ceil(player.getLife() / 2), game, false); + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/CoreSet2021.java b/Mage.Sets/src/mage/sets/CoreSet2021.java index 73681a7b69..9340844cb5 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2021.java +++ b/Mage.Sets/src/mage/sets/CoreSet2021.java @@ -47,6 +47,7 @@ public final class CoreSet2021 extends ExpansionSet { cards.add(new SetCardInfo("Mangara, the Diplomat", 27, Rarity.MYTHIC, mage.cards.m.MangaraTheDiplomat.class)); cards.add(new SetCardInfo("Mystic Skyfish", 326, Rarity.COMMON, mage.cards.m.MysticSkyfish.class)); cards.add(new SetCardInfo("Pack Leader", 29, Rarity.RARE, mage.cards.p.PackLeader.class)); + cards.add(new SetCardInfo("Peer into the Abyss", 117, Rarity.RARE, mage.cards.p.PeerIntoTheAbyss.class)); cards.add(new SetCardInfo("Quirion Dryad", 198, Rarity.UNCOMMON, mage.cards.q.QuirionDryad.class)); cards.add(new SetCardInfo("Rain of Revelation", 61, Rarity.UNCOMMON, mage.cards.r.RainOfRevelation.class)); cards.add(new SetCardInfo("Runed Halo", 32, Rarity.RARE, mage.cards.r.RunedHalo.class));