From 180c7dfff64cbf9c94ba8f22f3d0217afee7f8a4 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 15 Jan 2020 17:32:07 +0100 Subject: [PATCH] * Updated UnequipEventTest. --- .../mage/cards/n/NazahnReveredBladesmith.java | 2 +- .../triggers/events/UnequipEventTest.java | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/cards/n/NazahnReveredBladesmith.java b/Mage.Sets/src/mage/cards/n/NazahnReveredBladesmith.java index 6e5be1b840..b1ff992d3d 100644 --- a/Mage.Sets/src/mage/cards/n/NazahnReveredBladesmith.java +++ b/Mage.Sets/src/mage/cards/n/NazahnReveredBladesmith.java @@ -57,7 +57,7 @@ public final class NazahnReveredBladesmith extends CardImpl { // When Nazahn, Revered Bladesmith enters the battlefield, search your library for an Equipment card and reveal it. If you reveal a card named Hammer of Nazahn this way, put it onto the battlefield. Otherwise, put that card into your hand. Then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(1, 1, filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandOrOnBattlefieldEffect(target, true, true, "Hammer of Nazahn"), true)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandOrOnBattlefieldEffect(target, true, true, "Hammer of Nazahn"), false)); // Whenever an equipped creature you control attacks, you may tap target creature defending player controls. Ability ability = new AttacksCreatureYouControlTriggeredAbility(new NazahnTapEffect(), true, equippedFilter, true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/events/UnequipEventTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/events/UnequipEventTest.java index e05df894f0..afa0e4315d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/events/UnequipEventTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/events/UnequipEventTest.java @@ -65,7 +65,7 @@ public class UnequipEventTest extends CardTestPlayerBase { // Equipped creature gets +2/+0 and has indestructible. // Equip {4} addCard(Zone.LIBRARY, playerA, "Hammer of Nazahn"); - addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); // Destroy target permanent. Its controller creates a 3/3 green Beast creature token. @@ -73,17 +73,25 @@ public class UnequipEventTest extends CardTestPlayerBase { // Equipped creature gets +2/+2 and has infect. // Whenever Grafted Exoskeleton becomes unattached from a permanent, sacrifice that permanent. // Equip {2} - addCard(Zone.BATTLEFIELD, playerA, "Grafted Exoskeleton", 1); + addCard(Zone.HAND, playerA, "Grafted Exoskeleton", 1); // Artifact Equipment - {4} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nazahn, Revered Bladesmith"); - setChoice(playerA, "Hammer of Nazahn"); + addTarget(playerA, "Hammer of Nazahn"); + setChoice(playerA, "Yes"); // Put the hammer on the battlefield + setChoice(playerA, "Yes"); // Attach the hammer to a creature + addTarget(playerA, "Nazahn, Revered Bladesmith"); - activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}"); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Grafted Exoskeleton"); + setChoice(playerA, "Yes"); // Attach the Grafted Exoskeleton to a creature + addTarget(playerA, "Nazahn, Revered Bladesmith"); + castSpell(3, PhaseStep.BEGIN_COMBAT, playerA, "Beast Within", "Grafted Exoskeleton"); setStopAt(3, PhaseStep.END_COMBAT); + setStrictChooseMode(true); execute(); - + assertAllCommandsUsed(); + assertLife(playerA, 20); assertLife(playerB, 20);