From db30268bc0ec71b3c057be02c45d5e8666997572 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Wed, 29 Aug 2012 22:58:04 +0400 Subject: [PATCH] fixed for previous commit --- .../mage/sets/riseoftheeldrazi/CastThroughTime.java | 5 +++-- .../mage/test/cards/single/roe/WorldAtWarTest.java | 2 -- .../common/CastCardFromOursideTheGameEffect.java | 12 +++++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CastThroughTime.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CastThroughTime.java index 0b980bd7c1..b1b9623ae5 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CastThroughTime.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CastThroughTime.java @@ -125,9 +125,10 @@ class GainReboundEffect extends ContinuousEffectImpl { return false; } - private class AttachedReboundAbility extends ReboundAbility {} } +class AttachedReboundAbility extends ReboundAbility {} + class LeavesBattlefieldWatcher extends WatcherImpl { public LeavesBattlefieldWatcher() { @@ -148,7 +149,7 @@ class LeavesBattlefieldWatcher extends WatcherImpl { for (Card card : player.getHand().getCards(CastThroughTime.filter, game)) { Iterator it = card.getAbilities().iterator(); while (it.hasNext()) { - if (it.next() instanceof ReboundAbility) { + if (it.next() instanceof AttachedReboundAbility) { it.remove(); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/roe/WorldAtWarTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/roe/WorldAtWarTest.java index bab97e1d34..2ba3329160 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/roe/WorldAtWarTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/roe/WorldAtWarTest.java @@ -33,8 +33,6 @@ public class WorldAtWarTest extends CardTestPlayerBase { setStopAt(1, Constants.PhaseStep.END_TURN); execute(); - System.out.println("player: " + playerA.getId()); - assertLife(playerB, 14); Permanent eliteVanguard = getPermanent("Elite Vanguard", playerA); Assert.assertTrue(eliteVanguard.isTapped()); diff --git a/Mage/src/mage/abilities/effects/common/CastCardFromOursideTheGameEffect.java b/Mage/src/mage/abilities/effects/common/CastCardFromOursideTheGameEffect.java index 69fecf2759..b136cb95eb 100644 --- a/Mage/src/mage/abilities/effects/common/CastCardFromOursideTheGameEffect.java +++ b/Mage/src/mage/abilities/effects/common/CastCardFromOursideTheGameEffect.java @@ -32,6 +32,7 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; @@ -78,14 +79,19 @@ public class CastCardFromOursideTheGameEffect extends OneShotEffect filteredCards = cards.getCards(filterCard, game); - if (filteredCards.isEmpty()) { + Set filtered = cards.getCards(filterCard, game); + if (filtered.isEmpty()) { game.informPlayer(player, "You have no " + filterCard.getMessage() + " outside the game."); return false; } + + Cards filteredCards = new CardsImpl(); + for (Card card : filtered) { + filteredCards.add(card.getId()); + } TargetCard target = new TargetCard(Constants.Zone.PICK, filterCard); - if (player.choose(Constants.Outcome.Benefit, cards, target, game)) { + if (player.choose(Constants.Outcome.Benefit, filteredCards, target, game)) { Card card = player.getSideboard().get(target.getFirstTarget(), game); if (card != null) { player.cast(card.getSpellAbility(), game, true);