* Haktos the Unscarred - Fixed some problems with the protection ability not working correctly.

This commit is contained in:
LevelX2 2020-01-14 00:34:48 +01:00
parent cf072f0b1a
commit 42265d78d8
3 changed files with 16 additions and 15 deletions

View file

@ -1,4 +1,3 @@
package mage.abilities.keyword;
import java.util.ArrayList;
@ -81,8 +80,10 @@ public class ProtectionAbility extends StaticAbility {
}
if (filter instanceof FilterCard) {
if (source instanceof Card) {
return !filter.match(source, game);
if (source instanceof Permanent) {
return !((FilterCard) filter).match((Card) source, getSourceId(), ((Permanent) source).getControllerId(), game);
} else if (source instanceof Card) {
return !((FilterCard) filter).match((Card) source, getSourceId(), ((Card) source).getOwnerId(), game);
}
return true;
}
@ -120,7 +121,9 @@ public class ProtectionAbility extends StaticAbility {
return removeAuras;
}
public List<ObjectColor> getColors() { return colors; }
public List<ObjectColor> getColors() {
return colors;
}
public UUID getAuraIdNotToBeRemoved() {
return auraIdNotToBeRemoved;

View file

@ -1,15 +1,14 @@
package mage.filter;
import mage.cards.Card;
import mage.constants.TargetController;
import mage.filter.predicate.*;
import mage.game.Game;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import mage.cards.Card;
import mage.constants.TargetController;
import mage.filter.predicate.*;
import mage.game.Game;
/**
* @author BetaSteward_at_googlemail.com