mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +00:00
* Enduring Renewal - Fixed that the creature did not come back to hand.
This commit is contained in:
parent
753340efc6
commit
d713ae424f
3 changed files with 75 additions and 1 deletions
|
@ -61,7 +61,7 @@ public class GrindingStation extends CardImpl {
|
||||||
super(ownerId, 127, "Grinding Station", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}");
|
super(ownerId, 127, "Grinding Station", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||||
this.expansionSetCode = "5DN";
|
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 ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutTopCardOfLibraryIntoGraveTargetEffect(3), new TapSourceCost());
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
|
||||||
ability.addTarget(new TargetPlayer());
|
ability.addTarget(new TargetPlayer());
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -54,12 +54,14 @@ public class PutIntoGraveFromBattlefieldAllTriggeredAbility extends TriggeredAbi
|
||||||
super(Zone.BATTLEFIELD, effect, optional);
|
super(Zone.BATTLEFIELD, effect, optional);
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
this.onlyToControllerGraveyard = onlyToControllerGraveyard;
|
this.onlyToControllerGraveyard = onlyToControllerGraveyard;
|
||||||
|
this.setTargetPointer = setTargetPointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PutIntoGraveFromBattlefieldAllTriggeredAbility(final PutIntoGraveFromBattlefieldAllTriggeredAbility ability) {
|
public PutIntoGraveFromBattlefieldAllTriggeredAbility(final PutIntoGraveFromBattlefieldAllTriggeredAbility ability) {
|
||||||
super(ability);
|
super(ability);
|
||||||
this.filter = ability.filter;
|
this.filter = ability.filter;
|
||||||
this.onlyToControllerGraveyard = ability.onlyToControllerGraveyard;
|
this.onlyToControllerGraveyard = ability.onlyToControllerGraveyard;
|
||||||
|
this.setTargetPointer = ability.setTargetPointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue