Fixed that triggered abilities shows cancel button in target definition;

This commit is contained in:
Oleg Agafonov 2019-03-18 06:10:08 +04:00
parent ae00a74b4c
commit 410fd68996

View file

@ -325,15 +325,9 @@ public abstract class AbilityImpl implements Ability {
} }
if (!getTargets().isEmpty()) { if (!getTargets().isEmpty()) {
Outcome outcome = getEffects().isEmpty() ? Outcome.Detriment : getEffects().get(0).getOutcome(); Outcome outcome = getEffects().isEmpty() ? Outcome.Detriment : getEffects().get(0).getOutcome();
// can be cancel by user // only activated abilities can be canceled by user (not triggered)
if (getTargets().chooseTargets(outcome, this.controllerId, this, noMana, game, true) == false) { if (!getTargets().chooseTargets(outcome, this.controllerId, this, noMana, game, this instanceof ActivatedAbility)) {
/* // was canceled during targer selection
if ((variableManaCost != null) || (announceString != null && !announceString.isEmpty())) {
// ?debug message?
game.informPlayer(controller, (sourceObject != null ? sourceObject.getIdName() : "") + ": no valid targets");
}
*/
// when activation of ability is canceled during target selection
return false; return false;
} }
} }