mirror of
https://github.com/correl/mage.git
synced 2024-11-25 11:09:53 +00:00
[SNC] Fix Unlucky Witness not letting you play cards. Closes #9413.
This commit is contained in:
parent
bce70e0896
commit
473ecc3292
2 changed files with 72 additions and 1 deletions
|
@ -34,7 +34,7 @@ public final class UnluckyWitness extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// When Unlucky Witness dies, exile the top two cards of your library. Until your next end step, you may play one of those cards.
|
// When Unlucky Witness dies, exile the top two cards of your library. Until your next end step, you may play one of those cards.
|
||||||
this.addAbility(new DiesSourceTriggeredAbility(new UnluckyWitnessEffect()));
|
this.addAbility(new DiesSourceTriggeredAbility(new UnluckyWitnessEffect()), new UnluckyWitnessWatcher());
|
||||||
}
|
}
|
||||||
|
|
||||||
private UnluckyWitness(final UnluckyWitness card) {
|
private UnluckyWitness(final UnluckyWitness card) {
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
package org.mage.test.cards.single.snc;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link mage.cards.u.UnluckyWitness Unlucky Witness}
|
||||||
|
* When Unlucky Witness dies, exile the top two cards of your library.
|
||||||
|
* Until your next end step, you may play one of those cards.
|
||||||
|
*
|
||||||
|
* @author Alex-Vasile
|
||||||
|
*/
|
||||||
|
public class UnluckyWitnessTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
|
private static final String unluckyWitness = "Unlucky Witness";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reported bug: https://github.com/magefree/mage/issues/9413
|
||||||
|
* You currently can't play either of the two exiled cards
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void canPlayExiledCard() {
|
||||||
|
String murder = "Murder";
|
||||||
|
addCard(Zone.HAND, playerA, murder);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, unluckyWitness);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||||
|
|
||||||
|
addCard(Zone.LIBRARY, playerA, "Exotic Orchard", 2);
|
||||||
|
|
||||||
|
skipInitShuffling();
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, murder);
|
||||||
|
|
||||||
|
playLand(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Exotic Orchard");
|
||||||
|
|
||||||
|
execute();
|
||||||
|
assertHandCount(playerA, 0);
|
||||||
|
assertExileCount(playerA, 1);
|
||||||
|
assertExileCount(playerA, "Exotic Orchard", 1);
|
||||||
|
assertGraveyardCount(playerA, unluckyWitness, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Same as the test above, but make sure that spell can also be cast
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void canCastExiledCard() {
|
||||||
|
String murder = "Murder";
|
||||||
|
addCard(Zone.HAND, playerA, murder);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, unluckyWitness);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
|
||||||
|
|
||||||
|
addCard(Zone.LIBRARY, playerA, "Sol Ring", 2);
|
||||||
|
|
||||||
|
skipInitShuffling();
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, murder);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sol Ring");
|
||||||
|
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertGraveyardCount(playerA, unluckyWitness, 1);
|
||||||
|
assertHandCount(playerA, 0);
|
||||||
|
assertExileCount(playerA, 1);
|
||||||
|
assertPermanentCount(playerA, "Sol Ring", 1);
|
||||||
|
assertExileCount(playerA, "Sol Ring", 1);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue