示例#1
0
 @Override
 public boolean choose(Outcome outcome, Cards cards, TargetCard target, Game game) {
   if (cards.isEmpty()) return !target.isRequired();
   Set<UUID> possibleTargets = target.possibleTargets(playerId, cards, game);
   if (possibleTargets.isEmpty()) return !target.isRequired();
   Iterator<UUID> it = possibleTargets.iterator();
   int targetNum = rnd.nextInt(possibleTargets.size());
   UUID targetId = it.next();
   for (int i = 0; i < targetNum; i++) {
     targetId = it.next();
   }
   target.add(targetId, game);
   return true;
 }
示例#2
0
 @Override
 public boolean chooseTarget(
     Outcome outcome, Cards cards, TargetCard target, Ability source, Game game) {
   if (cards.isEmpty()) return !target.isRequired();
   Card card = cards.getRandom(game);
   target.addTarget(card.getId(), source, game);
   return true;
 }