mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- 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:
@@ -1,5 +1,6 @@
|
|||||||
package forge.game.ability.effects;
|
package forge.game.ability.effects;
|
||||||
|
|
||||||
|
import com.google.common.base.Predicate;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.ability.AbilityUtils;
|
import forge.game.ability.AbilityUtils;
|
||||||
import forge.game.ability.SpellAbilityEffect;
|
import forge.game.ability.SpellAbilityEffect;
|
||||||
@@ -69,6 +70,14 @@ public class DestroyAllEffect extends SpellAbilityEffect {
|
|||||||
card.clearRemembered();
|
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) {
|
if (noRegen) {
|
||||||
for (Card c : list) {
|
for (Card c : list) {
|
||||||
if (game.getAction().destroyNoRegeneration(c, sa) && remDestroyed) {
|
if (game.getAction().destroyNoRegeneration(c, sa) && remDestroyed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user