diff --git a/Mage.Sets/src/mage/cards/w/Warbringer.java b/Mage.Sets/src/mage/cards/w/Warbringer.java index 72002ebaf8..69ca1b7b81 100644 --- a/Mage.Sets/src/mage/cards/w/Warbringer.java +++ b/Mage.Sets/src/mage/cards/w/Warbringer.java @@ -9,6 +9,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.DashedCondition; import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.abilities.keyword.DashAbility; +import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -69,8 +70,14 @@ class WarbringerSpellsCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify instanceof SpellAbility) { - if (abilityToModify.isControlledBy(source.getControllerId())) { + if (abilityToModify instanceof SpellAbility + && abilityToModify.isControlledBy(source.getControllerId())) { + if (game != null && game.inCheckPlayableState()) { + Card card = game.getCard(source.getSourceId()); + if (card != null) { + return card.getAbilities(game).stream().anyMatch(a -> a instanceof DashAbility); + } + } else { return DashedCondition.instance.apply(game, abilityToModify); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DashTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DashTest.java index 290b579e91..f4e6f61b7f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DashTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DashTest.java @@ -117,4 +117,20 @@ public class DashTest extends CardTestPlayerBase { assertHandCount(playerA, "Screamreach Brawler", 0); assertAbility(playerA, "Screamreach Brawler", HasteAbility.getInstance(), true); } + + @Test + public void testWarbringerCostReduction() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerA, "Warbringer"); + addCard(Zone.HAND, playerA, "Warbringer"); + + setStrictChooseMode(true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Warbringer"); + setChoice(playerA, true); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Warbringer", 2); + assertHandCount(playerA, "Warbringer", 0); + } } diff --git a/Mage/src/main/java/mage/abilities/condition/common/DashedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/DashedCondition.java index dd7c1e8790..640cdb6bd7 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/DashedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/DashedCondition.java @@ -26,4 +26,4 @@ public enum DashedCondition implements Condition { } return false; } -} \ No newline at end of file +}