From e65d769e4724b113f04c66a2d3d13b10647b9799 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 12 Oct 2020 21:08:37 -0400 Subject: [PATCH] fixed Chainer, Nightmare Adept not triggering off of creatures owned by other players --- .../mage/cards/c/ChainerNightmareAdept.java | 2 +- .../single/c19/ChainerNightmareAdeptTest.java | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java b/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java index 679d07c548..9816668ce3 100644 --- a/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java +++ b/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java @@ -189,6 +189,6 @@ class ChainerNightmareAdeptTriggeredAbility extends EntersBattlefieldAllTriggere } CastFromHandWatcher watcher = game.getState().getWatcher(CastFromHandWatcher.class); - return watcher != null && !watcher.spellWasCastFromHand(event.getSourceId()); + return watcher != null && !watcher.spellWasCastFromHand(event.getTargetId()); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/c19/ChainerNightmareAdeptTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/c19/ChainerNightmareAdeptTest.java index 8f0d2f762a..95f0b712f2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/c19/ChainerNightmareAdeptTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/c19/ChainerNightmareAdeptTest.java @@ -13,6 +13,8 @@ public class ChainerNightmareAdeptTest extends CardTestPlayerBase { private static final String maaka = "Feral Maaka"; private static final String khenra = "Defiant Khenra"; private static final String rings = "Rings of Brighthearth"; + private static final String swamp = "Swamp"; + private static final String reanimate = "Reanimate"; @Test public void testChainer() { @@ -69,4 +71,26 @@ public class ChainerNightmareAdeptTest extends CardTestPlayerBase { assertLife(playerB, 20 - 2 - 2); } + + @Test + public void testChainerOpponent() { + addCard(Zone.BATTLEFIELD, playerA, chainer); + addCard(Zone.BATTLEFIELD, playerA, swamp); + addCard(Zone.HAND, playerA, reanimate); + addCard(Zone.GRAVEYARD, playerB, maaka); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, reanimate, maaka); + + attack(1, playerA, maaka); + + setStopAt(1, PhaseStep.END_TURN); + + execute(); + + assertPermanentCount(playerA, maaka, 1); + assertGraveyardCount(playerB, maaka, 0); + assertAbility(playerA, maaka, HasteAbility.getInstance(), true); + assertLife(playerA, 20 - 2); + assertLife(playerB, 20 - 2); + } }