- Do not auto select the only valid target if it's optional (fixes e.g. Support being non-optional with only one valid target).

This commit is contained in:
Agetian
2016-02-01 10:29:14 +00:00
parent a38040f736
commit 4a5e80d06d

View File

@@ -119,11 +119,11 @@ public class TargetSelection {
//this handles "target opponent" cards, along with any other cards that can only target a single non-card game entity //this handles "target opponent" cards, along with any other cards that can only target a single non-card game entity
//note that we don't handle auto-targeting cards this way since it's possible that the result will be undesirable //note that we don't handle auto-targeting cards this way since it's possible that the result will be undesirable
List<GameEntity> nonCardTargets = tgt.getAllCandidates(this.ability, true, true); List<GameEntity> nonCardTargets = tgt.getAllCandidates(this.ability, true, true);
if (nonCardTargets.size() == 1) { if (nonCardTargets.size() == 1 && minTargets != 0) {
return ability.getTargets().add(nonCardTargets.get(0)); return ability.getTargets().add(nonCardTargets.get(0));
} }
} }
else if (validTargets.size() == 1 && ability.isTrigger() && !tgt.canTgtPlayer()) { else if (validTargets.size() == 1 && ability.isTrigger() && minTargets != 0 && !tgt.canTgtPlayer()) {
//if only one valid target card for triggered ability, auto-target that card //if only one valid target card for triggered ability, auto-target that card
//only do this for triggered abilities to prevent auto-targeting when user chooses //only do this for triggered abilities to prevent auto-targeting when user chooses
//to play a spell or activat an ability //to play a spell or activat an ability