mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
Fix #8808
This commit is contained in:
parent
4b469c8840
commit
92cafbd8b1
3 changed files with 18 additions and 49 deletions
|
|
@ -37,7 +37,7 @@ public class TapTargetCost extends CostImpl {
|
|||
@Override
|
||||
public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {
|
||||
List<Permanent> permanents = new ArrayList<>();
|
||||
if (target.choose(Outcome.Tap, controllerId, source.getSourceId(), source, game)) {
|
||||
if (target.getMaxNumberOfTargets() > 0 && target.choose(Outcome.Tap, controllerId, source.getSourceId(), source, game)) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent == null) {
|
||||
|
|
@ -47,6 +47,9 @@ public class TapTargetCost extends CostImpl {
|
|||
permanents.add(permanent);
|
||||
}
|
||||
}
|
||||
if (target.getNumberOfTargets() == 0) {
|
||||
paid = true; // e.g. Aryel with X = 0
|
||||
}
|
||||
source.getEffects().setValue("tappedPermanents", permanents);
|
||||
return paid;
|
||||
}
|
||||
|
|
@ -64,5 +67,4 @@ public class TapTargetCost extends CostImpl {
|
|||
public TapTargetCost copy() {
|
||||
return new TapTargetCost(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class TapVariableTargetCost extends VariableCostImpl {
|
|||
|
||||
@Override
|
||||
public int getMaxValue(Ability source, Game game) {
|
||||
return game.getBattlefield().countAll(filter, source.getControllerId(), game);
|
||||
return game.getBattlefield().count(filter, source.getControllerId(), source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue