From 3dff1783ac7711041bd04c364ad1577732c3727c Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 24 Aug 2021 08:24:08 -0400 Subject: [PATCH] [TSP] fixed Gauntlet of Power adding mana to the wrong mana pool (fixes #8154) --- .../src/mage/cards/g/GauntletOfPower.java | 3 +- .../cards/single/tsp/GauntletOfPowerTest.java | 74 +++++++++++++++++++ 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/GauntletOfPowerTest.java diff --git a/Mage.Sets/src/mage/cards/g/GauntletOfPower.java b/Mage.Sets/src/mage/cards/g/GauntletOfPower.java index 70f1d14a09..d232603b30 100644 --- a/Mage.Sets/src/mage/cards/g/GauntletOfPower.java +++ b/Mage.Sets/src/mage/cards/g/GauntletOfPower.java @@ -7,7 +7,6 @@ import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.ChooseColorEffect; import mage.abilities.effects.common.continuous.BoostAllEffect; -import mage.abilities.effects.mana.AddManaChosenColorEffect; import mage.abilities.effects.mana.ManaEffect; import mage.abilities.mana.TriggeredManaAbility; import mage.cards.CardImpl; @@ -69,7 +68,7 @@ public final class GauntletOfPower extends CardImpl { class GauntletOfPowerTapForManaAllTriggeredAbility extends TriggeredManaAbility { GauntletOfPowerTapForManaAllTriggeredAbility() { - super(Zone.BATTLEFIELD, new AddManaChosenColorEffect(), false); + super(Zone.BATTLEFIELD, new GauntletOfPowerManaEffect2(), false); } private GauntletOfPowerTapForManaAllTriggeredAbility(GauntletOfPowerTapForManaAllTriggeredAbility ability) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/GauntletOfPowerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/GauntletOfPowerTest.java new file mode 100644 index 0000000000..496d760a1e --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/GauntletOfPowerTest.java @@ -0,0 +1,74 @@ +package org.mage.test.cards.single.tsp; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author TheElk801 + */ +public class GauntletOfPowerTest extends CardTestPlayerBase { + + private static final String gauntlet = "Gauntlet of Power"; + private static final String red = "Red"; + private static final String maaka = "Feral Maaka"; + private static final String myr = "Hovermyr"; + + @Test + public void testBoost() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); + addCard(Zone.BATTLEFIELD, playerA, maaka); + addCard(Zone.BATTLEFIELD, playerA, myr); + addCard(Zone.HAND, playerA, gauntlet); + + setChoice(playerA, red); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, gauntlet); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + assertPowerToughness(playerA, maaka, 2 + 1, 2 + 1); + assertPowerToughness(playerA, myr, 1, 2); + } + + @Test + public void testControllerMana() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6); + addCard(Zone.HAND, playerA, gauntlet); + addCard(Zone.HAND, playerA, maaka); + + setChoice(playerA, red); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, gauntlet); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, maaka); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + assertPowerToughness(playerA, maaka, 2 + 1, 2 + 1); + } + + @Test + public void testNotControllerMana() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); + addCard(Zone.HAND, playerA, gauntlet); + addCard(Zone.BATTLEFIELD, playerB, "Mountain"); + addCard(Zone.HAND, playerB, maaka); + + setChoice(playerA, red); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, gauntlet); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, maaka); + + setStrictChooseMode(true); + setStopAt(2, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + assertPowerToughness(playerB, maaka, 2 + 1, 2 + 1); + } +}