diff --git a/Mage.Sets/src/mage/sets/fifthdawn/GrindingStation.java b/Mage.Sets/src/mage/sets/fifthdawn/GrindingStation.java index de1b9388df..5b36e9d7db 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/GrindingStation.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/GrindingStation.java @@ -61,7 +61,7 @@ public class GrindingStation extends CardImpl { super(ownerId, 127, "Grinding Station", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "5DN"; - // {tap}, Sacrifice an artifact: Target player puts the top three cards of his or her library into his or her graveyard. + // {T}, Sacrifice an artifact: Target player puts the top three cards of his or her library into his or her graveyard. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutTopCardOfLibraryIntoGraveTargetEffect(3), new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetPlayer()); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java new file mode 100644 index 0000000000..9159d14fd9 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class ReturnToHandEffectsTest extends CardTestPlayerBase { + + /** + * Enduring Renewal doesn't return creatures to hand put into graveyard from + * the battlefield It happened with Enduring Renewal in the battlefield + * while feeding Ornithopter to Grinding Station + */ + @Test + public void testEnduringRenewal() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + // Play with your hand revealed. + // If you would draw a card, reveal the top card of your library instead. If it's a creature card, put it into your graveyard. Otherwise, draw a card. + // Whenever a creature is put into your graveyard from the battlefield, return it to your hand. + addCard(Zone.BATTLEFIELD, playerA, "Enduring Renewal"); + + // {T}, Sacrifice an artifact: Target player puts the top three cards of his or her library into his or her graveyard. + // Whenever an artifact enters the battlefield, you may untap Grinding Station. + addCard(Zone.BATTLEFIELD, playerA, "Grinding Station", 1); + addCard(Zone.BATTLEFIELD, playerA, "Ornithopter", 1); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}, Sacrifice an artifact", playerB); + // addTarget(playerA, "Ornithopter"); + setChoice(playerA, "Ornithopter"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, 3); + assertHandCount(playerA, "Ornithopter", 1); + + } + +} diff --git a/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java b/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java index be6495f8c9..45b41aec3e 100644 --- a/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java @@ -54,12 +54,14 @@ public class PutIntoGraveFromBattlefieldAllTriggeredAbility extends TriggeredAbi super(Zone.BATTLEFIELD, effect, optional); this.filter = filter; this.onlyToControllerGraveyard = onlyToControllerGraveyard; + this.setTargetPointer = setTargetPointer; } public PutIntoGraveFromBattlefieldAllTriggeredAbility(final PutIntoGraveFromBattlefieldAllTriggeredAbility ability) { super(ability); this.filter = ability.filter; this.onlyToControllerGraveyard = ability.onlyToControllerGraveyard; + this.setTargetPointer = ability.setTargetPointer; } @Override