From af0178962d219674852ce6822ab930ff9e3f1fb5 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 17 Apr 2021 12:44:49 -0400 Subject: [PATCH] [STX] fixed Plumb the Forbidden ability not triggering (fixes #7755) --- .../src/mage/cards/p/PlumbTheForbidden.java | 9 +++++ .../single/stx/PlumbTheForbiddenTest.java | 40 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/stx/PlumbTheForbiddenTest.java diff --git a/Mage.Sets/src/mage/cards/p/PlumbTheForbidden.java b/Mage.Sets/src/mage/cards/p/PlumbTheForbidden.java index e10060ca51..378d01c85f 100644 --- a/Mage.Sets/src/mage/cards/p/PlumbTheForbidden.java +++ b/Mage.Sets/src/mage/cards/p/PlumbTheForbidden.java @@ -50,6 +50,10 @@ class PlumbTheForbiddenCost extends SacrificeTargetCost { "copy this spell for each creature sacrificed this way"; } + private PlumbTheForbiddenCost(final PlumbTheForbiddenCost cost) { + super(cost); + } + @Override public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) { if (!super.pay(ability, game, source, controllerId, noMana, costToPay)) { @@ -69,4 +73,9 @@ class PlumbTheForbiddenCost extends SacrificeTargetCost { public boolean canPay(Ability ability, Ability source, UUID controllerId, Game game) { return true; } + + @Override + public PlumbTheForbiddenCost copy() { + return new PlumbTheForbiddenCost(this); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/stx/PlumbTheForbiddenTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/stx/PlumbTheForbiddenTest.java new file mode 100644 index 0000000000..323b578d48 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/stx/PlumbTheForbiddenTest.java @@ -0,0 +1,40 @@ +package org.mage.test.cards.single.stx; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author TheElk801 + */ +public class PlumbTheForbiddenTest extends CardTestPlayerBase { + + private static final String plumb = "Plumb the Forbidden"; + private static final String bear = "Grizzly Bears"; + private static final String lion = "Silvercoat Lion"; + private static final String corpse = "Walking Corpse"; + + @Test + public void testPlumbTheForbidden() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + addCard(Zone.BATTLEFIELD, playerA, bear); + addCard(Zone.BATTLEFIELD, playerA, lion); + addCard(Zone.BATTLEFIELD, playerA, corpse); + addCard(Zone.HAND, playerA, plumb); + + setChoice(playerA, String.join("^", bear, lion, corpse)); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, plumb); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + assertGraveyardCount(playerA, bear, 1); + assertGraveyardCount(playerA, lion, 1); + assertGraveyardCount(playerA, corpse, 1); + assertGraveyardCount(playerA, plumb, 1); + assertLife(playerA, 20 - 4); + assertHandCount(playerA, 4); + } +}