From 0c4131b193168579d8868663d2861e72afef0fa8 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 22 Nov 2022 19:57:22 -0500 Subject: [PATCH] [J22] Implement Rodolf, Duskbringer --- .../src/mage/cards/r/RodolfDuskbringer.java | 97 +++++++++++++++++++ Mage.Sets/src/mage/sets/Jumpstart2022.java | 1 + 2 files changed, 98 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RodolfDuskbringer.java diff --git a/Mage.Sets/src/mage/cards/r/RodolfDuskbringer.java b/Mage.Sets/src/mage/cards/r/RodolfDuskbringer.java new file mode 100644 index 0000000000..91b782f3bc --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RodolfDuskbringer.java @@ -0,0 +1,97 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.GainLifeControllerTriggeredAbility; +import mage.abilities.common.delayed.ReflexiveTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DoWhenCostPaid; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.target.common.TargetCardInYourGraveyard; +import mage.watchers.common.PlayerGainedLifeWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RodolfDuskbringer extends CardImpl { + + private static final FilterCard filter = new FilterCreatureCard( + "creature card with mana value less than or equal to the amount of life you gained this turn" + ); + + static { + filter.add(RodolfDuskbringerPredicate.instance); + } + + public RodolfDuskbringer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.ANGEL); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + + // Whenever you gain life, Rodolf Duskbringer gains indestructible until end of turn. + this.addAbility(new GainLifeControllerTriggeredAbility(new GainAbilitySourceEffect( + IndestructibleAbility.getInstance(), Duration.EndOfTurn + ))); + + // At the beginning of your end step, you may pay {1}{W/B}. When you do, return target creature card with mana value X or less from your graveyard to the battlefield, where X is the amount of life you gained this turn. + ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( + new ReturnFromGraveyardToBattlefieldTargetEffect(), + false, "return target creature card with mana value X or less from " + + "your graveyard to the battlefield, where X is the amount of life you gained this turn" + ); + ability.addTarget(new TargetCardInYourGraveyard(filter)); + this.addAbility(new BeginningOfEndStepTriggeredAbility(new DoWhenCostPaid( + ability, new ManaCostsImpl<>("{1}{W/B}"), "Pay {1}{W/B}?" + ), TargetController.YOU, false)); + } + + private RodolfDuskbringer(final RodolfDuskbringer card) { + super(card); + } + + @Override + public RodolfDuskbringer copy() { + return new RodolfDuskbringer(this); + } +} + +enum RodolfDuskbringerPredicate implements Predicate { + instance; + + @Override + public boolean apply(Card input, Game game) { + return game + .getState() + .getWatcher(PlayerGainedLifeWatcher.class) + .getLifeGained(input.getOwnerId()) + <= input.getManaValue(); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Jumpstart2022.java b/Mage.Sets/src/mage/sets/Jumpstart2022.java index 04b9785493..624ebd6a08 100644 --- a/Mage.Sets/src/mage/sets/Jumpstart2022.java +++ b/Mage.Sets/src/mage/sets/Jumpstart2022.java @@ -62,6 +62,7 @@ public final class Jumpstart2022 extends ExpansionSet { cards.add(new SetCardInfo("Primeval Herald", 42, Rarity.UNCOMMON, mage.cards.p.PrimevalHerald.class)); cards.add(new SetCardInfo("Regal Caracal", 232, Rarity.RARE, mage.cards.r.RegalCaracal.class)); cards.add(new SetCardInfo("Renegade Demon", 126, Rarity.COMMON, mage.cards.r.RenegadeDemon.class)); + cards.add(new SetCardInfo("Rodolf Duskbringer", 25, Rarity.RARE, mage.cards.r.RodolfDuskbringer.class)); cards.add(new SetCardInfo("Seizan, Perverter of Truth", 463, Rarity.RARE, mage.cards.s.SeizanPerverterOfTruth.class)); cards.add(new SetCardInfo("Sinuous Vermin", 465, Rarity.COMMON, mage.cards.s.SinuousVermin.class)); cards.add(new SetCardInfo("Spectral Hunt-Caller", 45, Rarity.COMMON, mage.cards.s.SpectralHuntCaller.class));