diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VoidWinnower.java b/Mage.Sets/src/mage/sets/battleforzendikar/VoidWinnower.java index 62998554aa..474486e701 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/VoidWinnower.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VoidWinnower.java @@ -31,7 +31,6 @@ import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.RestrictionEffect; @@ -45,6 +44,7 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; +import mage.game.stack.Spell; /** * @@ -115,10 +115,10 @@ class VoidWinnowerCantCastEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - Ability ability = (Ability) getValue("targetAbility"); - if (ability != null && (ability instanceof SpellAbility)) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null) { // the low bit will always be set on an odd number. - return (((SpellAbility) ability).getConvertedManaCost() & 1) == 0; + return (spell.getConvertedManaCost() & 1) == 0; } } return false; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java index 0e045507f5..7b35f5ef6a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java @@ -47,7 +47,7 @@ public class MorphTest extends CardTestPlayerBase { * */ @Test - public void testCastMoprhCreatureWithoutMorph() { + public void testCastMorphCreatureWithoutMorph() { /* Pine Walker Creature - Elemental diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java index 50972e0851..1e55f7efd5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java @@ -110,4 +110,30 @@ public class CantCastTest extends CardTestPlayerBase { assertLife(playerB, 16); } + + @Test + public void testVoidWinnowerWithMorph() { + // Your opponent can't cast spells with even converted mana costs. (Zero is even.) + // Your opponents can't block with creatures with even converted mana costs. + addCard(Zone.BATTLEFIELD, playerB, "Void Winnower"); + /* + Pine Walker + Creature - Elemental + 5/5 + Morph {4}{G} (You may cast this card face down as a 2/2 creature for . Turn it face up any time for its morph cost.) + Whenever Pine Walker or another creature you control is turned face up, untap that creature. + */ + addCard(Zone.HAND, playerA, "Pine Walker"); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pine Walker"); + setChoice(playerA, "Yes"); // cast it face down as 2/2 creature + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "", 0); + assertHandCount(playerA, "Pine Walker", 1); + + } }