No spells cast last turn transform fix to not transform turn 1 #2188

This commit is contained in:
Eric McVicker 2016-08-23 20:05:04 -05:00
parent 2f22a45238
commit ebeb20681e
3 changed files with 38 additions and 14 deletions

View file

@ -27,6 +27,7 @@
*/
package org.mage.test.cards.abilities.keywords;
import mage.abilities.keyword.IndestructibleAbility;
import mage.constants.CardType;
import mage.constants.PhaseStep;
import mage.constants.Zone;
@ -321,4 +322,20 @@ public class TransformTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Avacyn, the Purifier", 0);
assertPermanentCount(playerA, "Archangel Avacyn", 1);
}
/**
* Cards that transform if no spells cast last turn should not transform if the cards were added on turn 1.
* This would happen with tests and cheat testing.
*/
@Test
public void testNoSpellsCastLastTurnTransformDoesNotTriggerTurn1() {
// At the beginning of each upkeep, if no spells were cast last turn, transform Hinterland Logger.
addCard(Zone.BATTLEFIELD, playerA, "Hinterland Logger");
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
assertPermanentCount(playerA, "Hinterland Logger", 1);
}
}

View file

@ -21,21 +21,21 @@ public class SurviveTheNightTest extends CardTestPlayerBase {
// Investigate
addCard(Zone.HAND, playerA, "Survive the Night");
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
addCard(Zone.BATTLEFIELD, playerA, "Bronze Sable"); // 2/1
addCard(Zone.BATTLEFIELD, playerB, "Hill Giant"); // 3/3
attack(1, playerA, "Bronze Sable");
block(1, playerB, "Hill Giant", "Bronze Sable");
castSpell(1, PhaseStep.DECLARE_BLOCKERS, playerA, "Survive the Night", "Bronze Sable");
setStopAt(1, PhaseStep.END_COMBAT);
addCard(Zone.BATTLEFIELD, playerA, "Hinterland Logger"); // 2/1
addCard(Zone.BATTLEFIELD, playerB, "Bloodbriar"); // 2/3
attack(1, playerA, "Hinterland Logger");
block(1, playerB, "Bloodbriar", "Hinterland Logger");
castSpell(1, PhaseStep.DECLARE_BLOCKERS, playerA, "Survive the Night", "Hinterland Logger");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, "Survive the Night", 1);
assertGraveyardCount(playerB, "Hill Giant", 1);
assertGraveyardCount(playerB, "Bloodbriar", 1);
assertPermanentCount(playerA, "Clue", 1);
assertPermanentCount(playerA, "Bronze Sable", 1);
assertPowerToughness(playerA, "Bronze Sable", 3, 1);
assertAbility(playerA, "Bronze Sable", IndestructibleAbility.getInstance(), true);
assertPermanentCount(playerA, "Hinterland Logger", 1);
assertPowerToughness(playerA, "Hinterland Logger", 3, 1);
assertAbility(playerA, "Hinterland Logger", IndestructibleAbility.getInstance(), true);
}
}