From bc4ec72656c632604abe55e8df68845d6645cee9 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 11 Sep 2021 20:08:54 -0400 Subject: [PATCH] [MID] Implemented Devoted Grafkeeper / Departed Soulkeeper --- .../src/mage/cards/d/DepartedSoulkeeper.java | 49 ++++++++++ .../src/mage/cards/d/DevotedGrafkeeper.java | 89 +++++++++++++++++++ .../src/mage/sets/InnistradMidnightHunt.java | 2 + 3 files changed, 140 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DepartedSoulkeeper.java create mode 100644 Mage.Sets/src/mage/cards/d/DevotedGrafkeeper.java diff --git a/Mage.Sets/src/mage/cards/d/DepartedSoulkeeper.java b/Mage.Sets/src/mage/cards/d/DepartedSoulkeeper.java new file mode 100644 index 00000000000..91e19c92f0f --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DepartedSoulkeeper.java @@ -0,0 +1,49 @@ +package mage.cards.d; + +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.common.PutIntoGraveFromAnywhereSourceAbility; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DepartedSoulkeeper extends CardImpl { + + public DepartedSoulkeeper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, ""); + + this.subtype.add(SubType.SPIRIT); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + this.color.setWhite(true); + this.color.setBlue(true); + this.transformable = true; + this.nightCard = true; + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Departed Soulkeeper can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + + // If Departed Soulkeeper would be put into a graveyard from anywhere, exile it instead. + this.addAbility(new PutIntoGraveFromAnywhereSourceAbility(new ExileSourceEffect().setText("exile it instead"))); + } + + private DepartedSoulkeeper(final DepartedSoulkeeper card) { + super(card); + } + + @Override + public DepartedSoulkeeper copy() { + return new DepartedSoulkeeper(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DevotedGrafkeeper.java b/Mage.Sets/src/mage/cards/d/DevotedGrafkeeper.java new file mode 100644 index 00000000000..667d86340c4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DevotedGrafkeeper.java @@ -0,0 +1,89 @@ +package mage.cards.d; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.MillCardsControllerEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.DisturbAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DevotedGrafkeeper extends CardImpl { + + public DevotedGrafkeeper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.PEASANT); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + this.transformable = true; + this.secondSideCardClazz = mage.cards.d.DepartedSoulkeeper.class; + + // When Devoted Grafkeeper enters the battlefield, mill two cards. + this.addAbility(new EntersBattlefieldTriggeredAbility(new MillCardsControllerEffect(2))); + + // Whenever you cast a spell from your graveyard, tap target creature you don't control. + this.addAbility(new DevotedGrafkeeperTriggeredAbility()); + + // Disturb {1}{W}{U} + this.addAbility(new TransformAbility()); + this.addAbility(new DisturbAbility(new ManaCostsImpl<>("{1}{W}{U}"))); + } + + private DevotedGrafkeeper(final DevotedGrafkeeper card) { + super(card); + } + + @Override + public DevotedGrafkeeper copy() { + return new DevotedGrafkeeper(this); + } +} + +class DevotedGrafkeeperTriggeredAbility extends TriggeredAbilityImpl { + + DevotedGrafkeeperTriggeredAbility() { + super(Zone.BATTLEFIELD, new TapTargetEffect(), false); + this.addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL)); + } + + private DevotedGrafkeeperTriggeredAbility(DevotedGrafkeeperTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return isControlledBy(event.getPlayerId()) && event.getZone() == Zone.GRAVEYARD; + } + + @Override + public DevotedGrafkeeperTriggeredAbility copy() { + return new DevotedGrafkeeperTriggeredAbility(this); + } + + @Override + public String getRule() { + return "Whenever you cast a spell from your graveyard, tap target creature you don't control."; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index 9bb13602ae1..8ee1b8b59af 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -98,8 +98,10 @@ public final class InnistradMidnightHunt extends ExpansionSet { cards.add(new SetCardInfo("Defend the Celestus", 182, Rarity.UNCOMMON, mage.cards.d.DefendTheCelestus.class)); cards.add(new SetCardInfo("Defenestrate", 95, Rarity.COMMON, mage.cards.d.Defenestrate.class)); cards.add(new SetCardInfo("Delver of Secrets", 47, Rarity.UNCOMMON, mage.cards.d.DelverOfSecrets.class)); + cards.add(new SetCardInfo("Departed Soulkeeper", 218, Rarity.UNCOMMON, mage.cards.d.DepartedSoulkeeper.class)); cards.add(new SetCardInfo("Deserted Beach", 260, Rarity.RARE, mage.cards.d.DesertedBeach.class)); cards.add(new SetCardInfo("Devious Cover-Up", 48, Rarity.COMMON, mage.cards.d.DeviousCoverUp.class)); + cards.add(new SetCardInfo("Devoted Grafkeeper", 218, Rarity.UNCOMMON, mage.cards.d.DevotedGrafkeeper.class)); cards.add(new SetCardInfo("Dire-Strain Brawler", 203, Rarity.COMMON, mage.cards.d.DireStrainBrawler.class)); cards.add(new SetCardInfo("Dire-Strain Demolisher", 174, Rarity.UNCOMMON, mage.cards.d.DireStrainDemolisher.class)); cards.add(new SetCardInfo("Dire-Strain Rampage", 219, Rarity.RARE, mage.cards.d.DireStrainRampage.class));