* Rally the Ancestors - Fixed that creatures cards were moved to exile also if already in the graveyard. Problem was that the zoneChangeCounter was not raised as a permanent card left the battlefield. So some more fixes were neccessary for implementations that are based on this fixed zoneChangeCounter of permanents leaving the battlefield. I guess there will be some more bugs caused by this change but I guess this is the correct way to go.

This commit is contained in:
LevelX2 2015-01-31 19:17:22 +01:00
parent dbbbbc0279
commit faa2b0a0bf
18 changed files with 77 additions and 37 deletions

View file

@ -7,7 +7,9 @@ import java.util.Map;
import java.util.UUID;
import mage.abilities.Ability;
import mage.cards.Card;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
public class FirstTargetPointer implements TargetPointer {
@ -47,7 +49,12 @@ public class FirstTargetPointer implements TargetPointer {
Card card = game.getCard(targetId);
if (card != null && zoneChangeCounter.containsKey(targetId)
&& card.getZoneChangeCounter() != zoneChangeCounter.get(targetId)) {
continue;
// because if dies trigger has to trigger as permanent has already moved zone, we have to check if target was on the battlefield immed. before
// but no longer if new permanent is already on the battlefield
Permanent permanent = game.getPermanentOrLKIBattlefield(targetId);
if (permanent == null || permanent.getZoneChangeCounter() != zoneChangeCounter.get(targetId)) {
continue;
}
}
target.add(targetId);
}
@ -62,7 +69,12 @@ public class FirstTargetPointer implements TargetPointer {
Card card = game.getCard(targetId);
if (card != null && zoneChangeCounter.containsKey(targetId)
&& card.getZoneChangeCounter() != zoneChangeCounter.get(targetId)) {
return null;
// because if dies trigger has to trigger as permanent has already moved zone, we have to check if target was on the battlefield immed. before
// but no longer if new permanent is already on the battlefield
Permanent permanent = game.getPermanentOrLKIBattlefield(targetId);
if (permanent == null || permanent.getZoneChangeCounter() != zoneChangeCounter.get(targetId)) {
return null;
}
}
}
return targetId;