Merge pull request #3294 from ingmargoudt/splitcard_cmc

fix cascade for splitcards
This commit is contained in:
Derek M 2017-05-03 07:51:08 -04:00 committed by GitHub
commit 8278b1bb2f
2 changed files with 6 additions and 11 deletions

View file

@ -202,7 +202,7 @@ public class CascadeTest extends CardTestPlayerBase {
} }
/** /**
* Cascade dont work with split cards. * Cascade work with split cards, cmc = total of halfs.
* *
* For example: Ardent Plea + Breaking/Entering * For example: Ardent Plea + Breaking/Entering
*/ */
@ -231,9 +231,9 @@ public class CascadeTest extends CardTestPlayerBase {
execute(); execute();
assertPermanentCount(playerA, "Ardent Plea", 1); assertPermanentCount(playerA, "Ardent Plea", 1);
assertGraveyardCount(playerA, "Breaking // Entering", 1); assertGraveyardCount(playerA, "Breaking // Entering", 0);
assertGraveyardCount(playerB, 8); assertGraveyardCount(playerB, 0);
} }

View file

@ -33,8 +33,6 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.Cards; import mage.cards.Cards;
import mage.cards.CardsImpl; import mage.cards.CardsImpl;
import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.ExileZone; import mage.game.ExileZone;
@ -148,11 +146,8 @@ class CascadeEffect extends OneShotEffect {
} }
private boolean cardThatCostsLess(int value, Card card, Game game) { private boolean cardThatCostsLess(int value, Card card, Game game) {
if (card instanceof SplitCard) {
return ((SplitCard) card).getLeftHalfCard().getConvertedManaCost() < value return card.getConvertedManaCost() < value;
|| ((SplitCard) card).getRightHalfCard().getConvertedManaCost() < value;
} else {
return card.getConvertedManaCost() < value;
}
} }
} }