1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-13 09:11:06 -09:00

Fixed that the Genju enchantments did not return to hand from graveyard.

This commit is contained in:
LevelX2 2016-01-28 17:30:58 +01:00
parent 990839e9f8
commit cb7becdeca
9 changed files with 157 additions and 82 deletions
Mage.Sets/src/mage/sets
Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies
Mage/src/main/java/mage/abilities/effects/common

View file

@ -28,11 +28,6 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAttachedTriggeredAbility;
@ -44,7 +39,11 @@ import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
@ -56,18 +55,18 @@ import mage.target.common.TargetLandPermanent;
* @author LevelX2
*/
public class GenjuOfTheCedars extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Forest");
static {
filter.add(new SubtypePredicate("Forest"));
}
public GenjuOfTheCedars(UUID ownerId) {
super(ownerId, 126, "Genju of the Cedars", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.expansionSetCode = "BOK";
this.subtype.add("Aura");
// Enchant Forest
TargetPermanent auraTarget = new TargetLandPermanent(filter);
this.getSpellAbility().addTarget(auraTarget);
@ -76,13 +75,13 @@ public class GenjuOfTheCedars extends CardImpl {
this.addAbility(ability);
// {2}: Enchanted Forest becomes a 4/4 green Spirit creature until end of turn. It's still a land.
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new SpiritToken(), "Enchanted Forest becomes a 4/4 green Spirit creature until end of turn. It's still a land", Duration.EndOfTurn),new GenericManaCost(2));
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new SpiritToken(), "Enchanted Forest becomes a 4/4 green Spirit creature until end of turn. It's still a land", Duration.EndOfTurn), new GenericManaCost(2));
this.addAbility(ability2);
// When enchanted Forest is put into a graveyard, you may return Genju of the Cedars from your graveyard to your hand.
Effect effect = new ReturnToHandSourceEffect();
// When enchanted Forest is put into a graveyard, you may return Genju of the Cedars from your graveyard to your hand.
Effect effect = new ReturnToHandSourceEffect(false, true);
effect.setText("you may return {this} from your graveyard to your hand");
Ability ability3 = new DiesAttachedTriggeredAbility(effect , "enchanted Forest", true, false);
Ability ability3 = new DiesAttachedTriggeredAbility(effect, "enchanted Forest", true, false);
this.addAbility(ability3);
}
@ -96,6 +95,7 @@ public class GenjuOfTheCedars extends CardImpl {
}
private class SpiritToken extends Token {
SpiritToken() {
super("", "4/4 green Spirit creature");
cardType.add(CardType.CREATURE);

View file

@ -28,11 +28,6 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAttachedTriggeredAbility;
@ -44,7 +39,11 @@ import mage.abilities.effects.common.continuous.BecomesCreatureAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
@ -56,31 +55,31 @@ import mage.target.common.TargetLandPermanent;
* @author LevelX2
*/
public class GenjuOfTheFalls extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Island");
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Island");
static {
filter.add(new SubtypePredicate("Island"));
FILTER.add(new SubtypePredicate("Island"));
}
public GenjuOfTheFalls(UUID ownerId) {
super(ownerId, 35, "Genju of the Falls", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}");
this.expansionSetCode = "BOK";
this.subtype.add("Aura");
// Enchant Island
TargetPermanent auraTarget = new TargetLandPermanent(filter);
TargetPermanent auraTarget = new TargetLandPermanent(FILTER);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutCreatureInPlay));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// {2}: Enchanted Island becomes a 3/2 blue Spirit creature with flying until end of turn. It's still a land.
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new SpiritToken(), "Enchanted Island becomes a 3/2 blue Spirit creature with flying until end of turn. It's still a land", Duration.EndOfTurn),new GenericManaCost(2));
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new SpiritToken(), "Enchanted Island becomes a 3/2 blue Spirit creature with flying until end of turn. It's still a land", Duration.EndOfTurn), new GenericManaCost(2));
this.addAbility(ability2);
// When enchanted Island is put into a graveyard, you may return Genju of the Falls from your graveyard to your hand. TargetPermanent auraTarget = new TargetLandPermanent(filter);
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(), "enchanted Island", true, false);
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(false, true), "enchanted Island", true, false);
this.addAbility(ability3);
}
@ -94,6 +93,7 @@ public class GenjuOfTheFalls extends CardImpl {
}
private class SpiritToken extends Token {
SpiritToken() {
super("Spirit", "3/2 blue Spirit creature with flying");
cardType.add(CardType.CREATURE);

View file

@ -28,12 +28,6 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAttachedTriggeredAbility;
@ -46,44 +40,47 @@ import mage.abilities.effects.common.continuous.BecomesCreatureAttachedEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
/**
*
* @author LevelX2
*/
public class GenjuOfTheFens extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp");
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Swamp");
static {
filter.add(new SubtypePredicate("Swamp"));
FILTER.add(new SubtypePredicate("Swamp"));
}
public GenjuOfTheFens(UUID ownerId) {
super(ownerId, 66, "Genju of the Fens", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}");
this.expansionSetCode = "BOK";
this.subtype.add("Aura");
// Enchant Swamp
TargetPermanent auraTarget = new TargetLandPermanent(filter);
TargetPermanent auraTarget = new TargetLandPermanent(FILTER);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutCreatureInPlay));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// {2}: Until end of turn, enchanted Swamp becomes a 2/2 black Spirit creature with "{B}: This creature gets +1/+1 until end of turn." It's still a land.
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new SpiritToken(), "Until end of turn, enchanted Swamp becomes a 2/2 black Spirit creature with \"{B}: This creature gets +1/+1 until end of turn.\" It's still a land", Duration.EndOfTurn),new GenericManaCost(2));
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new SpiritToken(), "Until end of turn, enchanted Swamp becomes a 2/2 black Spirit creature with \"{B}: This creature gets +1/+1 until end of turn.\" It's still a land", Duration.EndOfTurn), new GenericManaCost(2));
this.addAbility(ability2);
// When enchanted Swamp is put into a graveyard, you may return Genju of the Fens from your graveyard to your hand.
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(), "enchanted Swamp", true, false);
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(false, true), "enchanted Swamp", true, false);
this.addAbility(ability3);
}
@ -97,6 +94,7 @@ public class GenjuOfTheFens extends CardImpl {
}
private class SpiritToken extends Token {
SpiritToken() {
super("Spirit", "2/2 black Spirit creature with \"{B}: This creature gets +1/+1 until end of turn.\"");
cardType.add(CardType.CREATURE);
@ -104,7 +102,7 @@ public class GenjuOfTheFens extends CardImpl {
subtype.add("Spirit");
power = new MageInt(2);
toughness = new MageInt(2);
addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,1,Duration.EndOfTurn),new ManaCostsImpl("{B}")));
addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}")));
}
}
}

