Skip to content

Commit 220b87e

Browse files
committed
Prevent playing lands on NDFC backs
It should not be possible to play a land on the back of a nonmodal (transforming) double-faced card from anywhere.
1 parent 57ad574 commit 220b87e

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package org.mage.test.cards.conditional.twofaced;
2+
3+
import mage.constants.PhaseStep;
4+
import mage.constants.Zone;
5+
import org.junit.Test;
6+
import org.mage.test.serverside.base.CardTestPlayerBase;
7+
8+
/**
9+
* @author matoro
10+
*/
11+
public class TwoFacedLandAllowedTest extends CardTestPlayerBase {
12+
13+
/**
14+
* Tests that you are not allowed to play a land on the back of a transforming double-faced card.
15+
*/
16+
@Test
17+
public void testTransformingNotAllowed() {
18+
setStrictChooseMode(true);
19+
addCard(Zone.HAND, playerA, "Ojer Taq, Deepest Foundation");
20+
checkPlayableAbility("Should not be able to play land", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Play Temple of Civilization", false);
21+
setStopAt(1, PhaseStep.END_TURN);
22+
execute();
23+
}
24+
25+
/**
26+
* Tests that you are still allowed to play a land on the back of a modal double-faced card.
27+
*/
28+
@Test
29+
public void testModalAllowed() {
30+
setStrictChooseMode(true);
31+
addCard(Zone.HAND, playerA, "Sink into Stupor");
32+
checkPlayableAbility("Should be able to play land", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Play Soporific Springs", true);
33+
setStopAt(1, PhaseStep.END_TURN);
34+
execute();
35+
}
36+
37+
/**
38+
* Tests that you are still allowed to play a land on the front of a transforming double-faced card.
39+
*/
40+
@Test
41+
public void testTransformingFront() {
42+
setStrictChooseMode(true);
43+
addCard(Zone.HAND, playerA, "Balamb Garden, SeeD Academy");
44+
checkPlayableAbility("Should be able to play land", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Play Balamb Garden, SeeD Academy", true);
45+
setStopAt(1, PhaseStep.END_TURN);
46+
execute();
47+
}
48+
49+
/**
50+
* Tests that you can still transform a nonmodal double-faced card with a land on the back.
51+
*/
52+
@Test
53+
public void testActivateTransformationAllowed() {
54+
setStrictChooseMode(true);
55+
addCard(Zone.BATTLEFIELD, playerA, "Tarrian's Journal");
56+
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
57+
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}, Discard your hand: Transform {this}.");
58+
setStopAt(1, PhaseStep.END_TURN);
59+
execute();
60+
checkPermanentCount("Successfully transformed", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "The Tomb of Aclazotz", 1);
61+
}
62+
}

Mage/src/main/java/mage/cards/TransformingDoubleFacedCardHalf.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package mage.cards;
22

33
import mage.ObjectColor;
4+
import mage.abilities.Abilities;
5+
import mage.abilities.Ability;
6+
import mage.abilities.PlayLandAbility;
47
import mage.abilities.SpellAbility;
58
import mage.constants.*;
69
import mage.game.Game;
@@ -46,4 +49,16 @@ public TransformingDoubleFacedCardHalf copy() {
4649
public TransformingDoubleFacedCard getParentCard() {
4750
return (TransformingDoubleFacedCard) parentCard;
4851
}
52+
53+
@Override
54+
public Abilities<Ability> getAbilities() {
55+
final Abilities<Ability> all = super.getAbilities();
56+
57+
// lands on the back of transforming double-faced cards should not be playable
58+
if (this.isBackSide()) {
59+
all.removeIf(ability -> ability instanceof PlayLandAbility);
60+
}
61+
62+
return all;
63+
}
4964
}

0 commit comments

Comments
 (0)