Search in sources :

Example 11 with FilterArtifactCard

use of mage.filter.common.FilterArtifactCard in project mage by magefree.

the class CovertTechnicianEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int damage = (Integer) getValue("damage");
    FilterCard filter = new FilterArtifactCard("artifact card with mana value " + damage + " or less");
    filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, damage + 1));
    return new PutCardFromHandOntoBattlefieldEffect(filter).apply(game, source);
}
Also used : FilterCard(mage.filter.FilterCard) ManaValuePredicate(mage.filter.predicate.mageobject.ManaValuePredicate) FilterArtifactCard(mage.filter.common.FilterArtifactCard) PutCardFromHandOntoBattlefieldEffect(mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect)

Aggregations

FilterArtifactCard (mage.filter.common.FilterArtifactCard)11 Player (mage.players.Player)9 Card (mage.cards.Card)5 ManaValuePredicate (mage.filter.predicate.mageobject.ManaValuePredicate)5 Permanent (mage.game.permanent.Permanent)5 FilterCard (mage.filter.FilterCard)4 TargetCardInLibrary (mage.target.common.TargetCardInLibrary)3 UUID (java.util.UUID)2 Cards (mage.cards.Cards)2 CardsImpl (mage.cards.CardsImpl)2 FilterArtifactPermanent (mage.filter.common.FilterArtifactPermanent)2 TargetCard (mage.target.TargetCard)2 TargetCardInYourGraveyard (mage.target.common.TargetCardInYourGraveyard)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 Set (java.util.Set)1 MageObject (mage.MageObject)1 Cost (mage.abilities.costs.Cost)1 PayVariableLoyaltyCost (mage.abilities.costs.common.PayVariableLoyaltyCost)1