From 0d031897ad4d00f789883db97e9f70aeb0097124 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 23 Feb 2013 17:23:59 +0100 Subject: [PATCH] Fixed third ability of Karn Libertated that added sideboard cards to library and missed adding abilities to the restarted game (issue #141). --- .../mage/sets/newphyrexia/KarnLiberated.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java index 9b1abc4bd7..3d85d47ac1 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java @@ -44,6 +44,8 @@ import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.counters.CounterType; import mage.filter.FilterCard; import mage.game.ExileZone; @@ -114,18 +116,24 @@ class KarnLiberatedEffect extends OneShotEffect { for (ExileZone zone: game.getExile().getExileZones()) { if (zone.getId().equals(exileId)) { for (Card card: zone.getCards(game)) { - if (!card.getSubtype().contains("Aura")) + if (!card.getSubtype().contains("Aura")) { cards.add(card); + } } } } game.getState().clear(); + for (Card card: game.getCards()) { + game.getState().addCard(card); + } for (Player player: game.getPlayers().values()) { player.getGraveyard().clear(); player.getHand().clear(); player.getLibrary().clear(); for (Card card: game.getCards()) { - if (card.getOwnerId().equals(player.getId()) && !card.isCopy()) { + if (card.getOwnerId().equals(player.getId()) && !card.isCopy() // no copies + && !player.getSideboard().contains(card.getId()) + && !cards.contains(card)) { // not the exiled cards player.getLibrary().putOnTop(card, game); } } @@ -195,10 +203,11 @@ class KarnLiberatedDelayedEffect extends OneShotEffect