mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
refactor: fixed that TargetCard doesn't work with Zone.ALL;
This commit is contained in:
parent
bfceb07c58
commit
450f7bd907
13 changed files with 257 additions and 38 deletions
|
|
@ -30,10 +30,7 @@ import mage.players.Player;
|
|||
import mage.target.Target;
|
||||
import mage.target.TargetAmount;
|
||||
import mage.target.TargetCard;
|
||||
import mage.util.CardUtil;
|
||||
import mage.util.RandomUtil;
|
||||
import mage.util.ThreadUtils;
|
||||
import mage.util.XmageThreadFactory;
|
||||
import mage.util.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -453,6 +450,7 @@ public class ComputerPlayer6 extends ComputerPlayer {
|
|||
}
|
||||
} catch (TimeoutException | InterruptedException e) {
|
||||
// AI thinks too long
|
||||
// how-to fix: look at stack info - it can contain bad ability with infinite choose dialog
|
||||
logger.warn("AI player thinks too long - " + getName() + " - " + root.game);
|
||||
task.cancel(true);
|
||||
} catch (ExecutionException e) {
|
||||
|
|
|
|||
|
|
@ -45,9 +45,8 @@ public class PossibleTargetsSelector {
|
|||
|
||||
public void findNewTargets(Set<UUID> fromTargetsList) {
|
||||
// collect new valid targets
|
||||
List<MageItem> found = target.possibleTargets(abilityControllerId, source, game).stream()
|
||||
List<MageItem> found = target.possibleTargets(abilityControllerId, source, game, fromTargetsList).stream()
|
||||
.filter(id -> !target.contains(id))
|
||||
.filter(id -> fromTargetsList == null || fromTargetsList.contains(id))
|
||||
.filter(id -> target.canTarget(abilityControllerId, id, source, game))
|
||||
.map(id -> {
|
||||
Player player = game.getPlayer(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue