From 8ab0b487f3bb174c7e33aca9278361a8a816cd24 Mon Sep 17 00:00:00 2001 From: Iain Monro Date: Thu, 15 Aug 2019 09:18:28 +0100 Subject: [PATCH] #5938 Make Identity Thief's ability optional --- Mage.Sets/src/mage/cards/i/IdentityThief.java | 2 +- .../optional/IdentityThiefTests.java | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/optional/IdentityThiefTests.java diff --git a/Mage.Sets/src/mage/cards/i/IdentityThief.java b/Mage.Sets/src/mage/cards/i/IdentityThief.java index 7003539065..0f8c589fb5 100644 --- a/Mage.Sets/src/mage/cards/i/IdentityThief.java +++ b/Mage.Sets/src/mage/cards/i/IdentityThief.java @@ -62,7 +62,7 @@ public final class IdentityThief extends CardImpl { class IdentityThiefAbility extends TriggeredAbilityImpl { public IdentityThiefAbility() { - super(Zone.BATTLEFIELD, null); + super(Zone.BATTLEFIELD, null, true); this.addEffect(new IdentityThiefEffect()); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/optional/IdentityThiefTests.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/optional/IdentityThiefTests.java new file mode 100644 index 0000000000..668521023a --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/optional/IdentityThiefTests.java @@ -0,0 +1,39 @@ +package org.mage.test.cards.abilities.optional; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +public class IdentityThiefTests extends CardTestPlayerBase { + + @Test + public void shouldntExileIfAbilityDeclined() { + addCard(Zone.BATTLEFIELD, playerA, "Identity Thief"); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + + attack(1, playerA, "Identity Thief"); + setChoice(playerA, "No"); + + setStopAt(1, PhaseStep.DECLARE_BLOCKERS); + execute(); + + assertExileCount("Silvercoat Lion", 0); + assertPermanentCount(playerB, "Silvercoat Lion", 1); + } + + @Test + public void shouldExileIfAbilityChosen() { + addCard(Zone.BATTLEFIELD, playerA, "Identity Thief"); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + + attack(1, playerA, "Identity Thief"); + setChoice(playerA, "Yes"); + + setStopAt(1, PhaseStep.DECLARE_BLOCKERS); + execute(); + + assertExileCount("Silvercoat Lion", 1); + assertPermanentCount(playerB, "Silvercoat Lion", 0); + } +}