Fixed #694. Copied spells will cease to exist when leaving the stack for the exile or graveyard zones.

This also fixes the problem where countering a spell copy would also counter the original.
This commit is contained in:
Duncan Townsend 2015-01-29 00:23:01 -05:00
parent 8a82fff6e7
commit 036d4426dd
No known key found for this signature in database
GPG key ID: C00ECDF315F7A593

View file

@ -201,7 +201,7 @@ public class Spell implements StackObject, Card {
index++;
}
}
if (!copiedSpell) {
if (!isCopiedSpell()) {
for (Effect effect : ability.getEffects()) {
if (effect instanceof PostResolveEffect) {
if (((PostResolveEffect) effect).isActive(ability, game)) {
@ -509,7 +509,9 @@ public class Spell implements StackObject, Card {
@Override
public void counter(UUID sourceId, Game game) {
card.moveToZone(Zone.GRAVEYARD, sourceId, game, false);
if (!isCopiedSpell()) {
card.moveToZone(Zone.GRAVEYARD, sourceId, game, false);
}
}
@Override
@ -836,13 +838,15 @@ public class Spell implements StackObject, Card {
game.getStack().remove(this);
game.rememberLKI(this.getId(), event.getFromZone(), this);
if (exileId == null) {
game.getExile().getPermanentExile().add(this.card);
if (!this.isCopiedSpell()) {
if (exileId == null) {
game.getExile().getPermanentExile().add(this.card);
} else {
game.getExile().createZone(exileId, name).add(this.card);
}
game.setZone(this.card.getId(), event.getToZone());
}
else {
game.getExile().createZone(exileId, name).add(this.card);
}
game.setZone(this.card.getId(), event.getToZone());
game.fireEvent(event);
return event.getToZone() == Zone.EXILED;
}