From a6422d70d40f98cd68578899a8e7754b8578c037 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 16 Sep 2019 14:44:16 -0400 Subject: [PATCH] Implemented Rally for the Throne --- .../src/mage/cards/r/RallyForTheThrone.java | 49 +++++++++++++++++++ Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 1 + 2 files changed, 50 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RallyForTheThrone.java diff --git a/Mage.Sets/src/mage/cards/r/RallyForTheThrone.java b/Mage.Sets/src/mage/cards/r/RallyForTheThrone.java new file mode 100644 index 0000000000..86e39e86e9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RallyForTheThrone.java @@ -0,0 +1,49 @@ +package mage.cards.r; + +import mage.abilities.condition.common.AdamantCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.StaticFilters; +import mage.game.permanent.token.HumanToken; +import mage.watchers.common.ManaSpentToCastWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RallyForTheThrone extends CardImpl { + + private static final DynamicValue xValue + = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE); + + public RallyForTheThrone(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}"); + + // Create two 1/1 white Human creature tokens. + this.getSpellAbility().addEffect(new CreateTokenEffect(new HumanToken(), 2)); + + // Adamant — If at least three white mana was spent to cast this spell, you gain 1 life for each creature you control. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new GainLifeEffect(xValue), AdamantCondition.WHITE, "
Adamant — " + + "If at least three white mana was spent to cast this spell, " + + "you gain 1 life for each creature you control." + )); + this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher()); + } + + private RallyForTheThrone(final RallyForTheThrone card) { + super(card); + } + + @Override + public RallyForTheThrone copy() { + return new RallyForTheThrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index e016e2720c..f7c5ef058f 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -144,6 +144,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Piper of the Swarm", 100, Rarity.RARE, mage.cards.p.PiperOfTheSwarm.class)); cards.add(new SetCardInfo("Questing Beast", 171, Rarity.MYTHIC, mage.cards.q.QuestingBeast.class)); cards.add(new SetCardInfo("Raging Redcap", 134, Rarity.COMMON, mage.cards.r.RagingRedcap.class)); + cards.add(new SetCardInfo("Rally for the Throne", 25, Rarity.UNCOMMON, mage.cards.r.RallyForTheThrone.class)); cards.add(new SetCardInfo("Rankle, Master of Pranks", 101, Rarity.MYTHIC, mage.cards.r.RankleMasterOfPranks.class)); cards.add(new SetCardInfo("Reave Soul", 103, Rarity.COMMON, mage.cards.r.ReaveSoul.class)); cards.add(new SetCardInfo("Redcap Melee", 135, Rarity.UNCOMMON, mage.cards.r.RedcapMelee.class));