From 4110b4ebb345f41c8e5da371f79052e948ec012c Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 14:01:52 +0000 Subject: [PATCH] - Added a GameActionUtil.showYesNoDialog() to Squee, Goblin Nabob. --- src/forge/GameActionUtil.java | 65 +++++++++++++++++------------------ 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 691e1ca4813..2a9844cb0e5 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -7286,47 +7286,46 @@ public class GameActionUtil { }//list > 0 }//upkeep_Festering_Wound_Damage() - private static void upkeep_Squee() { - final Player player = AllZone.Phase.getPlayerTurn(); - PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player); + private static void upkeep_Squee() { + final Player player = AllZone.Phase.getPlayerTurn(); + PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player); - CardList list = new CardList(graveyard.getCards()); - list = list.getName("Squee, Goblin Nabob"); + CardList list = new CardList(graveyard.getCards()); + list = list.getName("Squee, Goblin Nabob"); - final CardList squees = list; - final int[] index = new int[1]; - index[0] = 0; + final CardList squees = list; + final int[] index = new int[1]; + index[0] = 0; - for(int i = 0; i < list.size(); i++) { - Ability ability = new Ability(list.get(i), "0") { - @Override - public void resolve() { - PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player); + for (int i = 0; i < list.size(); i++) { + Ability ability = new Ability(list.get(i), "0") { + @Override + public void resolve() { + PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player); - Card c = squees.get(index[0]); - if(AllZone.GameAction.isCardInZone(c, graveyard)) { - if(player.equals(AllZone.HumanPlayer)) { - String[] choices = {"Yes", "No"}; - Object o = AllZone.Display.getChoiceOptional( - "Return Squee from your graveyard to your hand?", choices); - if(!o.equals("Yes")) { - index[0] = index[0] + 1; - return; - } - } + Card c = squees.get(index[0]); + if (AllZone.GameAction.isCardInZone(c, graveyard)) { + if (player.equals(AllZone.HumanPlayer)) { + String question = "Return Squee, Goblin Nabob from your graveyard to your hand?"; + if (!GameActionUtil.showYesNoDialog(c, question)) { + index[0] = index[0] + 1; + return; + } + } PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, c.getController()); AllZone.GameAction.moveTo(hand, c); - index[0] = index[0] + 1; + index[0] = index[0] + 1; } - } - - };// Ability - ability.setStackDescription("Squee gets returned from graveyard to hand."); - AllZone.Stack.add(ability); - } // if creatures > 0 - - } + } + };// Ability + StringBuilder sb = new StringBuilder(); + sb.append("Squee, Goblin Nabob - ").append(player); + sb.append(" may return Squee, Goblin Nabob from graveyard to hand."); + ability.setStackDescription(sb.toString()); + AllZone.Stack.add(ability); + } // if creatures > 0 + } // upkeep_Squee() /* private static void upkeep_AEther_Vial() {