Search in sources :

Example 1 with YouControlYourOpponentsWhileSearchingReplacementEffect

use of mage.abilities.effects.common.replacement.YouControlYourOpponentsWhileSearchingReplacementEffect in project mage by magefree.

the class TakeControlWhileSearchingLibraryTest method test_SimpleSearchingLibrary_TakeControl.

@Test
public void test_SimpleSearchingLibrary_TakeControl() {
    removeAllCardsFromLibrary(playerA);
    removeAllCardsFromLibrary(playerB);
    addCard(Zone.LIBRARY, playerA, "Balduvian Bears", 1);
    addCard(Zone.LIBRARY, playerB, "Kitesail Corsair", 1);
    // 
    // Search your library for up to three creature cards and put them into your graveyard. Then shuffle your library.
    // {2}{B}
    addCard(Zone.HAND, playerA, "Buried Alive", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
    // 
    // You control your opponents while they’re searching their libraries.
    addCustomCardWithAbility("control", playerB, new SimpleStaticAbility(new YouControlYourOpponentsWhileSearchingReplacementEffect()));
    // 
    addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
    // before
    checkGraveyardCount("before a", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears", 0);
    checkGraveyardCount("before b", 1, PhaseStep.PRECOMBAT_MAIN, playerB, "Kitesail Corsair", 0);
    // search under control of B
    activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {B}", 3);
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Buried Alive");
    // continue
    setChoice(playerB, true);
    // player B must take control for searching
    addTarget(playerB, "Balduvian Bears");
    waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
    // after
    checkGraveyardCount("after a", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears", 1);
    checkGraveyardCount("after b", 1, PhaseStep.PRECOMBAT_MAIN, playerB, "Kitesail Corsair", 0);
    // check that control returned
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt");
    addTarget(playerA, playerB);
    setStrictChooseMode(true);
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
}
Also used : YouControlYourOpponentsWhileSearchingReplacementEffect(mage.abilities.effects.common.replacement.YouControlYourOpponentsWhileSearchingReplacementEffect) SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) Test(org.junit.Test)

Aggregations

SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)1 YouControlYourOpponentsWhileSearchingReplacementEffect (mage.abilities.effects.common.replacement.YouControlYourOpponentsWhileSearchingReplacementEffect)1 Test (org.junit.Test)1