Fix March of the Machines

Add a DependencyType for ArtifactAddingRemoving and use it to make March of the Machines come after artifact type adding effects.
This commit is contained in:
Dilnu 2016-11-22 08:40:54 -05:00
parent 9ff3e2c670
commit 3198558dd6
4 changed files with 22 additions and 1 deletions

View file

@ -76,6 +76,7 @@ class MarchOfTheMachinesEffect extends ContinuousEffectImpl {
public MarchOfTheMachinesEffect() { public MarchOfTheMachinesEffect() {
super(Duration.WhileOnBattlefield, Outcome.BecomeCreature); super(Duration.WhileOnBattlefield, Outcome.BecomeCreature);
staticText = "Each noncreature artifact is an artifact creature with power and toughness each equal to its converted mana cost"; staticText = "Each noncreature artifact is an artifact creature with power and toughness each equal to its converted mana cost";
dependendToType = DependencyType.ArtifactAddingRemoving;
} }
public MarchOfTheMachinesEffect(final MarchOfTheMachinesEffect effect) { public MarchOfTheMachinesEffect(final MarchOfTheMachinesEffect effect) {

View file

@ -127,5 +127,22 @@ public class MarchOfTheMachinesTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Accorder's Shield", 0); assertPermanentCount(playerA, "Accorder's Shield", 0);
assertGraveyardCount(playerA, "Accorder's Shield", 1); assertGraveyardCount(playerA, "Accorder's Shield", 1);
} }
@Test
public void testLiquimetalCoatingLandIsDestroyed() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
addCard(Zone.BATTLEFIELD, playerA, "Forest");
addCard(Zone.BATTLEFIELD, playerA, "Liquimetal Coating");
addCard(Zone.HAND, playerA, "March of the Machines");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "March of the Machines");
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Target permanent", "Forest");
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Forest", 0);
assertGraveyardCount(playerA, "Forest", 1);
}
} }

View file

@ -52,6 +52,8 @@ public class AddCardTypeTargetEffect extends ContinuousEffectImpl {
this.addedCardType = addedCardType; this.addedCardType = addedCardType;
if (addedCardType.equals(CardType.ENCHANTMENT)) { if (addedCardType.equals(CardType.ENCHANTMENT)) {
dependencyTypes.add(DependencyType.EnchantmentAddingRemoving); dependencyTypes.add(DependencyType.EnchantmentAddingRemoving);
} else if (addedCardType.equals(CardType.ARTIFACT)) {
dependencyTypes.add(DependencyType.ArtifactAddingRemoving);
} }
} }

View file

@ -41,6 +41,7 @@ package mage.constants;
public enum DependencyType { public enum DependencyType {
AuraAddingRemoving, AuraAddingRemoving,
ArtifactAddingRemoving,
BecomeForest, BecomeForest,
BecomeIsland, BecomeIsland,
BecomeMountain, BecomeMountain,