diff --git a/Mage.Sets/src/mage/cards/s/SteelGolem.java b/Mage.Sets/src/mage/cards/s/SteelGolem.java index 99315c240b0..33467159101 100644 --- a/Mage.Sets/src/mage/cards/s/SteelGolem.java +++ b/Mage.Sets/src/mage/cards/s/SteelGolem.java @@ -28,18 +28,16 @@ package mage.cards.s; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.filter.common.FilterCreatureSpell; +import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.stack.Spell; /** * @@ -70,8 +68,6 @@ public class SteelGolem extends CardImpl { class SteelGolemEffect extends ContinuousRuleModifyingEffectImpl { - private static final FilterCreatureSpell filter = new FilterCreatureSpell(); - public SteelGolemEffect() { super(Duration.WhileOnBattlefield, Outcome.Detriment); staticText = "You can't cast creature spells"; @@ -94,10 +90,8 @@ class SteelGolemEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getPlayerId().equals(source.getControllerId())) { - Spell spell = game.getStack().getSpell(event.getSourceId()); - if (spell != null && filter.match(spell, game)) { - return true; - } + Card card = game.getCard(event.getSourceId()); + return card != null && card.getCardType().contains(CardType.CREATURE); } return false; } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java index 67d160b6b8b..cad199d155f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java @@ -105,4 +105,36 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Mutavault", 1); } + + /** + * Steel Golem, once Donate'd to another player does not disable their ability to play creature cards. + */ + @Test + public void testDonateSteelGolem() { + // You can't cast creature spells. + addCard(Zone.HAND, playerA, "Steel Golem", 1); // Creature 3/4 {3} + // Target player gains control of target permanent you control. + addCard(Zone.HAND, playerA, "Donate", 1); // Sorcery {2}{U} + addCard(Zone.BATTLEFIELD, playerA, "Island", 6); + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + addCard(Zone.HAND, playerB, "Silvercoat Lion", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Steel Golem"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Donate", playerB); + addTarget(playerA, "Steel Golem"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Silvercoat Lion"); + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Donate", 1); + assertPermanentCount(playerA, "Steel Golem", 0); + assertPermanentCount(playerB, "Steel Golem", 1); + assertPermanentCount(playerB, "Silvercoat Lion", 0); + assertHandCount(playerB, "Silvercoat Lion", 1); + + } + }