Examples of SubtypePredicate


Examples of mage.filter.predicate.mageobject.SubtypePredicate

   

    public FilterControlledCreaturePermanent(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

        // This is called the "planeswalker uniqueness rule."
        if (planeswalkers.size() > 1) {  //don't bother checking if less than 2 planeswalkers in play
            for (Permanent planeswalker: planeswalkers) {
                for (String planeswalkertype: planeswalker.getSubtype()) {
                    FilterPlaneswalkerPermanent filterPlaneswalker = new FilterPlaneswalkerPermanent();
                    filterPlaneswalker.add(new SubtypePredicate(planeswalkertype));
                    filterPlaneswalker.add(new ControllerIdPredicate(planeswalker.getControllerId()));
                    if (getBattlefield().contains(filterPlaneswalker, planeswalker.getControllerId(), this, 2)) {
                        Player controller = this.getPlayer(planeswalker.getControllerId());
                        if (controller != null) {
                            Target targetPlaneswalkerToKeep = new TargetPermanent(filterPlaneswalker);
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        if (player == null) {
            return false;
        }

        FilterCreatureCard filter = new FilterCreatureCard("Goblin creature card from your hand");
        filter.add(new SubtypePredicate("Goblin"));
        TargetCardInHand target = new TargetCardInHand(filter);
        if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
            Card card = game.getCard(target.getFirstTarget());
            if (card != null) {
                card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        this.toughness = new MageInt(3);

        FilterPermanent filter = new FilterPermanent("Kabira Evangel or another Ally");
        filter.add(Predicates.or(
        new CardIdPredicate(this.getId()),
        new SubtypePredicate("Ally")));

        // Whenever Kabira Evangel or another Ally enters the battlefield under your control, you may choose a color. If you do, Allies you control gain protection from the chosen color until end of turn.
        this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new ChooseColorEffect(), filter, true));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        this("a Spirit or Arcane spell");
    }

    public FilterSpiritOrArcaneCard(String name) {
        super(name);
        this.add(Predicates.or(new SubtypePredicate("Spirit"),new SubtypePredicate("Arcane")));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        addCost(new SacrificeSourceCost());
        FilterCard filter = new FilterCard(subTypeNames(subtypes));
        filter.add(new CardTypePredicate(CardType.LAND));
        ArrayList<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
        for (String subtype : subtypes) {
            subtypePredicates.add(new SubtypePredicate(subtype));
        }
        filter.add(Predicates.or(subtypePredicates));
        TargetCardInLibrary target = new TargetCardInLibrary(filter);
        addEffect(new SearchLibraryPutInPlayEffect(target, false, true, Outcome.PutLandInPlay));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        if (player == null) {
            return false;
        }

        FilterCard filter = new FilterCard("Equipment");
        filter.add(new SubtypePredicate("Equipment"));
        TargetCardInLibrary target = new TargetCardInLibrary(filter);
        if (player.searchLibrary(target, game)) {
            Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
            if (card != null) {
                card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

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

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        if (player == null) {
            return false;
        }

        FilterControlledPermanent filter = new FilterControlledPermanent("Vampire");
        filter.add(new SubtypePredicate("Vampire"));
        int amount = game.getBattlefield().countAll(filter, source.getControllerId(), game);
        Set<UUID> opponents = game.getOpponents(source.getControllerId());

        int total = 0;
        for (UUID opponentUuid : opponents) {
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            FilterPermanent filter = new FilterControlledLandPermanent(new StringBuilder("any number of ").append(sweepSubtype).append("s you control").toString());
            filter.add(new SubtypePredicate(sweepSubtype));
            Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
            if (controller.chooseTarget(outcome, target, source, game)) {
                game.getState().setValue(CardUtil.getCardZoneString("sweep", source.getSourceId(), game), target.getTargets().size());
                for (UUID uuid : target.getTargets()) {
                    Permanent land = game.getPermanent(uuid);
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.