fixed for previous commit

This commit is contained in:
magenoxx 2012-08-29 22:58:04 +04:00
parent 0471771451
commit db30268bc0
3 changed files with 12 additions and 7 deletions

View file

@ -125,9 +125,10 @@ class GainReboundEffect extends ContinuousEffectImpl<GainReboundEffect> {
return false;
}
private class AttachedReboundAbility extends ReboundAbility {}
}
class AttachedReboundAbility extends ReboundAbility {}
class LeavesBattlefieldWatcher extends WatcherImpl<LeavesBattlefieldWatcher> {
public LeavesBattlefieldWatcher() {
@ -148,7 +149,7 @@ class LeavesBattlefieldWatcher extends WatcherImpl<LeavesBattlefieldWatcher> {
for (Card card : player.getHand().getCards(CastThroughTime.filter, game)) {
Iterator<Ability> it = card.getAbilities().iterator();
while (it.hasNext()) {
if (it.next() instanceof ReboundAbility) {
if (it.next() instanceof AttachedReboundAbility) {
it.remove();
}
}

View file

@ -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());

View file

@ -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<CastCardFrom
return false;
}
Set<Card> filteredCards = cards.getCards(filterCard, game);
if (filteredCards.isEmpty()) {
Set<Card> 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);