From 2415a1665bef7bf4d6514430dc8c903daf1882f0 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 12 Apr 2022 08:45:15 -0400 Subject: [PATCH] [SNC] Implemented Buy Your Silence --- .../src/mage/cards/b/BuyYourSilence.java | 65 +++++++++++++++++++ .../src/mage/sets/StreetsOfNewCapenna.java | 1 + 2 files changed, 66 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BuyYourSilence.java diff --git a/Mage.Sets/src/mage/cards/b/BuyYourSilence.java b/Mage.Sets/src/mage/cards/b/BuyYourSilence.java new file mode 100644 index 0000000000..8b56d346ba --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BuyYourSilence.java @@ -0,0 +1,65 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.TreasureToken; +import mage.target.common.TargetNonlandPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BuyYourSilence extends CardImpl { + + public BuyYourSilence(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}"); + + // Exile target nonland permanent. Its controller creates a Treasure token. + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addEffect(new BuyYourSilenceEffect()); + this.getSpellAbility().addTarget(new TargetNonlandPermanent()); + } + + private BuyYourSilence(final BuyYourSilence card) { + super(card); + } + + @Override + public BuyYourSilence copy() { + return new BuyYourSilence(this); + } +} + +class BuyYourSilenceEffect extends OneShotEffect { + + BuyYourSilenceEffect() { + super(Outcome.Benefit); + staticText = "Its controller creates a Treasure token"; + } + + private BuyYourSilenceEffect(final BuyYourSilenceEffect effect) { + super(effect); + } + + @Override + public BuyYourSilenceEffect copy() { + return new BuyYourSilenceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); + if (permanent == null) { + return false; + } + return new TreasureToken().putOntoBattlefield(1, game, source, permanent.getControllerId()); + } +} diff --git a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java index e89688074d..c95ee7f18a 100644 --- a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java +++ b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java @@ -36,6 +36,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet { cards.add(new SetCardInfo("Brazen Upstart", 169, Rarity.UNCOMMON, mage.cards.b.BrazenUpstart.class)); cards.add(new SetCardInfo("Brokers Ascendancy", 170, Rarity.RARE, mage.cards.b.BrokersAscendancy.class)); cards.add(new SetCardInfo("Brokers Charm", 171, Rarity.UNCOMMON, mage.cards.b.BrokersCharm.class)); + cards.add(new SetCardInfo("Buy Your Silence", 6, Rarity.COMMON, mage.cards.b.BuyYourSilence.class)); cards.add(new SetCardInfo("Cabaretti Charm", 173, Rarity.UNCOMMON, mage.cards.c.CabarettiCharm.class)); cards.add(new SetCardInfo("Ceremonial Groundbreaker", 175, Rarity.UNCOMMON, mage.cards.c.CeremonialGroundbreaker.class)); cards.add(new SetCardInfo("Chrome Cat", 236, Rarity.COMMON, mage.cards.c.ChromeCat.class));