diff --git a/src/forge/ComputerAI_General.java b/src/forge/ComputerAI_General.java index 381b0089b2b..c5c19235758 100644 --- a/src/forge/ComputerAI_General.java +++ b/src/forge/ComputerAI_General.java @@ -132,7 +132,7 @@ public class ComputerAI_General implements Computer { } }); all.addAll(AllZone.Computer_Battlefield.getCards()); - all.addAll(CardFactoryUtil.getFlashbackCards(AllZone.ComputerPlayer).toArray()); + all.addAll(CardFactoryUtil.getGraveyardActivationCards(AllZone.ComputerPlayer).toArray()); // Prevent the computer from summoning Ball Lightning type creatures during main phase 2 all = all.getNotKeyword("At the beginning of the end step, sacrifice CARDNAME."); @@ -171,7 +171,7 @@ public class ComputerAI_General implements Computer { } }); all.addAll(AllZone.Computer_Battlefield.getCards()); - all.addAll(CardFactoryUtil.getFlashbackCards(AllZone.ComputerPlayer).toArray()); + all.addAll(CardFactoryUtil.getGraveyardActivationCards(AllZone.ComputerPlayer).toArray()); CardList humanPlayable = new CardList(); diff --git a/src/forge/card/cardFactory/CardFactoryUtil.java b/src/forge/card/cardFactory/CardFactoryUtil.java index 415f3517b3a..cc90e0f5cce 100644 --- a/src/forge/card/cardFactory/CardFactoryUtil.java +++ b/src/forge/card/cardFactory/CardFactoryUtil.java @@ -2533,106 +2533,6 @@ public class CardFactoryUtil { return target; }//input_targetPlayer() - public static Input input_targetPlayer(final SpellAbility spell, final Command command) { - Input target = new Input() { - private static final long serialVersionUID = 8736682807625129068L; - - @Override - public void showMessage() { - AllZone.Display.showMessage("Select target player"); - ButtonUtil.enableOnlyCancel(); - } - - @Override - public void selectButtonCancel() { - stop(); - } - - @Override - public void selectPlayer(Player player) { - spell.setTargetPlayer(player); - command.execute(); - if(spell.getManaCost().equals("0") || this.isFree()) { - this.setFree(false); - AllZone.Stack.add(spell, spell.getSourceCard().getManaCost().contains("X")); - stop(); - } else stopSetNext(new Input_PayManaCost(spell)); - } - }; - return target; - }//input_targetPlayer() - - - public static Input spReturnTgt_input_targetCards_InGraveyard( - final Card card, final SpellAbility spell, final boolean UpTo, - final int numCards, final String Tgts[], final boolean anyNumber) { - - Input target = new Input() { - private static final long serialVersionUID = 816838038180106359L; - - @Override - public void showMessage() { - - CardList grave = getGraveyardList(); - CardList targets = new CardList(); - - if (UpTo) { - for (int i = 0; i < numCards; i++) { - if (grave.size() > 0) { - Object o = GuiUtils.getChoiceOptional("Select a card", grave.toArray()); - if (o == null) break; - Card c = (Card) o; - targets.add(c); - grave.remove(c); - } - } - } else if (anyNumber) { - int max = grave.size(); - for (int i = 0; i < max; i++) { - if (grave.size() > 0) { - Object o = GuiUtils.getChoiceOptional("Select a card", grave.toArray()); - if (o == null) break; - Card c = (Card) o; - targets.add(c); - grave.remove(c); - } - } - } else if (grave.size() > numCards) { - for (int i = 0; i < numCards; i++) { - Object o = GuiUtils.getChoice("Select a card", grave.toArray()); - Card c = (Card) o; - targets.add(c); - grave.remove(c); - } - - } else if (grave.size() == numCards) { - targets = grave; - } - - if (targets.size() > 0) { - spell.setTargetList(targets); - - if (this.isFree()) { - - this.setFree(false); - stop(); - AllZone.Stack.add(spell); - } - else stopSetNext(new Input_PayManaCost(spell)); - } - }// showMessage() - - public CardList getGraveyardList() { - CardList list = new CardList(); - PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - list.addAll(zone.getCards()); - list = list.getValidCards(Tgts,card.getController(),card); - return list; - } - };// Input - return target; - }//spReturnTgt_input_targetCards_InGraveyard() - public static Input modularInput(final SpellAbility ability, final Card card){ Input modularInput = new Input() { @@ -2747,23 +2647,7 @@ public class CardFactoryUtil { } }; }//targetHuman() - - //is it the computer's main phase before attacking? - public static boolean AI_isMainPhase() { - return AllZone.Phase.is(Constant.Phase.Main1, AllZone.ComputerPlayer); - } - - public static CommandArgs AI_targetComputer() { - return new CommandArgs() { - private static final long serialVersionUID = -445231553588926627L; - - public void execute(Object o) { - SpellAbility sa = (SpellAbility) o; - sa.setTargetPlayer(AllZone.ComputerPlayer); - } - }; - }//targetComputer() - + //type can also be "All" public static CommandArgs AI_targetType(final String type, final PlayerZone zone) { return new CommandArgs() { @@ -2805,43 +2689,7 @@ public class CardFactoryUtil { return list.containsName(c.getName()); } - - public static boolean controlsAnotherMulticoloredPermanent(Card c) { - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getController()); - - final Card crd = c; - - CardList list = new CardList(play.getCards()); - list = list.filter(new CardListFilter() { - - public boolean addCard(Card c) { - return !c.equals(crd) && CardUtil.getColors(c).size() >= 2; - } - - }); - - return list.size() >= 1; - - } - - public static boolean controlsAnotherColoredCreature(Card c, String color) { - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getController()); - - final Card crd = c; - final String col = color; - CardList list = new CardList(play.getCards()); - list = list.filter(new CardListFilter() { - - public boolean addCard(Card c) { - return !c.equals(crd) && c.isCreature() && CardUtil.getColors(c).contains(col); - } - - }); - - return list.size() >= 1; - - } - + public static boolean oppHasKismet(Player player) { Player opp = player.getOpponent(); PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, opp); @@ -2873,45 +2721,6 @@ public class CardFactoryUtil { return count; } - public static String sumManaCost(String manacost1, String manacost2) - { - String tokenized1[] = manacost1.split("\\s"); - String tokenized2[] = manacost2.split("\\s"); - - StringBuilder sb = new StringBuilder(); - - int totalNumberCost = 0; - if (Character.isDigit(tokenized1[0].charAt(0)) && Character.isDigit(tokenized2[0].charAt(0))) - { - int cost1 = Integer.parseInt(tokenized1[0]); - int cost2 = Integer.parseInt(tokenized2[0]); - totalNumberCost = cost1 + cost2; - } - else if (Character.isDigit(tokenized1[0].charAt(0))) - totalNumberCost = Integer.parseInt(tokenized1[0]); - else if (Character.isDigit(tokenized2[0].charAt(0))) - totalNumberCost = Integer.parseInt(tokenized2[0]); - - if (totalNumberCost != 0) { - sb.append(totalNumberCost); - } - - for (int i=1;i