diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java index 2e7f90fdfa0..d669602b0bd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java @@ -328,4 +328,39 @@ public class KickerTest extends CardTestPlayerBase { } + /** + * Check that kicker condition does also work for kicker cards with multiple + * kicker options + * + */ + @Test + public void testKickerCondition() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + + // Kicker {1}{G} and/or {2}{U} + // When {this} enters the battlefield, if it was kicked with its {1}{G} kicker, destroy target creature with flying. + // When {this} enters the battlefield, if it was kicked with its {2}{U} kicker, draw two cards. + addCard(Zone.HAND, playerA, "Sunscape Battlemage", 1); // 2/2 {2}{W} + + addCard(Zone.BATTLEFIELD, playerB, "Birds of Paradise", 1); + addCard(Zone.BATTLEFIELD, playerB, "Island", 1); + // Counter target spell if it was kicked. + addCard(Zone.HAND, playerB, "Ertai's Trickery", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sunscape Battlemage"); + addTarget(playerA, "Birds of Paradise"); + setChoice(playerA, "Yes"); // {1}{G} destroy target creature with flying + setChoice(playerA, "Yes"); // {2}{U} draw two cards + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Ertai's Trickery", "Sunscape Battlemage"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerB, "Birds of Paradise", 1); + assertGraveyardCount(playerB, "Ertai's Trickery", 1); + assertGraveyardCount(playerA, "Sunscape Battlemage", 1); + + } } diff --git a/Mage/src/mage/abilities/keyword/KickerAbility.java b/Mage/src/mage/abilities/keyword/KickerAbility.java index 48d33e124b9..bab41782814 100644 --- a/Mage/src/mage/abilities/keyword/KickerAbility.java +++ b/Mage/src/mage/abilities/keyword/KickerAbility.java @@ -158,8 +158,17 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo public boolean isKicked(Game game, Ability source, String costText) { String key = getActivationKey(source, costText, game); - if (activations.containsKey(key)) { - return activations.get(key) > 0; + if (kickerCosts.size() > 1) { + for (String activationKey : activations.keySet()) { + if (activationKey.startsWith(key) && activations.get(activationKey) > 0) { + return true; + } + } + } else { + if (activations.containsKey(key)) { + return activations.get(key) > 0; + + } } return false; }