Implement AdventurePredicate.

This adds support for Edgewall Innkeeper (and similar cards) and Memory Theft.
This commit is contained in:
Patrick Hulin 2019-12-09 13:50:07 -05:00
parent 6160bc25ef
commit af5ccf6914
4 changed files with 152 additions and 52 deletions

View file

@ -7,6 +7,7 @@ package mage.cards;
import mage.constants.CardType;
import mage.constants.SpellAbilityType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
@ -23,6 +24,7 @@ public class AdventureCardSpellImpl extends CardImpl implements AdventureCardSpe
public AdventureCardSpellImpl(UUID ownerId, CardSetInfo setInfo, CardType[] cardTypes, String costs, AdventureCard adventureCardParent) {
super(ownerId, setInfo, cardTypes, costs, SpellAbilityType.ADVENTURE_SPELL);
this.subtype.add(SubType.ADVENTURE);
this.adventureCardParent = adventureCardParent;
}

View file

@ -1,19 +1,27 @@
package mage.filter.predicate.mageobject;
import mage.MageObject;
import mage.cards.AdventureCard;
import mage.cards.Card;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.stack.Spell;
/**
* @author TheElk801
* TODO: make this actually work
*/
public enum AdventurePredicate implements Predicate<MageObject> {
instance;
@Override
public boolean apply(MageObject input, Game game) {
return false;
if (input instanceof Spell) {
return ((Spell) input).getCard() instanceof AdventureCard;
} else if (input instanceof Card) {
return input instanceof AdventureCard;
} else {
return false;
}
}
@Override