From 9da97f936875ad2ee022a80054a3fa932da5155a Mon Sep 17 00:00:00 2001 From: igoudt Date: Wed, 3 May 2017 09:51:22 +0200 Subject: [PATCH] fix cascade for splitcards --- .../test/cards/abilities/keywords/CascadeTest.java | 6 +++--- .../java/mage/abilities/keyword/CascadeAbility.java | 11 +++-------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CascadeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CascadeTest.java index 3618d4230b..78d880e6d9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CascadeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CascadeTest.java @@ -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 */ @@ -231,9 +231,9 @@ public class CascadeTest extends CardTestPlayerBase { execute(); assertPermanentCount(playerA, "Ardent Plea", 1); - assertGraveyardCount(playerA, "Breaking // Entering", 1); + assertGraveyardCount(playerA, "Breaking // Entering", 0); - assertGraveyardCount(playerB, 8); + assertGraveyardCount(playerB, 0); } diff --git a/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java b/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java index 2eafa6a21f..6133ddc933 100644 --- a/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java @@ -33,8 +33,6 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; -import mage.cards.SplitCard; -import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.game.ExileZone; @@ -148,11 +146,8 @@ class CascadeEffect extends OneShotEffect { } private boolean cardThatCostsLess(int value, Card card, Game game) { - if (card instanceof SplitCard) { - return ((SplitCard) card).getLeftHalfCard().getConvertedManaCost() < value - || ((SplitCard) card).getRightHalfCard().getConvertedManaCost() < value; - } else { - return card.getConvertedManaCost() < value; - } + + return card.getConvertedManaCost() < value; + } }