Examples of SubtypePredicate


Examples of mage.filter.predicate.mageobject.SubtypePredicate

        return true;
    }

    private void searchLand(Player player, Ability source, Game game, Cards cards, String subtype) {
        FilterLandCard filter = new FilterLandCard(subtype);
        filter.add(new SubtypePredicate(subtype));
        TargetCardInLibrary target = new TargetCardInLibrary(filter);
        if (player.searchLibrary(target, game)) {
            Card card = player.getLibrary().remove(target.getFirstTarget(), game);
            if (card != null) {
                card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        return false;
    }

    private void searchLand(Player player, Ability source, Game game, Cards cards, String subtype) {
        FilterLandCard filter = new FilterLandCard(subtype);
        filter.add(new SubtypePredicate(subtype));
        TargetCardInLibrary target = new TargetCardInLibrary(filter);
        if (player.searchLibrary(target, game)) {
            Card card = player.getLibrary().remove(target.getFirstTarget(), game);
            if (card != null) {
                card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        this.addAbility(new KickerAbility("{X}"));
       
        // Saproling creatures and other Treefolk creatures get +1/+1.
        FilterCreaturePermanent filter = new FilterCreaturePermanent("Saproling creatures and other Treefolk creatures");
        filter.add(Predicates.or(
                Predicates.and(new SubtypePredicate("Treefolk"), Predicates.not(new PermanentIdPredicate(this.getId()))),
                new SubtypePredicate("Saproling"))
                );
        filter.add(Predicates.not(new PermanentIdPredicate(this.getId())));
               
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1,1, Duration.WhileOnBattlefield, filter, false)));
       
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        Player controller = game.getPlayer(source.getControllerId());
        if (controller == null) {
            return false;
        }
        FilterPermanentCard filter = new FilterPermanentCard("Goblin permanent card from your hand");
        filter.add(new SubtypePredicate("Goblin"));
        TargetCardInHand target = new TargetCardInHand(filter);
        if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
            Card card = game.getCard(target.getFirstTarget());
            if (card != null) {
                controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

                String choiceText = "Put a " + subtype.toLowerCase() + " creature card from your hand onto the battlefield?";

                if (player != null) {
                    if (player.chooseUse(Outcome.PutCreatureInPlay, choiceText, game)) {
                        FilterCreatureCard creatureTypeFilter = new FilterCreatureCard();
                        creatureTypeFilter.add(new SubtypePredicate(subtype));

                        TargetCardInHand target = new TargetCardInHand(creatureTypeFilter);
                        if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
                            Card card = game.getCard(target.getFirstTarget());
                            if (card != null) {
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

    @Override
    public void init(Ability source, Game game) {
        super.init(source, game);

        FilterLandPermanent filter = new FilterLandPermanent("Swamps");
        filter.add(new SubtypePredicate("Swamp"));
        filter.add(new ControllerPredicate(TargetController.YOU));
        this.amount = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);

        Player player = game.getPlayer(source.getControllerId());
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        this.power = new MageInt(3);
        this.toughness = new MageInt(3);
       
        filter.add(Predicates.or(
                new CardIdPredicate(this.getId()),
                new SubtypePredicate("Zombie")));
       
        filter2.add(new CardTypePredicate(CardType.CREATURE));
        filter2.add(Predicates.not(
                new SubtypePredicate("Zombie")));
       
        final String rule = "Whenever Noxious Ghoul or another Zombie enters the battlefield, all non-Zombie creatures get -1/-1 until end of turn.";

        // Whenever Noxious Ghoul or another Zombie enters the battlefield, all non-Zombie creatures get -1/-1 until end of turn.
        this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter2, false), filter, false, rule));
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

        return true;
    }

    private void searchCard(Player player, Ability source, Game game, Cards cards, String subtype) {
        FilterCard filter = new FilterCard(subtype);
        filter.add(new SubtypePredicate(subtype));
        TargetCardInLibrary target = new TargetCardInLibrary(filter);
        if (player.searchLibrary(target, game)) {
            Card card = player.getLibrary().remove(target.getFirstTarget(), game);
            if (card != null) {
                card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

                if (evershrikePermanent == null) {
                    return false;
                }
                FilterCard filterAuraCard = new FilterCard("Aura card with converted mana cost X or less from your hand");
                filterAuraCard.add(new CardTypePredicate(CardType.ENCHANTMENT));
                filterAuraCard.add(new SubtypePredicate("Aura"));
                filterAuraCard.add(new AuraCardCanAttachToPermanentId(evershrikePermanent.getId()));
                filterAuraCard.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, xAmount));
                int count = you.getHand().count(filterAuraCard, game);
                while (you.isInGame() && count > 0 && you.chooseUse(Outcome.Benefit, "Do you wish to put an Aura card from your hand onto Evershrike", game)) {
                    TargetCard targetAura = new TargetCard(Zone.PICK, filterAuraCard);
View Full Code Here

Examples of mage.filter.predicate.mageobject.SubtypePredicate

    public boolean apply(Game game, Ability source) {
        Player you = game.getPlayer(source.getControllerId());
        Permanent attackingCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (you != null && attackingCreature != null) {
            FilterCard filter = new FilterCard("aura that could enchant the lone attacking creature");
            filter.add(new SubtypePredicate("Aura"));
            filter.add(new AuraCardCanAttachToPermanentId(attackingCreature.getId()));
            if (you.chooseUse(Outcome.Benefit, "Do you want to search your library?", game)) {
                TargetCardInLibrary target = new TargetCardInLibrary(filter);
                target.setNotTarget(true);
                if (you.searchLibrary(target, game)) {
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.