Some changes to restrained event handling (simultaneous events) (fixes #897).

This commit is contained in:
LevelX2 2015-04-19 10:43:12 +02:00
parent a5967d9b2a
commit 568f62c66f
8 changed files with 1023 additions and 935 deletions

View file

@ -74,16 +74,20 @@ public class DungeonGeistsTest extends CardTestPlayerBase {
public void testWithBlink() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
// When Dungeon Geists enters the battlefield, tap target creature an opponent controls.
// That creature doesn't untap during its controller's untap step for as long as you control Dungeon Geists.
addCard(Zone.HAND, playerA, "Dungeon Geists");
addCard(Zone.HAND, playerA, "Cloudshift");
addCard(Zone.BATTLEFIELD, playerB, "Craw Wurm");
addCard(Zone.BATTLEFIELD, playerB, "Elite Vanguard");
addTarget(playerA, "Craw Wurm"); // first target Craw Wurm
addTarget(playerA, "Elite Vanguard"); // after Cloudshift effect (return back to battlefield) target Elite Vanguard
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dungeon Geists");
addTarget(playerA, "Craw Wurm"); // first target Craw Wurm
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cloudshift", "Dungeon Geists");
addTarget(playerA, "Elite Vanguard"); // after Cloudshift effect (return back to battlefield) target Elite Vanguard
setStopAt(2, PhaseStep.DRAW);
execute();

View file

@ -0,0 +1,66 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.mage.test.cards.triggers.state;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class SynodCenturionTest extends CardTestPlayerBase {
/**
* Check that Synod Centurion gets sacrificed if no other artifacts are on the battlefield
*
*/
@Test
public void testAlone() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
addCard(Zone.BATTLEFIELD, playerA, "Demon's Horn");
addCard(Zone.HAND, playerA, "Shatter");
addCard(Zone.HAND, playerA, "Synod Centurion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Synod Centurion");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Shatter", "Demon's Horn");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerA, "Demon's Horn", 1);
assertGraveyardCount(playerA, "Shatter", 1);
assertGraveyardCount(playerA, "Synod Centurion", 1);
}
/**
* Check that Synod Centurion gets sacrificed if the only other
* artifact left the battlefiled for a short time
*
*/
@Test
public void testWithFlicker() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 6);
addCard(Zone.BATTLEFIELD, playerA, "Bottle Gnomes");
addCard(Zone.HAND, playerA, "Cloudshift");
addCard(Zone.HAND, playerA, "Synod Centurion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Synod Centurion");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cloudshift", "Bottle Gnomes");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Bottle Gnomes", 1);
assertGraveyardCount(playerA, "Cloudshift", 1);
assertGraveyardCount(playerA, "Synod Centurion", 1);
}
}