From 93ab73ccac47ed19ea78745747fbccb97f7c42b3 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Thu, 14 Apr 2022 13:05:53 -0500 Subject: [PATCH] [SNC] Implemented Raffine's Silencer --- .../src/mage/cards/r/RaffinesSilencer.java | 83 +++++++++++++++++++ .../src/mage/sets/StreetsOfNewCapenna.java | 1 + 2 files changed, 84 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RaffinesSilencer.java diff --git a/Mage.Sets/src/mage/cards/r/RaffinesSilencer.java b/Mage.Sets/src/mage/cards/r/RaffinesSilencer.java new file mode 100644 index 0000000000..94c3bbccbb --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RaffinesSilencer.java @@ -0,0 +1,83 @@ +package mage.cards.r; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesSourceTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.keyword.ConniveSourceEffect; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetOpponentsCreaturePermanent; + +/** + * + * @author weirddan455 + */ +public final class RaffinesSilencer extends CardImpl { + + public RaffinesSilencer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ASSASSIN); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Raffine's Silencer enters the battlefield, it connives. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ConniveSourceEffect())); + + // When Raffine's Silencer dies, target creature an opponent controls gets -X/-X until end of turn, where X is Raffine's Silencer's power. + Ability ability = new DiesSourceTriggeredAbility( + new BoostTargetEffect(RaffinesSilencerValue.instance, RaffinesSilencerValue.instance, Duration.EndOfTurn, true), + false + ); + ability.addTarget(new TargetOpponentsCreaturePermanent()); + this.addAbility(ability); + } + + private RaffinesSilencer(final RaffinesSilencer card) { + super(card); + } + + @Override + public RaffinesSilencer copy() { + return new RaffinesSilencer(this); + } +} + +enum RaffinesSilencerValue implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Object died = effect.getValue("permanentLeftBattlefield"); + if (died instanceof Permanent) { + return -((Permanent) died).getPower().getValue(); + } + return 0; + } + + @Override + public RaffinesSilencerValue copy() { + return this; + } + + @Override + public String toString() { + return "-X"; + } + + @Override + public String getMessage() { + return "{this}'s power"; + } +} diff --git a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java index 7b9982b11e..ca7802de60 100644 --- a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java +++ b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java @@ -132,6 +132,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet { cards.add(new SetCardInfo("Racers' Ring", 253, Rarity.COMMON, mage.cards.r.RacersRing.class)); cards.add(new SetCardInfo("Raffine's Guidance", 25, Rarity.COMMON, mage.cards.r.RaffinesGuidance.class)); cards.add(new SetCardInfo("Raffine's Informant", 26, Rarity.COMMON, mage.cards.r.RaffinesInformant.class)); + cards.add(new SetCardInfo("Raffine's Silencer", 90, Rarity.UNCOMMON, mage.cards.r.RaffinesSilencer.class)); cards.add(new SetCardInfo("Raffine's Tower", 254, Rarity.RARE, mage.cards.r.RaffinesTower.class)); cards.add(new SetCardInfo("Raffine, Scheming Seer", 213, Rarity.MYTHIC, mage.cards.r.RaffineSchemingSeer.class)); cards.add(new SetCardInfo("Refuse to Yield", 27, Rarity.UNCOMMON, mage.cards.r.RefuseToYield.class));