Adds two tests on Transform+card changing effects (#11334)

* Adds two tests on interactions between card-changing effects and Transform. One works, the other currently fails.

* add check that moonmist flip worked
This commit is contained in:
ssk97 2023-10-24 16:03:05 -07:00 committed by GitHub
parent f3a4dc4d5f
commit 5e3c0764a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.stack.Spell;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
@ -238,6 +239,27 @@ public class DisturbTest extends CardTestPlayerBase {
assertTappedCount("Plains", true, 5);
}
//Currently failing: Transform SpellAbilityCastMode.getTypeModifiedCardObjectCopy destroys existing modifications
@Ignore
@Test
public void test_SpellAttributesIndirectCostModifications() {
// Disturb {1}{U}
// Hook-Haunt Drifter
addCard(Zone.GRAVEYARD, playerA, "Baithook Angler", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
addCard(Zone.BATTLEFIELD, playerA, "Maskwood Nexus", 1);
//Dragonlord's Servant : Dragon spells you cast cost {1} less to cast.
addCard(Zone.BATTLEFIELD, playerA, "Dragonlord's Servant", 1);
// Transform's copy effect must not override other spell modifications
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Hook-Haunt Drifter using Disturb");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Hook-Haunt Drifter", 1);
assertTappedCount("Island", true, 1);
}
/**
* Relevant rule:
* If you copy a permanent spell cast this way (perhaps with a card like Double Major), the copy becomes

View file

@ -494,4 +494,31 @@ public class TransformTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Delver of Secrets", 1);
assertPermanentCount(playerA, "Insectile Aberration", 0);
}
@Test
public void testMoonmistHuntmasterDressdown() {
addCard(Zone.BATTLEFIELD, playerA, "Tropical Island", 6);
addCard(Zone.BATTLEFIELD, playerA, "Huntmaster of the Fells"); //Has on-transform triggers
addCard(Zone.BATTLEFIELD, playerA, "Maskwood Nexus"); //Make back side human
addCard(Zone.HAND, playerA, "Dress Down"); //Creatures lose all abilities
addCard(Zone.HAND, playerA, "Moonmist", 2);
castSpell(1, PhaseStep.UPKEEP, playerA, "Dress Down");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Moonmist");
checkPermanentCount("Huntmaster flipped", 1, PhaseStep.BEGIN_COMBAT, playerA, "Ravager of the Fells", 1);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Moonmist");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertGraveyardCount(playerA, "Dress Down", 1);
assertPermanentCount(playerA, "Huntmaster of the Fells", 1);
assertPermanentCount(playerA, 6+1+1);
}
}