#5938 Make Identity Thief's ability optional

This commit is contained in:
Iain Monro 2019-08-15 09:18:28 +01:00
parent e53ce49327
commit 8ab0b487f3
2 changed files with 40 additions and 1 deletions

View file

@ -62,7 +62,7 @@ public final class IdentityThief extends CardImpl {
class IdentityThiefAbility extends TriggeredAbilityImpl { class IdentityThiefAbility extends TriggeredAbilityImpl {
public IdentityThiefAbility() { public IdentityThiefAbility() {
super(Zone.BATTLEFIELD, null); super(Zone.BATTLEFIELD, null, true);
this.addEffect(new IdentityThiefEffect()); this.addEffect(new IdentityThiefEffect());
} }

View file

@ -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);
}
}