From 55caa5e4ebf3b2cbe6a10b011d72ab16f621507d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 18 Aug 2022 19:05:30 -0400 Subject: [PATCH] [DMU] Implemented Sheoldred, the Apocalypse --- .../mage/cards/s/SheoldredTheApocalypse.java | 51 +++++++++++++++++++ Mage.Sets/src/mage/sets/DominariaUnited.java | 1 + .../DrawCardOpponentTriggeredAbility.java | 20 +++----- 3 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/s/SheoldredTheApocalypse.java diff --git a/Mage.Sets/src/mage/cards/s/SheoldredTheApocalypse.java b/Mage.Sets/src/mage/cards/s/SheoldredTheApocalypse.java new file mode 100644 index 0000000000..2320b272a1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SheoldredTheApocalypse.java @@ -0,0 +1,51 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.common.DrawCardControllerTriggeredAbility; +import mage.abilities.common.DrawCardOpponentTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SheoldredTheApocalypse extends CardImpl { + + public SheoldredTheApocalypse(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.PHYREXIAN); + this.subtype.add(SubType.PRAETOR); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Whenever you draw a card, you gain 2 life. + this.addAbility(new DrawCardControllerTriggeredAbility(new GainLifeEffect(2), false)); + + // Whenever an opponent draws a card, they lose 2 life. + this.addAbility(new DrawCardOpponentTriggeredAbility( + new LoseLifeTargetEffect(2).setText("they lose 2 life"), false, true + )); + } + + private SheoldredTheApocalypse(final SheoldredTheApocalypse card) { + super(card); + } + + @Override + public SheoldredTheApocalypse copy() { + return new SheoldredTheApocalypse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/DominariaUnited.java b/Mage.Sets/src/mage/sets/DominariaUnited.java index 44fb960943..ba9528cf27 100644 --- a/Mage.Sets/src/mage/sets/DominariaUnited.java +++ b/Mage.Sets/src/mage/sets/DominariaUnited.java @@ -43,6 +43,7 @@ public final class DominariaUnited extends ExpansionSet { cards.add(new SetCardInfo("Plains", 277, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Resolute Reinforcements", 29, Rarity.UNCOMMON, mage.cards.r.ResoluteReinforcements.class)); cards.add(new SetCardInfo("Shalai's Acolyte", 33, Rarity.UNCOMMON, mage.cards.s.ShalaisAcolyte.class)); + cards.add(new SetCardInfo("Sheoldred, the Apocalypse", 107, Rarity.MYTHIC, mage.cards.s.SheoldredTheApocalypse.class)); cards.add(new SetCardInfo("Shivan Devastator", 143, Rarity.MYTHIC, mage.cards.s.ShivanDevastator.class)); cards.add(new SetCardInfo("Shivan Reef", 255, Rarity.RARE, mage.cards.s.ShivanReef.class)); cards.add(new SetCardInfo("Sulfurous Springs", 256, Rarity.RARE, mage.cards.s.SulfurousSprings.class)); diff --git a/Mage/src/main/java/mage/abilities/common/DrawCardOpponentTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DrawCardOpponentTriggeredAbility.java index 64534da366..2eadd12d03 100644 --- a/Mage/src/main/java/mage/abilities/common/DrawCardOpponentTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DrawCardOpponentTriggeredAbility.java @@ -1,5 +1,3 @@ - - package mage.abilities.common; import mage.abilities.TriggeredAbilityImpl; @@ -10,13 +8,11 @@ import mage.game.events.GameEvent; import mage.target.targetpointer.FixedTarget; /** - * * @author LevelX2 */ - public class DrawCardOpponentTriggeredAbility extends TriggeredAbilityImpl { - boolean setTargetPointer; + private final boolean setTargetPointer; public DrawCardOpponentTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) { super(Zone.BATTLEFIELD, effect, optional); @@ -41,14 +37,12 @@ public class DrawCardOpponentTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getPlayer(this.getControllerId()).hasOpponent(event.getPlayerId(), game)) { - if (setTargetPointer) { - for (Effect effect:this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - } - return true; + if (!game.getPlayer(this.getControllerId()).hasOpponent(event.getPlayerId(), game)) { + return false; } - return false; + if (setTargetPointer) { + this.getEffects().setTargetPointer(new FixedTarget(event.getPlayerId())); + } + return true; } }