From 4153ee07ed72e65479d448bd64e669acd52a9fa4 Mon Sep 17 00:00:00 2001 From: Sloth Date: Wed, 6 Mar 2013 13:14:47 +0000 Subject: [PATCH] - Fixed multiple problems with Convoke. --- src/main/java/forge/game/GameActionPlay.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/forge/game/GameActionPlay.java b/src/main/java/forge/game/GameActionPlay.java index 49e78212e9d..0aae291fe75 100644 --- a/src/main/java/forge/game/GameActionPlay.java +++ b/src/main/java/forge/game/GameActionPlay.java @@ -180,23 +180,20 @@ public class GameActionPlay { List untappedCreats = CardLists.filter(spell.getActivatingPlayer().getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.CREATURES); untappedCreats = CardLists.filter(untappedCreats, CardPredicates.Presets.UNTAPPED); - if (untappedCreats.size() != 0) { + if (!untappedCreats.isEmpty()) { final List choices = new ArrayList(); - for (final Card c : untappedCreats) { - choices.add(c); - } + choices.addAll(untappedCreats); ArrayList usableColors = new ArrayList(); ManaCostBeingPaid newCost = new ManaCostBeingPaid(originalCost.toString()); Card tapForConvoke = null; if (sa.getActivatingPlayer().isHuman()) { - tapForConvoke = GuiChoose.oneOrNone("Tap for Convoke? " + newCost.toString(), - choices); + tapForConvoke = GuiChoose.oneOrNone("Tap for Convoke? " + newCost.toString(), choices); } else { // TODO: AI to choose a creature to tap would go here // Probably along with deciding how many creatures to // tap } - while (tapForConvoke != null && untappedCreats.size() != 0) { + while (tapForConvoke != null && !untappedCreats.isEmpty()) { final Card workingCard = (Card) tapForConvoke; usableColors = GameActionPlay.getConvokableColors(workingCard, newCost); @@ -223,7 +220,7 @@ public class GameActionPlay { sa.addTappedForConvoke(workingCard); choices.remove(workingCard); untappedCreats.remove(workingCard); - if ((choices.size() < 2) || (newCost.getConvertedManaCost() == 0)) { + if (choices.isEmpty() || (newCost.getConvertedManaCost() == 0)) { break; } } else { @@ -239,7 +236,7 @@ public class GameActionPlay { } // will only be null if user cancelled. - if (tapForConvoke != null) { + if (!sa.getTappedForConvoke().isEmpty()) { // Convoked creats are tapped here with triggers // suppressed, // Then again when payment is done(In