diff --git a/Mage.Sets/src/mage/cards/m/MuerraTrashTactician.java b/Mage.Sets/src/mage/cards/m/MuerraTrashTactician.java new file mode 100644 index 00000000000..0d9170ec735 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MuerraTrashTactician.java @@ -0,0 +1,69 @@ +package mage.cards.m; + +import mage.MageInt; +import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility; +import mage.abilities.common.ExpendTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.mana.AddManaInAnyCombinationEffect; +import mage.abilities.hint.Hint; +import mage.abilities.hint.ValueHint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.common.FilterControlledPermanent; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class MuerraTrashTactician extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.RACCOON, "Raccoon you control"); + + private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter); + private static final Hint hint = new ValueHint("Raccoon you control", xValue); + + + public MuerraTrashTactician(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{G}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.RACCOON); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // At the beginning of your first main phase, add {R} or {G} for each Raccoon you control. + this.addAbility(new BeginningOfPreCombatMainTriggeredAbility( + new AddManaInAnyCombinationEffect(xValue, xValue, ColoredManaSymbol.R, ColoredManaSymbol.G) + .setText("add {R} or {G} for each Raccoon you control"), + TargetController.YOU, false + ).setTriggerPhrase("At the beginning of your first main phase, ").addHint(hint)); + + // Whenever you expend 4, you gain 3 life. + this.addAbility(new ExpendTriggeredAbility( + new GainLifeEffect(3), + ExpendTriggeredAbility.Expend.FOUR + )); + + // Whenever you expend 8, exile the top two cards of your library. Until the end of your next turn, you may play those cards. + this.addAbility(new ExpendTriggeredAbility( + new ExileTopXMayPlayUntilEffect(2, Duration.UntilEndOfYourNextTurn), + ExpendTriggeredAbility.Expend.EIGHT + )); + + } + + private MuerraTrashTactician(final MuerraTrashTactician card) { + super(card); + } + + @Override + public MuerraTrashTactician copy() { + return new MuerraTrashTactician(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Bloomburrow.java b/Mage.Sets/src/mage/sets/Bloomburrow.java index 8c89fc968a2..104e694d297 100644 --- a/Mage.Sets/src/mage/sets/Bloomburrow.java +++ b/Mage.Sets/src/mage/sets/Bloomburrow.java @@ -58,6 +58,7 @@ public final class Bloomburrow extends ExpansionSet { cards.add(new SetCardInfo("Moonrise Cleric", 226, Rarity.COMMON, mage.cards.m.MoonriseCleric.class)); cards.add(new SetCardInfo("Mountain", 274, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Mudflat Village", 257, Rarity.UNCOMMON, mage.cards.m.MudflatVillage.class)); + cards.add(new SetCardInfo("Muerra, Trash Tactician", 227, Rarity.RARE, mage.cards.m.MuerraTrashTactician.class)); cards.add(new SetCardInfo("Oakhollow Village", 258, Rarity.UNCOMMON, mage.cards.o.OakhollowVillage.class)); cards.add(new SetCardInfo("Pearl of Wisdom", 64, Rarity.COMMON, mage.cards.p.PearlOfWisdom.class)); cards.add(new SetCardInfo("Plains", 262, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS)); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ExpendTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ExpendTest.java index 7c0d418ea37..cd92706654e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ExpendTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ExpendTest.java @@ -20,8 +20,18 @@ public class ExpendTest extends CardTestPlayerBase { */ private static final String mentor = "Wandertale Mentor"; + /** + * {@link mage.cards.m.MuerraTrashTactician Muerra, Trash Tactician} {1}{R}{G} + * Legendary Creature — Raccoon Warrior + * At the beginning of your first main phase, add {R} or {G} for each Raccoon you control. + * Whenever you expend 4, you gain 3 life. (You expend 4 as you spend your fourth total mana to cast spells during a turn.) + * Whenever you expend 8, exile the top two cards of your library. Until the end of your next turn, you may play those cards. + * 2/4 + */ + private static final String muerra = "Muerra, Trash Tactician"; + @Test - public void test_OnPayingSingleSpell_4Mana_Trigger() { + public void test_Expend4_OnPayingSingleSpell_4Mana_Trigger() { setStrictChooseMode(true); addCard(Zone.BATTLEFIELD, playerA, mentor); @@ -37,7 +47,7 @@ public class ExpendTest extends CardTestPlayerBase { } @Test - public void test_OnPayingSingleSpell_5Mana_Trigger() { + public void test_Expend4_OnPayingSingleSpell_5Mana_Trigger() { setStrictChooseMode(true); addCard(Zone.BATTLEFIELD, playerA, mentor); @@ -53,7 +63,7 @@ public class ExpendTest extends CardTestPlayerBase { } @Test - public void test_OnPayingSingleSpell_3Mana_NoTrigger() { + public void test_Expend4_OnPayingSingleSpell_3Mana_NoTrigger() { setStrictChooseMode(true); addCard(Zone.BATTLEFIELD, playerA, mentor); @@ -203,7 +213,7 @@ public class ExpendTest extends CardTestPlayerBase { } @Test - public void test_XSpell_4_Trigger() { + public void test_Expend4_XSpell_4_Trigger() { setStrictChooseMode(true); addCard(Zone.BATTLEFIELD, playerA, mentor); @@ -221,7 +231,7 @@ public class ExpendTest extends CardTestPlayerBase { } @Test - public void test_XSpell_3_NoTrigger() { + public void test_Expend4_XSpell_3_NoTrigger() { setStrictChooseMode(true); addCard(Zone.BATTLEFIELD, playerA, mentor); @@ -254,4 +264,46 @@ public class ExpendTest extends CardTestPlayerBase { assertCounterCount(playerA, mentor, CounterType.P1P1, 2); } + + @Test + public void test_Expend8_Cast8Drop_Trigger() { + setStrictChooseMode(true); + + addCard(Zone.BATTLEFIELD, playerA, muerra); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 7); + addCard(Zone.HAND, playerA, "Scaled Wurm"); // {7}{G} vanilla + + setChoice(playerA, "X=1"); // choice for mana-producing trigger + setChoice(playerA, "X=0"); // choice for mana-producing trigger + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scaled Wurm"); + setChoice(playerA, "Whenever you expend 8"); // order the 2 triggers + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertExileCount(playerA, 2); + assertLife(playerA, 20 + 3); + } + + @Test + public void test_Expend8_Cast7Drop_NoTrigger() { + setStrictChooseMode(true); + + addCard(Zone.BATTLEFIELD, playerA, muerra); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); + addCard(Zone.HAND, playerA, "Axebane Beast"); // {6}{G} vanilla + + setChoice(playerA, "X=1"); // choice for mana-producing trigger + setChoice(playerA, "X=0"); // choice for mana-producing trigger + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Axebane Beast"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertExileCount(playerA, 0); + assertLife(playerA, 20 + 3); + } }