Fixed the causes that triggered abilities were applied more often than they should. Fixed the lose ability bug (test with Master of the Pearl Trident giving island walk). Tests now build without errors. Only rarely the Grounded/Drake Umbra lose ability test fails.

This commit is contained in:
LevelX2 2012-12-05 01:16:28 +01:00
parent 80e9d748a7
commit bb5b9587e0
11 changed files with 119 additions and 29 deletions

View file

@ -173,9 +173,6 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
if (controller != null && controller.removeFromBattlefield(this, game)) {
ZoneChangeEvent event = new ZoneChangeEvent(this, sourceId, controllerId, fromZone, toZone);
if (!game.replaceEvent(event)) {
if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
game.resetForSourceId(getId());
}
Player owner = game.getPlayer(ownerId);
game.rememberLKI(objectId, Zone.BATTLEFIELD, this);
if (owner != null) {
@ -201,6 +198,9 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
}
game.setZone(objectId, event.getToZone());
game.fireEvent(event);
if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
game.resetForSourceId(getId());
}
return game.getState().getZone(objectId) == toZone;
}
}
@ -224,6 +224,9 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
}
game.setZone(objectId, event.getToZone());
game.fireEvent(event);
if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
game.resetForSourceId(getId());
}
return true;
}
}