mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
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:
parent
8a82fff6e7
commit
036d4426dd
1 changed files with 12 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue