mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +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++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!copiedSpell) {
|
if (!isCopiedSpell()) {
|
||||||
for (Effect effect : ability.getEffects()) {
|
for (Effect effect : ability.getEffects()) {
|
||||||
if (effect instanceof PostResolveEffect) {
|
if (effect instanceof PostResolveEffect) {
|
||||||
if (((PostResolveEffect) effect).isActive(ability, game)) {
|
if (((PostResolveEffect) effect).isActive(ability, game)) {
|
||||||
|
@ -509,7 +509,9 @@ public class Spell implements StackObject, Card {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void counter(UUID sourceId, Game game) {
|
public void counter(UUID sourceId, Game game) {
|
||||||
card.moveToZone(Zone.GRAVEYARD, sourceId, game, false);
|
if (!isCopiedSpell()) {
|
||||||
|
card.moveToZone(Zone.GRAVEYARD, sourceId, game, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -836,13 +838,15 @@ public class Spell implements StackObject, Card {
|
||||||
game.getStack().remove(this);
|
game.getStack().remove(this);
|
||||||
game.rememberLKI(this.getId(), event.getFromZone(), this);
|
game.rememberLKI(this.getId(), event.getFromZone(), this);
|
||||||
|
|
||||||
if (exileId == null) {
|
if (!this.isCopiedSpell()) {
|
||||||
game.getExile().getPermanentExile().add(this.card);
|
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);
|
game.fireEvent(event);
|
||||||
return event.getToZone() == Zone.EXILED;
|
return event.getToZone() == Zone.EXILED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue