* Fixed a problem with Animate Dead and bringing creatures with triggered abilities into play that had no targets. It was related to manipulating spellAbility and not copying spellAbility correctly during states copies. (related to #4428).

This commit is contained in:
LevelX2 2018-02-17 11:54:57 +01:00
parent 77762cbf59
commit fe2eec6553
3 changed files with 15 additions and 7 deletions

View file

@ -100,7 +100,7 @@ class AnimateDeadReAttachEffect extends OneShotEffect {
public AnimateDeadReAttachEffect() {
super(Outcome.Benefit);
this.staticText = "Return enchanted creature card to the battlefield under your control and attach {this} to it";
this.staticText = "return enchanted creature card to the battlefield under your control and attach {this} to it";
}
public AnimateDeadReAttachEffect(final AnimateDeadReAttachEffect effect) {

View file

@ -118,11 +118,11 @@ public class IsochronScepterTest extends CardTestPlayerBase {
public void testAngelsGrace() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.HAND, playerA, "Isochron Scepter");
// Split second (As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.)
// You can't lose the game this turn and your opponents can't win the game this turn.
// Until end of turn, damage that would reduce your life total to less than 1 reduces it to 1 instead.
addCard(Zone.HAND, playerA, "Angel's Grace");
addCard(Zone.HAND, playerA, "Angel's Grace"); // Instant {W}
addCard(Zone.BATTLEFIELD, playerB, "Dross Crocodile", 4);// 5/1
addCard(Zone.HAND, playerB, "Lightning Bolt", 2);
@ -149,9 +149,6 @@ public class IsochronScepterTest extends CardTestPlayerBase {
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
assertExileCount("Angel's Grace", 1);
assertGraveyardCount(playerA, "Angel's Grace", 0);
assertLife(playerA, 1);
assertLife(playerB, 20);
@ -160,6 +157,9 @@ public class IsochronScepterTest extends CardTestPlayerBase {
assertPermanentCount(playerB, "Dross Crocodile", 3);
assertPermanentCount(playerA, "Isochron Scepter", 1);
assertExileCount("Angel's Grace", 1);
assertGraveyardCount(playerA, "Angel's Grace", 0);
}
/**

View file

@ -29,7 +29,6 @@ package mage.cards;
import java.lang.reflect.Constructor;
import java.util.*;
import mage.MageObject;
import mage.MageObjectImpl;
import mage.Mana;
@ -165,6 +164,12 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
secondSideCardClazz = card.secondSideCardClazz;
nightCard = card.nightCard;
}
if (card.spellAbility != null) {
spellAbility = card.getSpellAbility().copy();
} else {
spellAbility = null;
}
flipCard = card.flipCard;
flipCardName = card.flipCardName;
splitCard = card.splitCard;
@ -177,6 +182,9 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
this.objectId = UUID.randomUUID();
this.abilities.newOriginalId();
this.abilities.setSourceId(objectId);
if (this.spellAbility != null) {
this.spellAbility.setSourceId(objectId);
}
}
public static Card createCard(String name, CardSetInfo setInfo) {