View file

@ -58,20 +58,20 @@ import mage.target.common.TargetLandPermanent;
* @author LevelX2
*/
public class GenjuOfTheFields extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Plains");
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Plains");
static {
filter.add(new SubtypePredicate("Plains"));
FILTER.add(new SubtypePredicate("Plains"));
}
public GenjuOfTheFields(UUID ownerId) {
super(ownerId, 5, "Genju of the Fields", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}");
this.expansionSetCode = "BOK";
this.subtype.add("Aura");
// Enchant Plains
TargetPermanent auraTarget = new TargetLandPermanent(filter);
TargetPermanent auraTarget = new TargetLandPermanent(FILTER);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutCreatureInPlay));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
@ -80,14 +80,14 @@ public class GenjuOfTheFields extends CardImpl {
// {2}: Until end of turn, enchanted Plains becomes a 2/5 white Spirit creature with "Whenever this creature deals damage, its controller gains that much life." It's still a land.
Effect effect = new BecomesCreatureAttachedEffect(new SpiritToken(),
"Until end of turn, enchanted Plains becomes a 2/5 white Spirit creature", Duration.EndOfTurn);
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect,new GenericManaCost(2));
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2));
effect = new GainAbilityAttachedEffect(new DealsDamageGainLifeSourceTriggeredAbility(), AttachmentType.AURA, Duration.EndOfTurn);
effect.setText("with \"Whenever this creature deals damage, its controller gains that much life.\". It's still a land");
ability2.addEffect(effect);
this.addAbility(ability2);
// When enchanted Plains is put into a graveyard, you may return Genju of the Fields from your graveyard to your hand.
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(), "enchanted Plains", true, false);
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(false, true), "enchanted Plains", true, false);
this.addAbility(ability3);
}
@ -101,6 +101,7 @@ public class GenjuOfTheFields extends CardImpl {
}
private class SpiritToken extends Token {
SpiritToken() {
super("Spirit", "2/5 white Spirit creature");
cardType.add(CardType.CREATURE);

View file

@ -28,11 +28,6 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAttachedTriggeredAbility;
@ -44,7 +39,11 @@ import mage.abilities.effects.common.continuous.BecomesCreatureAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
@ -55,29 +54,28 @@ import mage.target.common.TargetLandPermanent;
* @author LevelX2
*/
public class GenjuOfTheRealm extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent();
private static final FilterLandPermanent FILTER = new FilterLandPermanent();
public GenjuOfTheRealm(UUID ownerId) {
super(ownerId, 151, "Genju of the Realm", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{W}{U}{B}{R}{G}");
this.expansionSetCode = "BOK";
this.subtype.add("Aura");
this.supertype.add("Legendary");
// Enchant Land
TargetPermanent auraTarget = new TargetLandPermanent(filter);
TargetPermanent auraTarget = new TargetLandPermanent(FILTER);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutCreatureInPlay));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// {2}: Enchanted land becomes a legendary 8/12 Spirit creature with trample until end of turn. It's still a land.
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new SpiritToken(), "Enchanted land becomes a legendary 8/12 Spirit creature with trample until end of turn. It's still a land", Duration.EndOfTurn),new GenericManaCost(2));
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new SpiritToken(), "Enchanted land becomes a legendary 8/12 Spirit creature with trample until end of turn. It's still a land", Duration.EndOfTurn), new GenericManaCost(2));
this.addAbility(ability2);
// When enchanted land is put into a graveyard, you may return Genju of the Realm from your graveyard to your hand.
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(), "enchanted land", true, false);
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(false, true), "enchanted land", true, false);
this.addAbility(ability3);
}
@ -91,6 +89,7 @@ public class GenjuOfTheRealm extends CardImpl {
}
private class SpiritToken extends Token {
SpiritToken() {
super("Spirit", "legendary 8/12 Spirit creature with trample");
supertype.add("Legendary");

View file

@ -28,11 +28,6 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAttachedTriggeredAbility;
@ -43,7 +38,11 @@ import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
@ -55,31 +54,31 @@ import mage.target.common.TargetLandPermanent;
* @author LevelX2
*/
public class GenjuOfTheSpires extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain");
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Mountain");
static {
filter.add(new SubtypePredicate("Mountain"));
FILTER.add(new SubtypePredicate("Mountain"));
}
public GenjuOfTheSpires(UUID ownerId) {
super(ownerId, 105, "Genju of the Spires", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{R}");
this.expansionSetCode = "BOK";
this.subtype.add("Aura");
// Enchant Mountain
TargetPermanent auraTarget = new TargetLandPermanent(filter);
TargetPermanent auraTarget = new TargetLandPermanent(FILTER);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutCreatureInPlay));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// {2}: Enchanted Mountain becomes a 6/1 red Spirit creature until end of turn. It's still a land.
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new SpiritToken(), "Enchanted Mountain becomes a 6/1 red Spirit creature until end of turn. It's still a land", Duration.EndOfTurn),new GenericManaCost(2));
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new SpiritToken(), "Enchanted Mountain becomes a 6/1 red Spirit creature until end of turn. It's still a land", Duration.EndOfTurn), new GenericManaCost(2));
this.addAbility(ability2);
// When enchanted Mountain is put into a graveyard, you may return Genju of the Spires from your graveyard to your hand.
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(), "enchanted Mountain", true, false);
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandSourceEffect(false, true), "enchanted Mountain", true, false);
this.addAbility(ability3);
}
@ -93,6 +92,7 @@ public class GenjuOfTheSpires extends CardImpl {
}
private class SpiritToken extends Token {
SpiritToken() {
super("Spirit", "6/1 red Spirit creature");
cardType.add(CardType.CREATURE);

View file

@ -28,9 +28,6 @@
package mage.sets.fourthedition;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
@ -38,6 +35,8 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.common.TargetLandPermanent;
@ -51,10 +50,10 @@ public class StripMine extends CardImpl {
super(ownerId, 189, "Strip Mine", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, "");
this.expansionSetCode = "4ED";
// {tap}: Add {C} to your mana pool.
// {T}: Add {C} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {tap}, Sacrifice Strip Mine: Destroy target land.
// {T}, Sacrifice Strip Mine: Destroy target land.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetLandPermanent());

View file

@ -0,0 +1,78 @@
/*
* 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.dies;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class GenjuOfTheSpiresTest extends CardTestPlayerBase {
/**
* Genju of the Spires isn't working properly: enchanted mountain got
* destroyed by a Strip Mine, the ability triggered, I chose Yes, but it
* didn't come back to my hand. There was nothing in play that could have
* affected it. We rolled back to confirm and it happened a second time. I
* haven't checked every one of them, but I think there's a chance that the
* other 5 Genjus could also have the same problem?
*/
@Test
public void testGenjuReturnsToHand() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
// Enchant Mountain
// {2}: Enchanted Mountain becomes a 6/1 red Spirit creature until end of turn. It's still a land.
// When enchanted Mountain is put into a graveyard, you may return Genju of the Spires from your graveyard to your hand.
addCard(Zone.HAND, playerA, "Genju of the Spires", 1); // {R}
// {T}: Add {C} to your mana pool.
// {T}, Sacrifice Strip Mine: Destroy target land.
addCard(Zone.BATTLEFIELD, playerB, "Strip Mine", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Genju of the Spires", "Mountain");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}, Sacrifice", "Mountain", "Genju of the Spires", StackClause.WHILE_NOT_ON_STACK);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertGraveyardCount(playerB, "Strip Mine", 1);
assertGraveyardCount(playerA, "Genju of the Spires", 0);
assertPermanentCount(playerA, "Genju of the Spires", 0);
assertHandCount(playerA, "Genju of the Spires", 1);
}
}

View file

@ -97,13 +97,13 @@ public class ReturnToHandSourceEffect extends OneShotEffect {
case BATTLEFIELD:
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
return controller.moveCards(permanent, null, Zone.HAND, source, game);
return controller.moveCards(permanent, Zone.HAND, source, game);
}
break;
case GRAVEYARD:
Card card = (Card) mageObject;
if (!fromBattlefieldOnly) {
return controller.moveCards(card, null, Zone.HAND, source, game);
return controller.moveCards(card, Zone.HAND, source, game);
}
}
}