mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
Player auto-choose respects required targets (#10557)
* Player auto-choose respects required targets
This commit is contained in:
parent
fae63d9d4b
commit
fb8424556e
2 changed files with 8 additions and 6 deletions
|
|
@ -540,7 +540,7 @@ public class HumanPlayer extends PlayerImpl {
|
|||
required = false;
|
||||
}
|
||||
|
||||
UUID responseId = target.tryToAutoChoose(abilityControllerId, source, game);
|
||||
UUID responseId = required ? target.tryToAutoChoose(abilityControllerId, source, game) : null;
|
||||
|
||||
// responseId is null if a choice couldn't be automatically made
|
||||
if (responseId == null) {
|
||||
|
|
@ -640,7 +640,7 @@ public class HumanPlayer extends PlayerImpl {
|
|||
required = false;
|
||||
}
|
||||
|
||||
UUID responseId = target.tryToAutoChoose(abilityControllerId, source, game);
|
||||
UUID responseId = required ? target.tryToAutoChoose(abilityControllerId, source, game) : null;
|
||||
|
||||
// responseId is null if a choice couldn't be automatically made
|
||||
if (responseId == null) {
|
||||
|
|
@ -738,7 +738,8 @@ public class HumanPlayer extends PlayerImpl {
|
|||
required = false;
|
||||
}
|
||||
|
||||
UUID responseId = target.tryToAutoChoose(abilityControllerId, source, game, possibleTargets);
|
||||
UUID responseId = required ? target.tryToAutoChoose(abilityControllerId, source, game, possibleTargets)
|
||||
: null;
|
||||
|
||||
if (responseId == null) {
|
||||
Map<String, Serializable> options = getOptions(target, null);
|
||||
|
|
@ -819,7 +820,8 @@ public class HumanPlayer extends PlayerImpl {
|
|||
required = false;
|
||||
}
|
||||
|
||||
UUID responseId = target.tryToAutoChoose(abilityControllerId, source, game, possibleTargets);
|
||||
UUID responseId = required ? target.tryToAutoChoose(abilityControllerId, source, game, possibleTargets)
|
||||
: null;
|
||||
|
||||
if (responseId == null) {
|
||||
List<UUID> chosenTargets = target.getTargets();
|
||||
|
|
@ -894,7 +896,7 @@ public class HumanPlayer extends PlayerImpl {
|
|||
required = false;
|
||||
}
|
||||
|
||||
UUID responseId = target.tryToAutoChoose(abilityControllerId, source, game);
|
||||
UUID responseId = required ? target.tryToAutoChoose(abilityControllerId, source, game) : null;
|
||||
|
||||
// responseId is null if a choice couldn't be automatically made
|
||||
if (responseId == null) {
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ public abstract class TargetImpl implements Target {
|
|||
}
|
||||
} else {
|
||||
// Try to autochoosen
|
||||
UUID autoChosenId = tryToAutoChoose(playerId, source, game);
|
||||
UUID autoChosenId = required ? tryToAutoChoose(playerId, source, game) : null;
|
||||
if (autoChosenId != null) {
|
||||
addTarget(autoChosenId, source, game);
|
||||
} else if (!targetController.chooseTarget(outcome, this, source, game)) { // If couldn't autochoose ask player
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue