From 3044bf2e2313bd5a679b9dbd31a6768ac68400f3 Mon Sep 17 00:00:00 2001 From: Grath <1895280+Grath@users.noreply.github.com> Date: Fri, 27 Jan 2023 22:10:03 -0500 Subject: [PATCH] Fix Twinning Staff to only happen when one or more copies would be made, and not zero. (#9843) * Fix Twinning Staff to only apply when you're copying the spell at least one time. * Fix test so it works --- Mage.Sets/src/mage/cards/t/TwinningStaff.java | 3 ++- .../cards/single/c20/TwinningStaffTest.java | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/t/TwinningStaff.java b/Mage.Sets/src/mage/cards/t/TwinningStaff.java index 75ccd4506d..718392a8b0 100644 --- a/Mage.Sets/src/mage/cards/t/TwinningStaff.java +++ b/Mage.Sets/src/mage/cards/t/TwinningStaff.java @@ -82,7 +82,8 @@ class TwinningStaffEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { return event.getPlayerId().equals(source.getControllerId()) - && game.getSpellOrLKIStack(event.getTargetId()) != null; + && game.getSpellOrLKIStack(event.getTargetId()) != null + && event.getAmount() >= 1; } @Override diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/TwinningStaffTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/TwinningStaffTest.java index 7d4b1a1d06..a03aeb2ad5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/TwinningStaffTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/TwinningStaffTest.java @@ -85,4 +85,21 @@ public class TwinningStaffTest extends CardTestPlayerBase { assertGraveyardCount(playerA, bear, 1); assertGraveyardCount(playerA, elite, 1); } + + @Test + public void testThousandYearStormZeroCopies() { + addCard(Zone.BATTLEFIELD, playerA, "Badlands", 2); + addCard(Zone.BATTLEFIELD, playerA, "Thousand-Year Storm"); + addCard(Zone.BATTLEFIELD, playerA, staff); + addCard(Zone.HAND, playerA, "Lightning Bolt", 2); + + castSpell(1, PhaseStep.UPKEEP, playerA, "Lightning Bolt", playerB); + checkLife("before", 1, PhaseStep.PRECOMBAT_MAIN, playerB, 20 - 3); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + setStrictChooseMode(false); + checkLife("copy", 1, PhaseStep.END_COMBAT, playerB, 20 - 3 - 3 * 3); + setStopAt(1, PhaseStep.END_TURN); + execute(); + } }