- Fixed AF DestroyAll destroying cards that can't be destroyed in case those cards were granted indestructibility by another card that is destroyed first (e.g. Crested Sunmare + horse tokens and an attempted removal via a Wrath of God type effect).

This commit is contained in:
Agetian
2017-08-09 09:55:25 +00:00
parent 0bf9da71ab
commit d66c0f2d61

View File

@@ -1,5 +1,6 @@
package forge.game.ability.effects;
import com.google.common.base.Predicate;
import forge.game.Game;
import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
@@ -69,6 +70,14 @@ public class DestroyAllEffect extends SpellAbilityEffect {
card.clearRemembered();
}
// exclude cards that can't be destroyed at this moment
list = CardLists.filter(list, new Predicate<Card>() {
@Override
public boolean apply(Card card) {
return card.canBeDestroyed();
}
});
if (noRegen) {
for (Card c : list) {
if (game.getAction().destroyNoRegeneration(c, sa) && remDestroyed) {