From 1cfe05f38e73e49595f12cbd5dd853987fa4d347 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 16 Apr 2023 09:30:44 -0400 Subject: [PATCH] [MOC] Implement Teferi's Talent --- Mage.Sets/src/mage/cards/t/TeferisTalent.java | 57 +++++++++++++++++++ .../mage/sets/MarchOfTheMachineCommander.java | 1 + .../command/emblems/TeferisTalentEmblem.java | 27 +++++++++ 3 files changed, 85 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TeferisTalent.java create mode 100644 Mage/src/main/java/mage/game/command/emblems/TeferisTalentEmblem.java diff --git a/Mage.Sets/src/mage/cards/t/TeferisTalent.java b/Mage.Sets/src/mage/cards/t/TeferisTalent.java new file mode 100644 index 0000000000..7b98734a22 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TeferisTalent.java @@ -0,0 +1,57 @@ +package mage.cards.t; + +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.DrawCardControllerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.effects.common.counter.AddCountersAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.game.command.emblems.TeferisTalentEmblem; +import mage.target.TargetPermanent; +import mage.target.common.TargetPlaneswalkerPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TeferisTalent extends CardImpl { + + public TeferisTalent(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); + + this.subtype.add(SubType.AURA); + + // Enchant planeswalker + TargetPermanent auraTarget = new TargetPlaneswalkerPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + this.addAbility(new EnchantAbility(auraTarget)); + + // Enchanted planeswalker has "[-12]: You get an emblem with 'You may activate loyalty abilities of planeswalkers you control on any player's turn any time you could cast an instant.'" + this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect( + new LoyaltyAbility(new GetEmblemEffect(new TeferisTalentEmblem()), -12), + AttachmentType.AURA, Duration.WhileOnBattlefield, null, "planeswalker" + ))); + + // Whenever you draw a card, put a loyalty counter on enchanted planeswalker. + this.addAbility(new DrawCardControllerTriggeredAbility(new AddCountersAttachedEffect( + CounterType.LOYALTY.createInstance(), "enchanted planeswalker" + ), false)); + } + + private TeferisTalent(final TeferisTalent card) { + super(card); + } + + @Override + public TeferisTalent copy() { + return new TeferisTalent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java b/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java index ce9912dec1..6cf4874dcb 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java @@ -289,6 +289,7 @@ public final class MarchOfTheMachineCommander extends ExpansionSet { cards.add(new SetCardInfo("Syr Konrad, the Grim", 269, Rarity.UNCOMMON, mage.cards.s.SyrKonradTheGrim.class)); cards.add(new SetCardInfo("Tainted Field", 429, Rarity.UNCOMMON, mage.cards.t.TaintedField.class)); cards.add(new SetCardInfo("Talisman of Hierarchy", 385, Rarity.UNCOMMON, mage.cards.t.TalismanOfHierarchy.class)); + cards.add(new SetCardInfo("Teferi's Talent", 74, Rarity.RARE, mage.cards.t.TeferisTalent.class)); cards.add(new SetCardInfo("Temple of Abandon", 430, Rarity.RARE, mage.cards.t.TempleOfAbandon.class)); cards.add(new SetCardInfo("Temple of Deceit", 431, Rarity.RARE, mage.cards.t.TempleOfDeceit.class)); cards.add(new SetCardInfo("Temple of Enlightenment", 432, Rarity.RARE, mage.cards.t.TempleOfEnlightenment.class)); diff --git a/Mage/src/main/java/mage/game/command/emblems/TeferisTalentEmblem.java b/Mage/src/main/java/mage/game/command/emblems/TeferisTalentEmblem.java new file mode 100644 index 0000000000..61245d920d --- /dev/null +++ b/Mage/src/main/java/mage/game/command/emblems/TeferisTalentEmblem.java @@ -0,0 +1,27 @@ +package mage.game.command.emblems; + +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.ActivateAbilitiesAnyTimeYouCouldCastInstantEffect; +import mage.constants.Zone; +import mage.game.command.Emblem; + +/** + * @author TheElk801 + */ +public final class TeferisTalentEmblem extends Emblem { + // -12: "You may activate loyalty abilities of planeswalkers you control on any player's turn any time you could cast an instant." + + public TeferisTalentEmblem() { + this.setName("Emblem Teferi"); + this.getAbilities().add(new SimpleStaticAbility( + Zone.COMMAND, + new ActivateAbilitiesAnyTimeYouCouldCastInstantEffect( + LoyaltyAbility.class, + "loyalty abilities of planeswalkers you control on any player's turn" + ) + )); + + this.setExpansionSetCodeForImage("MOC"); + } +}