示例#1
0
  /**
   * chooseBoonTarget.
   *
   * @param list a {@link forge.CardList} object.
   * @param type a {@link java.lang.String} object.
   * @return a {@link forge.game.card.Card} object.
   */
  public static Card chooseBoonTarget(final CardCollectionView list, final String type) {
    Card choice = null;
    if (type.equals("P1P1")) {
      choice = ComputerUtilCard.getBestCreatureAI(list);

      if (choice == null) {
        // We'd only get here if list isn't empty, maybe we're trying to animate a land?
        choice = ComputerUtilCard.getBestLandToAnimate(list);
      }
    } else if (type.equals("DIVINITY")) {
      final CardCollection boon =
          CardLists.filter(
              list,
              new Predicate<Card>() {
                @Override
                public boolean apply(final Card c) {
                  return c.getCounters(CounterType.DIVINITY) == 0;
                }
              });
      choice = ComputerUtilCard.getMostExpensivePermanentAI(boon, null, false);
    } else {
      // The AI really should put counters on cards that can use it.
      // Charge counters on things with Charge abilities, etc. Expand
      // these above
      choice = Aggregates.random(list);
    }
    return choice;
  }