From 33f4ff9e1e96e88193d8ac3b329b080ef797b22e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 15 Jul 2021 09:29:26 -0400 Subject: [PATCH] [AFR] Implemented Teleportation Circle --- .../src/mage/cards/t/TeleportationCircle.java | 50 +++++++++++++++++++ .../sets/AdventuresInTheForgottenRealms.java | 1 + 2 files changed, 51 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TeleportationCircle.java diff --git a/Mage.Sets/src/mage/cards/t/TeleportationCircle.java b/Mage.Sets/src/mage/cards/t/TeleportationCircle.java new file mode 100644 index 00000000000..dad8f59323e --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TeleportationCircle.java @@ -0,0 +1,50 @@ +package mage.cards.t; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; +import mage.abilities.effects.common.ExileTargetForSourceEffect; +import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TeleportationCircle extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledPermanent("artifact or creature you control"); + + static { + filter.add(Predicates.or( + CardType.ARTIFACT.getPredicate(), + CardType.CREATURE.getPredicate() + )); + } + + public TeleportationCircle(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + + // At the beginning of your end step, exile up to one target artifact or creature you control, then return that card to the battlefield under its owner's control. + Ability ability = new BeginningOfYourEndStepTriggeredAbility(new ExileTargetForSourceEffect(), false); + ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(false)); + ability.addTarget(new TargetPermanent(0, 1, filter)); + this.addAbility(ability); + } + + private TeleportationCircle(final TeleportationCircle card) { + super(card); + } + + @Override + public TeleportationCircle copy() { + return new TeleportationCircle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index fd5a0b957a5..15e688cfe87 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -224,6 +224,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Sylvan Shepherd", 206, Rarity.COMMON, mage.cards.s.SylvanShepherd.class)); cards.add(new SetCardInfo("Targ Nar, Demon-Fang Gnoll", 234, Rarity.UNCOMMON, mage.cards.t.TargNarDemonFangGnoll.class)); cards.add(new SetCardInfo("Tasha's Hideous Laughter", 78, Rarity.RARE, mage.cards.t.TashasHideousLaughter.class)); + cards.add(new SetCardInfo("Teleportation Circle", 39, Rarity.RARE, mage.cards.t.TeleportationCircle.class)); cards.add(new SetCardInfo("Temple of the Dragon Queen", 260, Rarity.UNCOMMON, mage.cards.t.TempleOfTheDragonQueen.class)); cards.add(new SetCardInfo("The Blackstaff of Waterdeep", 48, Rarity.RARE, mage.cards.t.TheBlackstaffOfWaterdeep.class)); cards.add(new SetCardInfo("The Book of Exalted Deeds", 4, Rarity.MYTHIC, mage.cards.t.TheBookOfExaltedDeeds.class));