mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Merge 27a46a57db into 162edb9351
This commit is contained in:
commit
dc0915840d
3 changed files with 84 additions and 0 deletions
|
|
@ -0,0 +1,62 @@
|
|||
package org.mage.test.cards.conditional.twofaced;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author matoro
|
||||
*/
|
||||
public class TwoFacedLandAllowedTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Tests that you are not allowed to play a land on the back of a transforming double-faced card.
|
||||
*/
|
||||
@Test
|
||||
public void testTransformingNotAllowed() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.HAND, playerA, "Ojer Taq, Deepest Foundation");
|
||||
checkPlayableAbility("Should not be able to play land", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Play Temple of Civilization", false);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that you are still allowed to play a land on the back of a modal double-faced card.
|
||||
*/
|
||||
@Test
|
||||
public void testModalAllowed() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.HAND, playerA, "Sink into Stupor");
|
||||
checkPlayableAbility("Should be able to play land", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Play Soporific Springs", true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that you are still allowed to play a land on the front of a transforming double-faced card.
|
||||
*/
|
||||
@Test
|
||||
public void testTransformingFront() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.HAND, playerA, "Balamb Garden, SeeD Academy");
|
||||
checkPlayableAbility("Should be able to play land", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Play Balamb Garden, SeeD Academy", true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that you can still transform a nonmodal double-faced card with a land on the back.
|
||||
*/
|
||||
@Test
|
||||
public void testActivateTransformationAllowed() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Tarrian's Journal");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}, Discard your hand: Transform {this}.");
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
checkPermanentCount("Successfully transformed", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "The Tomb of Aclazotz", 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -2624,6 +2624,13 @@ public class VerifyCardDataTest {
|
|||
return;
|
||||
}
|
||||
|
||||
// lands on back of NDFCs *may* have only one ability
|
||||
if (card instanceof TransformingDoubleFacedCardHalf
|
||||
&& ((DoubleFacedCardHalf)card).isBackSide()
|
||||
&& card.isLand()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// additional cost go to 1 ability
|
||||
if (refLowerText.startsWith("as an additional cost to cast")) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package mage.cards;
|
||||
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.PlayLandAbility;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
|
|
@ -46,4 +49,16 @@ public class TransformingDoubleFacedCardHalf extends DoubleFacedCardHalf {
|
|||
public TransformingDoubleFacedCard getParentCard() {
|
||||
return (TransformingDoubleFacedCard) parentCard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Abilities<Ability> getAbilities() {
|
||||
final Abilities<Ability> all = super.getAbilities();
|
||||
|
||||
// lands on the back of transforming double-faced cards should not be playable
|
||||
if (this.isBackSide()) {
|
||||
all.removeIf(ability -> ability instanceof PlayLandAbility);
|
||||
}
|
||||
|
||||
return all;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue