From 4ca067582b64ba63b68032bb588467694c2fca26 Mon Sep 17 00:00:00 2001 From: Sloth Date: Fri, 13 Jan 2012 14:56:34 +0000 Subject: [PATCH] - Improved the AI of AF DestroyAll to take permanents with SacMe SVar into account. --- .../abilityfactory/AbilityFactoryDestroy.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryDestroy.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryDestroy.java index c908575d99f..298afe55846 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryDestroy.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryDestroy.java @@ -759,9 +759,19 @@ public class AbilityFactoryDestroy { humanlist = humanlist.getValidCards(valid.split(","), source.getController(), source); computerlist = computerlist.getValidCards(valid.split(","), source.getController(), source); - - humanlist = humanlist.getNotKeyword("Indestructible"); - computerlist = computerlist.getNotKeyword("Indestructible"); + + humanlist = humanlist.filter(new CardListFilter() { + @Override + public boolean addCard(final Card c) { + return !(c.hasKeyword("Indestructible") || c.getSVar("SacMe").length() > 0); + } + }); + computerlist = computerlist.filter(new CardListFilter() { + @Override + public boolean addCard(final Card c) { + return !(c.hasKeyword("Indestructible") || c.getSVar("SacMe").length() > 0); + } + }); if (abCost != null) { // AI currently disabled for some costs