From bff01090b56fd0c30addffc33125976bd1003f37 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 16 Aug 2014 22:39:56 +0200 Subject: [PATCH] * Fixed a bug of each player sacrifice a creature/permanent effect, that permanent with shroud could not be sacrificed - locking the game. --- Mage/src/mage/abilities/costs/common/SacrificeAllCost.java | 5 ++--- .../mage/abilities/effects/common/SacrificeAllEffect.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Mage/src/mage/abilities/costs/common/SacrificeAllCost.java b/Mage/src/mage/abilities/costs/common/SacrificeAllCost.java index 2e471cfcc3..be3a652f47 100644 --- a/Mage/src/mage/abilities/costs/common/SacrificeAllCost.java +++ b/Mage/src/mage/abilities/costs/common/SacrificeAllCost.java @@ -35,7 +35,6 @@ import mage.abilities.costs.CostImpl; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.target.common.TargetControlledPermanent; /** * @@ -43,8 +42,8 @@ import mage.target.common.TargetControlledPermanent; */ public class SacrificeAllCost extends CostImpl { - private FilterPermanent filter; - private List permanents = new ArrayList(); + private final FilterPermanent filter; + private final List permanents = new ArrayList<>(); public SacrificeAllCost(FilterPermanent filter) { this.filter = filter; diff --git a/Mage/src/mage/abilities/effects/common/SacrificeAllEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeAllEffect.java index 6b406eb4b9..57a93b530d 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeAllEffect.java @@ -85,12 +85,12 @@ public class SacrificeAllEffect extends OneShotEffect { return false; } - List perms = new ArrayList(); + List perms = new ArrayList<>(); for (UUID playerId : controller.getInRange()) { Player player = game.getPlayer(playerId); if (player != null) { int numTargets = Math.min(amount.calculate(game, source, this), game.getBattlefield().countAll(filter, player.getId(), game)); - TargetControlledPermanent target = new TargetControlledPermanent(numTargets, numTargets, filter, false); + TargetControlledPermanent target = new TargetControlledPermanent(numTargets, numTargets, filter, true); if (target.canChoose(player.getId(), game)) { while (!target.isChosen() && player.isInGame()) { player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);