mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
Autotarget disabled for search effects. Closes #9254.
This commit is contained in:
parent
df39503a0b
commit
2aa17d6153
1 changed files with 8 additions and 9 deletions
|
@ -612,7 +612,7 @@ public abstract class TargetImpl implements Target {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UUID tryToAutoChoose(UUID abilityControllerId, Ability source, Game game, Collection<UUID> possibleTargets) {
|
public UUID tryToAutoChoose(UUID abilityControllerId, Ability source, Game game, Collection<UUID> possibleTargets) {
|
||||||
if (possibleTargets == null || game == null) {
|
if (possibleTargets == null || game == null || source == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -626,12 +626,14 @@ public abstract class TargetImpl implements Target {
|
||||||
} else {
|
} else {
|
||||||
playerAutoTargetLevel = 2;
|
playerAutoTargetLevel = 2;
|
||||||
}
|
}
|
||||||
|
String abilityText = source.getRule(true).toLowerCase();
|
||||||
boolean strictModeEnabled = player.getStrictChooseMode();
|
boolean strictModeEnabled = player.getStrictChooseMode();
|
||||||
boolean canAutoChoose = this.getMinNumberOfTargets() == this.getMaxNumberOfTargets() && // Targets must be picked
|
boolean canAutoChoose = this.getMinNumberOfTargets() == this.getMaxNumberOfTargets() // Targets must be picked
|
||||||
possibleTargets.size() == this.getNumberOfTargets() - this.getSize() && // Available targets are equal to the number that must be picked
|
&& possibleTargets.size() == this.getNumberOfTargets() - this.getSize() // Available targets are equal to the number that must be picked
|
||||||
!strictModeEnabled && // Test AI is not set to strictChooseMode(true)
|
&& !strictModeEnabled // Test AI is not set to strictChooseMode(true)
|
||||||
playerAutoTargetLevel > 0 && // Human player has enabled auto-choose in settings
|
&& playerAutoTargetLevel > 0 // Human player has enabled auto-choose in settings
|
||||||
!(playerAutoTargetLevel == 1 && source == null); // Is source is null, then the
|
&& !abilityText.contains("search"); // Do not autochoose for any effects which involve searching
|
||||||
|
|
||||||
|
|
||||||
if (canAutoChoose) {
|
if (canAutoChoose) {
|
||||||
boolean autoTargetAll = playerAutoTargetLevel == 2;
|
boolean autoTargetAll = playerAutoTargetLevel == 2;
|
||||||
|
@ -667,9 +669,6 @@ public abstract class TargetImpl implements Target {
|
||||||
|
|
||||||
// If you control (or own the card) the target, check if it's one of the feel-bad effects.
|
// If you control (or own the card) the target, check if it's one of the feel-bad effects.
|
||||||
if (targetingOwnThing) {
|
if (targetingOwnThing) {
|
||||||
String abilityText = source.getRule(true).toLowerCase();
|
|
||||||
|
|
||||||
|
|
||||||
if (abilityText.contains("discard")
|
if (abilityText.contains("discard")
|
||||||
|| abilityText.contains("sacrifice")
|
|| abilityText.contains("sacrifice")
|
||||||
|| abilityText.contains("destroy")
|
|| abilityText.contains("destroy")
|
||||||
|
|
Loading…
Reference in a new issue