* Storm Cauldron - Fixed that it wrongly also returned cards to hand that already left the battlefield (fixes #3487).

This commit is contained in:
LevelX2 2017-06-11 10:44:41 +02:00
parent a22e89d26a
commit 5cfb496899
3 changed files with 61 additions and 7 deletions

View file

@ -27,6 +27,7 @@
*/
package mage.cards.c;
import java.util.UUID;
import mage.Mana;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
@ -37,8 +38,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import java.util.UUID;
/**
*
* @author LevelX2
@ -46,11 +45,11 @@ import java.util.UUID;
public class CrystalVein extends CardImpl {
public CrystalVein(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
// {tap}: Add {C} to your mana pool.
// {T}: Add {C} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {tap}, Sacrifice Crystal Vein: Add {C}{C} to your mana pool.
// {T}, Sacrifice Crystal Vein: Add {C}{C} to your mana pool.
SimpleManaAbility ability = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);

View file

@ -0,0 +1,56 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
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 StormCauldronTest extends CardTestPlayerBase {
/**
* With Storm Cauldron in play (owned by opponent), I sacced Crystal Vein
* for 2 mana... except it got returned to my hand, which shouldn't happen.
* Haven't tested it with other sac lands yet.
*
* Relevant ruing for Storm Cauldron:
*
* 10/4/2004: If a land is tapped for mana and sacrificed all in one action,
* it goes to the graveyard before the Cauldron can return it to the
* player's hand.
*
*/
@Test
public void testLandNotReturnedToHand() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
// {T}: Add {C} to your mana pool.
// {T}, Sacrifice Crystal Vein: Add {C}{C} to your mana pool.
addCard(Zone.BATTLEFIELD, playerA, "Crystal Vein", 1);
// Each player may play an additional land during each of his or her turns.
// Whenever a land is tapped for mana, return it to its owner's hand.
addCard(Zone.BATTLEFIELD, playerB, "Storm Cauldron", 1);
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Crystal Vein");
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}, Sacrifice");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Crystal Vein", 1);
assertPermanentCount(playerA, "Mountain", 1);
assertHandCount(playerA, "Crystal Vein", 0);
}
}

View file

@ -29,7 +29,6 @@ package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -64,7 +63,7 @@ public class TapLandForManaAllTriggeredAbility extends TriggeredAbilityImpl {
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId());
if (permanent != null && permanent.isLand()) {
if (setTargetPointer) {
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
getEffects().get(0).setTargetPointer(new FixedTarget(permanent, game));
}
return true;
}