Add tests based on gatherer
@@ -4,6 +4,7 @@ import mage.MageObject;
import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
+import mage.abilities.keyword.MorphAbility;
import mage.cards.Card;
import mage.filter.predicate.Predicate;
import mage.game.Game;
@@ -12,17 +13,30 @@ import mage.game.Game;
* Created by Alexsandro.
*/
public class NoAbilityPredicate implements Predicate<MageObject> {
+
@Override
public boolean apply(MageObject input, Game game) {
+ boolean isFaceDown = false;
Abilities<Ability> abilities;
if (input instanceof Card){
abilities = ((Card)input).getAbilities(game);
+
+ isFaceDown = ((Card)input).isFaceDown(game);
} else {
abilities = input.getAbilities();
}
+ if (isFaceDown) {
+ for (Ability ability : abilities){
+ if(ability.getSourceId() != input.getId()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ for (Ability ability : abilities){
+ if (ability.getClass() != SpellAbility.class){
- for (Ability a : abilities){
- if (a.getClass() != SpellAbility.class){
return false;
}
}
