From 154a62060414cca207703a2aa1cd123c8a51a480 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 6 Jun 2020 11:21:40 -0400 Subject: [PATCH] Implemented Vito, Thorn of the Dusk Rose --- .../mage/cards/v/VitoThornOfTheDuskRose.java | 88 +++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2021.java | 1 + 2 files changed, 89 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/v/VitoThornOfTheDuskRose.java diff --git a/Mage.Sets/src/mage/cards/v/VitoThornOfTheDuskRose.java b/Mage.Sets/src/mage/cards/v/VitoThornOfTheDuskRose.java new file mode 100644 index 0000000000..244d8a96fd --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VitoThornOfTheDuskRose.java @@ -0,0 +1,88 @@ +package mage.cards.v; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.common.TargetOpponent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class VitoThornOfTheDuskRose extends CardImpl { + + public VitoThornOfTheDuskRose(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Whenever you gain life, target opponent loses that much life. + this.addAbility(new VitoThornOfTheDuskRoseTriggeredAbility()); + + // {3}{B}{B}: Creatures you control gain lifelink until end of turn. + this.addAbility(new SimpleActivatedAbility(new GainAbilityControlledEffect( + LifelinkAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES + ), new ManaCostsImpl("{3}{B}{B}"))); + } + + private VitoThornOfTheDuskRose(final VitoThornOfTheDuskRose card) { + super(card); + } + + @Override + public VitoThornOfTheDuskRose copy() { + return new VitoThornOfTheDuskRose(this); + } +} + +class VitoThornOfTheDuskRoseTriggeredAbility extends TriggeredAbilityImpl { + + VitoThornOfTheDuskRoseTriggeredAbility() { + super(Zone.BATTLEFIELD, null); + this.addTarget(new TargetOpponent()); + } + + private VitoThornOfTheDuskRoseTriggeredAbility(final VitoThornOfTheDuskRoseTriggeredAbility ability) { + super(ability); + } + + @Override + public VitoThornOfTheDuskRoseTriggeredAbility copy() { + return new VitoThornOfTheDuskRoseTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.GAINED_LIFE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getPlayerId().equals(this.controllerId)) { + this.getEffects().clear(); + this.addEffect(new LoseLifeTargetEffect(event.getAmount())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you gain life, target opponent loses that much life."; + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2021.java b/Mage.Sets/src/mage/sets/CoreSet2021.java index 8e519520c4..73681a7b69 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2021.java +++ b/Mage.Sets/src/mage/sets/CoreSet2021.java @@ -56,6 +56,7 @@ public final class CoreSet2021 extends ExpansionSet { cards.add(new SetCardInfo("Teferi's Protege", 77, Rarity.COMMON, mage.cards.t.TeferisProtege.class)); cards.add(new SetCardInfo("Tormod's Crypt", 241, Rarity.UNCOMMON, mage.cards.t.TormodsCrypt.class)); cards.add(new SetCardInfo("Ugin, the Spirit Dragon", 1, Rarity.MYTHIC, mage.cards.u.UginTheSpiritDragon.class)); + cards.add(new SetCardInfo("Vito, Thorn of the Dusk Rose", 127, Rarity.RARE, mage.cards.v.VitoThornOfTheDuskRose.class)); cards.add(new SetCardInfo("Wildwood Patrol", 339, Rarity.COMMON, mage.cards.w.WildwoodPatrol.class)); } }