Examples of SubtypePredicate


Examples of mage.filter.predicate.mageobject.SubtypePredicate

        }

        Player you = game.getPlayer(source.getControllerId());

        FilterControlledPermanent filter = new FilterControlledPermanent();
        filter.add(new SubtypePredicate("Ally"));

        int numberOfAllies = game.getBattlefield().countAll(filter, you.getId(), game);

        Cards cardsInHand = new CardsImpl(Zone.PICK);
        cardsInHand.addAll(targetPlayer.getHand());
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

    *
    * @param subtype name of the subtype that can be offered
    */
    public OfferingAbility(String subtype) {
        super(Zone.ALL, null);
        filter.add(new SubtypePredicate(subtype));
        filter.setMessage(subtype);
        this.addEffect(new OfferingAsThoughEffect());
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

public class FilterBySubtypeCard extends FilterCard {

    public FilterBySubtypeCard(String subtype) {
        super(subtype + " card");
        this.add(new SubtypePredicate(subtype));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

    }   
   
    public FilterCreaturePermanent(String subtype, String name) {
        super(name);
        this.add(new CardTypePredicate(CardType.CREATURE));
        this.add(new SubtypePredicate(subtype));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

    private final FilterControlledPermanent filter = new FilterControlledPermanent("Vampire");

    public MindlessNullEffect() {
        super(Duration.WhileOnBattlefield);
        filter.add(new SubtypePredicate("Vampire"));
        staticText = "{this} can't block unless you control a Vampire";
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        assertLife(playerB, 20);
        assertLife(playerC, 20);
        assertLife(playerD, 20);

        FilterPermanent filterPermanent = new FilterLandPermanent();
        filterPermanent.add(new SubtypePredicate("Forest"));
        List<Permanent> forestCards = currentGame.getBattlefield().getAllActivePermanents(filterPermanent, currentGame);
        Assert.assertEquals(4, forestCards.size());
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

    public void trigger(Game game, UUID controllerId) {
        this.getTargets().clear();
        int intValue = amount.calculate(game, this, null);
        FilterCard filter = new FilterCard("Spirit card with converted mana cost " + intValue + " or less from your graveyard");
        filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan,  intValue + 1));
        filter.add(new SubtypePredicate("Spirit"));
        this.addTarget(new TargetCardInYourGraveyard(filter));
        super.trigger(game, controllerId); //To change body of generated methods, choose Tools | Templates.
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        StringBuilder sb = new StringBuilder("another ");
        ArrayList<Predicate<MageObject>> subtypesPredicates = new ArrayList<>();
        int i = 0;
        for (String subtype : this.subtypes) {
            subtypesPredicates.add(new SubtypePredicate(subtype));
            if (i == 0) {
                sb.append(subtype);
            } else {
                sb.append(" or ").append(subtype);
            }
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        this.toughness = new MageInt(2);

        FilterPermanent filter = new FilterPermanent("Bala Ged Thief or another Ally");
        filter.add(Predicates.or(
                new CardIdPredicate(this.getId()),
                new SubtypePredicate("Ally")));

        // Whenever Bala Ged Thief or another Ally enters the battlefield under your control, target player reveals a number of cards from his or her hand equal to the number of Allies you control. You choose one of them. That player discards that card.
        Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new BalaGedThiefEffect(), filter, false);
        TargetPlayer target = new TargetPlayer();
        ability.addTarget(target);
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

            String subtype = (String) game.getState().getValue(doorOfDestinies.getId() + "_type");
            if (subtype != null) {
                if (event.getType() == GameEvent.EventType.SPELL_CAST) {
                    FilterSpell filter = new FilterSpell();
                    filter.add(new ControllerPredicate(TargetController.YOU));
                    filter.add(new SubtypePredicate(subtype));
                    Spell spell = game.getStack().getSpell(event.getTargetId());
                    if (spell != null && filter.match(spell, controllerId, game)) {
                        return true;
                    }
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.