Search in sources :

Example 11 with SimpleStaticAbility

use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.

the class EndOfTurnMultiOpponentsTest method test_EndOfTurnMulti.

@Test
public void test_EndOfTurnMulti() {
    // Player order: A -> D -> C -> B
    addCustomCardWithAbility("boost1", playerA, new SimpleStaticAbility(Zone.ALL, new BoostAllEffect(1, 1, Duration.EndOfTurn)));
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 1, playerA, true, PhaseStep.END_TURN);
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 2, playerD, true, null);
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 3, playerC, true, null);
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 4, playerB, true, null);
    // 
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 5, playerA, true, null);
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 6, playerD, true, null);
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 7, playerC, true, null);
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 8, playerB, true, null);
    // 
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 9, playerA, true, null);
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 10, playerD, true, null);
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 11, playerC, true, null);
    EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.EndOfTurn effect", 12, playerB, true, null);
    addCard(Zone.BATTLEFIELD, playerA, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerB, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerC, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerD, cardBear2, 1);
    attack(1, playerA, cardBear2);
    attack(2, playerD, cardBear2);
    attack(3, playerC, cardBear2);
    attack(4, playerB, cardBear2);
    // 
    attack(5, playerA, cardBear2);
    attack(6, playerD, cardBear2);
    attack(7, playerC, cardBear2);
    attack(8, playerB, cardBear2);
    // 
    attack(9, playerA, cardBear2);
    attack(10, playerD, cardBear2);
    attack(11, playerC, cardBear2);
    attack(12, playerB, cardBear2);
    setStopAt(12, PhaseStep.CLEANUP);
    setStrictChooseMode(true);
    execute();
    assertAllCommandsUsed();
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) BoostAllEffect(mage.abilities.effects.common.continuous.BoostAllEffect) Test(org.junit.Test)

Example 12 with SimpleStaticAbility

use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.

the class EndOfTurnOneOpponentTest method test_EndOfTurnSingle.

@Test
public void test_EndOfTurnSingle() {
    addCustomCardWithAbility("boost1", playerA, new SimpleStaticAbility(Zone.ALL, new BoostAllEffect(1, 1, Duration.EndOfTurn)));
    prepareStepChecks(this, "Duration.EndOfTurn effect", 1, playerA, true, PhaseStep.END_TURN);
    prepareStepChecks(this, "Duration.EndOfTurn effect", 2, playerA, true, null);
    prepareStepChecks(this, "Duration.EndOfTurn effect", 3, playerA, true, null);
    prepareStepChecks(this, "Duration.EndOfTurn effect", 4, playerA, true, null);
    addCard(Zone.BATTLEFIELD, playerA, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerB, cardBear2, 1);
    attack(1, playerA, cardBear2);
    attack(2, playerB, cardBear2);
    attack(3, playerA, cardBear2);
    attack(4, playerB, cardBear2);
    setStopAt(4, PhaseStep.CLEANUP);
    setStrictChooseMode(true);
    execute();
    assertAllCommandsUsed();
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) BoostAllEffect(mage.abilities.effects.common.continuous.BoostAllEffect) Test(org.junit.Test)

Example 13 with SimpleStaticAbility

use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.

the class PlayerLeavesGameTest method test_EndOfTurnMultiLeave.

@Test
public void test_EndOfTurnMultiLeave() {
    // Player order: A -> D -> C -> B
    addCustomCardWithAbility("boost", playerA, new SimpleStaticAbility(Zone.ALL, new BoostAllEffect(1, 1, Duration.EndOfTurn)));
    addCard(Zone.BATTLEFIELD, playerA, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerB, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerC, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerD, cardBear2, 1);
    // player A leaves game on turn 1 - postcombat
    // end of turn effect must continue until end of turn
    concede(1, PhaseStep.POSTCOMBAT_MAIN, playerA);
    checkPT("turn 1", 1, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 3, 3);
    checkPT("turn 1", 1, PhaseStep.POSTCOMBAT_MAIN, playerD, cardBear2, 3, 3);
    checkPT("turn 1", 1, PhaseStep.END_TURN, playerD, cardBear2, 3, 3);
    checkPT("turn 2", 2, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 2, 2);
    setStopAt(2, PhaseStep.CLEANUP);
    setStrictChooseMode(true);
    execute();
    assertAllCommandsUsed();
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) BoostAllEffect(mage.abilities.effects.common.continuous.BoostAllEffect) Test(org.junit.Test)

Example 14 with SimpleStaticAbility

use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.

the class PlayerLeavesGameTest method prepareAndRunUntilYourTurnLeaveTest.

