From 4da1fbf765fec174f8769388535cfa5f095bb008 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Fri, 15 Apr 2022 07:48:42 -0500 Subject: [PATCH] [SNC] Implemented Angel of Suffering --- .../src/mage/cards/a/AngelOfSuffering.java | 86 +++++++++++++++++++ .../src/mage/sets/StreetsOfNewCapenna.java | 1 + 2 files changed, 87 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AngelOfSuffering.java diff --git a/Mage.Sets/src/mage/cards/a/AngelOfSuffering.java b/Mage.Sets/src/mage/cards/a/AngelOfSuffering.java new file mode 100644 index 0000000000..f9e1a194ec --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AngelOfSuffering.java @@ -0,0 +1,86 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author weirddan455 + */ +public final class AngelOfSuffering extends CardImpl { + + public AngelOfSuffering(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + + this.subtype.add(SubType.NIGHTMARE); + this.subtype.add(SubType.ANGEL); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // If damage would be dealt to you, prevent that damage and mill twice that many cards. + this.addAbility(new SimpleStaticAbility(new AngelOfSufferingEffect())); + } + + private AngelOfSuffering(final AngelOfSuffering card) { + super(card); + } + + @Override + public AngelOfSuffering copy() { + return new AngelOfSuffering(this); + } +} + +class AngelOfSufferingEffect extends ReplacementEffectImpl { + + public AngelOfSufferingEffect() { + super(Duration.WhileOnBattlefield, Outcome.PreventDamage); + this.staticText = "If damage would be dealt to you, prevent that damage and mill twice that many cards"; + } + + private AngelOfSufferingEffect(final AngelOfSufferingEffect effect) { + super(effect); + } + + @Override + public AngelOfSufferingEffect copy() { + return new AngelOfSufferingEffect(this); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + int cardsToMill = event.getAmount() * 2; + game.preventDamage(event, source, game, Integer.MAX_VALUE); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.millCards(cardsToMill, source, game); + } + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGE_PLAYER; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getTargetId().equals(source.getControllerId()); + } +} diff --git a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java index 097ef76f7e..47f89de0f9 100644 --- a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java +++ b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java @@ -29,6 +29,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet { cards.add(new SetCardInfo("A Little Chat", 47, Rarity.UNCOMMON, mage.cards.a.ALittleChat.class)); cards.add(new SetCardInfo("All-Seeing Arbiter", 34, Rarity.MYTHIC, mage.cards.a.AllSeeingArbiter.class)); cards.add(new SetCardInfo("An Offer You Can't Refuse", 51, Rarity.UNCOMMON, mage.cards.a.AnOfferYouCantRefuse.class)); + cards.add(new SetCardInfo("Angel of Suffering", 67, Rarity.MYTHIC, mage.cards.a.AngelOfSuffering.class)); cards.add(new SetCardInfo("Angelic Observer", 1, Rarity.UNCOMMON, mage.cards.a.AngelicObserver.class)); cards.add(new SetCardInfo("Arc Spitter", 233, Rarity.UNCOMMON, mage.cards.a.ArcSpitter.class)); cards.add(new SetCardInfo("Attended Socialite", 133, Rarity.COMMON, mage.cards.a.AttendedSocialite.class));