* Mist of Stagnation - Fixed untap effect.

This commit is contained in:
LevelX2 2017-11-04 17:08:44 +01:00
parent 874de47b28
commit 5a9671cbca

View file

@ -27,8 +27,6 @@
*/
package mage.cards.m;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -96,23 +94,16 @@ class MistOfStagnationEffect extends OneShotEffect {
if (activePlayer != null) {
int cardsInGrave = activePlayer.getGraveyard().size();
if (cardsInGrave > 0) {
Set<TargetPermanent> targets = new HashSet<>();
for (int i = 1; 1 <= cardsInGrave; i++) {
TargetPermanent target = new TargetPermanent(1, 1, new FilterPermanent(), true);
target.setTargetController(activePlayer.getId());
target.setTargetController(activePlayer.getId());
if (target.canChoose(source.getSourceId(), activePlayer.getId(), game) && activePlayer.chooseTarget(Outcome.Untap, target, source, game)) {
targets.add(target);
}
}
for (TargetPermanent target : targets) {
Permanent p = game.getPermanent(target.getFirstTarget());
TargetPermanent target = new TargetPermanent(cardsInGrave, cardsInGrave, new FilterPermanent("permanents to untap"), true);
activePlayer.chooseTarget(outcome, target, source, game);
for (UUID oneTarget : target.getTargets()) {
Permanent p = game.getPermanent(oneTarget);
if (p != null) {
p.untap(game);
}
}
return true;
}
return true;
}
return false;
}