private void prepareAndRunUntilYourTurnLeaveTest(Duration duration) {
    // Player order: A -> D -> C -> B
    addCustomCardWithAbility("boost", playerA, new SimpleStaticAbility(Zone.ALL, new BoostAllEffect(1, 1, duration)));
    addCard(Zone.BATTLEFIELD, playerA, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerB, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerC, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerD, cardBear2, 1);
    // 800.4k  When a player leaves the game, any continuous effects with durations that last until
    // that player’s next turn or until a specific point in that turn will last until that turn would have begun.
    // They neither expire immediately nor last indefinitely.
    // player A leaves game on turn 1 - postcombat
    // until your next turn effect must continue until START of your possible next turn
    concede(1, PhaseStep.POSTCOMBAT_MAIN, playerA);
    checkPT(duration.name() + " - turn 1 pre", 1, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 3, 3);
    checkPermanentCount(duration.name() + " - perm A must exists before leave", 1, PhaseStep.PRECOMBAT_MAIN, playerD, playerA, "boost", 1);
    checkPT(duration.name() + " - turn 1 post", 1, PhaseStep.POSTCOMBAT_MAIN, playerD, cardBear2, 3, 3);
    checkPermanentCount(duration.name() + " - perm A must removed after leave", 1, PhaseStep.POSTCOMBAT_MAIN, playerD, playerA, "boost", 0);
    checkPT(duration.name() + " - turn 1 end", 1, PhaseStep.END_TURN, playerD, cardBear2, 3, 3);
    checkPT(duration.name() + " - turn 2", 2, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 3, 3);
    checkPT(duration.name() + " - turn 3", 3, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 3, 3);
    checkPT(duration.name() + " - turn 4", 4, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 3, 3);
    checkPT(duration.name() + " - turn 5 (possible A)", 5, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 2, 2);
    setStopAt(5, PhaseStep.CLEANUP);
    setStrictChooseMode(true);
    execute();
    assertAllCommandsUsed();
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) BoostAllEffect(mage.abilities.effects.common.continuous.BoostAllEffect)

Example 15 with SimpleStaticAbility

use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.

the class PlayerLeavesGameTest method prepareAndRunLeaveGameWithLongEffectTest.

private void prepareAndRunLeaveGameWithLongEffectTest(Duration duration) {
    // Player order: A -> D -> C -> B
    addCard(Zone.BATTLEFIELD, playerA, cardBear2, 1);
    addCard(Zone.BATTLEFIELD, playerD, cardBear2, 1);
    addCustomCardWithAbility("effect", playerA, new SimpleStaticAbility(new BoostAllEffect(1, 1, duration)));
    // B must checks A for online status
    // 1
    checkPlayerInGame(duration.toString() + " - turn 1", 1, PhaseStep.PRECOMBAT_MAIN, playerD, playerA, true);
    checkPermanentCount(duration.name() + " - turn 1", 1, PhaseStep.PRECOMBAT_MAIN, playerD, playerA, cardBear2, 1);
    checkPT(duration.name() + " - turn 1", 1, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 3, 3);
    // 2
    checkPlayerInGame(duration.name() + " - turn 2", 2, PhaseStep.PRECOMBAT_MAIN, playerD, playerA, true);
    checkPermanentCount(duration.name() + " - turn 2", 2, PhaseStep.PRECOMBAT_MAIN, playerD, playerA, cardBear2, 1);
    checkPT(duration.name() + " - turn 2", 2, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 3, 3);
    // 3
    checkPlayerInGame(duration.name() + " - turn 3 before", 3, PhaseStep.PRECOMBAT_MAIN, playerD, playerA, true);
    checkPermanentCount(duration.name() + " - turn 3 before", 3, PhaseStep.PRECOMBAT_MAIN, playerD, playerA, cardBear2, 1);
    checkPT(duration.name() + " - turn 3 before", 3, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 3, 3);
    // 
    concede(3, PhaseStep.POSTCOMBAT_MAIN, playerA);
    // 
    checkPlayerInGame(duration.name() + " - turn 3 after", 3, PhaseStep.END_TURN, playerD, playerA, false);
    checkPermanentCount(duration.name() + " - turn 3 after", 3, PhaseStep.END_TURN, playerD, playerA, cardBear2, 0);
    checkPT(duration.name() + " - turn 3 after", 3, PhaseStep.END_TURN, playerD, cardBear2, 2, 2);
    // 4
    checkPlayerInGame(duration.name() + " - turn 4", 4, PhaseStep.PRECOMBAT_MAIN, playerD, playerA, false);
    checkPermanentCount(duration.name() + " - turn 4", 4, PhaseStep.PRECOMBAT_MAIN, playerD, playerA, cardBear2, 0);
    checkPT(duration.name() + " - turn 4", 4, PhaseStep.PRECOMBAT_MAIN, playerD, cardBear2, 2, 2);
    setStopAt(4, PhaseStep.CLEANUP);
    setStrictChooseMode(true);
    execute();
    assertAllCommandsUsed();
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) BoostAllEffect(mage.abilities.effects.common.continuous.BoostAllEffect)

Aggregations

SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)61 Test (org.junit.Test)27 Ability (mage.abilities.Ability)21 Player (mage.players.Player)14 Permanent (mage.game.permanent.Permanent)11 InfoEffect (mage.abilities.effects.common.InfoEffect)10 BoostAllEffect (mage.abilities.effects.common.continuous.BoostAllEffect)10 GainAbilityTargetEffect (mage.abilities.effects.common.continuous.GainAbilityTargetEffect)9 Card (mage.cards.Card)9 FixedTarget (mage.target.targetpointer.FixedTarget)9 UUID (java.util.UUID)8 LeavesBattlefieldTriggeredAbility (mage.abilities.common.LeavesBattlefieldTriggeredAbility)6 ContinuousEffect (mage.abilities.effects.ContinuousEffect)6 GainLifeEffect (mage.abilities.effects.common.GainLifeEffect)6 FilterCard (mage.filter.FilterCard)5 MageObject (mage.MageObject)4 DamageTargetEffect (mage.abilities.effects.common.DamageTargetEffect)4 PreventAllDamageToAllEffect (mage.abilities.effects.common.PreventAllDamageToAllEffect)4 BoostSourceEffect (mage.abilities.effects.common.continuous.BoostSourceEffect)4 AbilitiesCostReductionControllerEffect (mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect)4