Package mage.filter.predicate.permanent

Examples of mage.filter.predicate.permanent.BlockedByIdPredicate


        this.addAbility(ability);

        // {B}{G}: Exile target creature blocking or blocked by Sisters of Stone Death.
        Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(exileId, "Sisters Of Stone Death"), new ManaCostsImpl("{B}{G}"));
        FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking or blocked by Sisters of Stone Death");
        filter.add(Predicates.or(new BlockedByIdPredicate(this.getId()),
                new BlockingAttackerIdPredicate(this.getId())));
        ability2.addTarget(new TargetCreaturePermanent(filter));
        this.addAbility(ability2);

        // {2}{B}: Put a creature card exiled with Sisters of Stone Death onto the battlefield under your control.
View Full Code Here


        this.power = new MageInt(5);
        this.toughness = new MageInt(5);

        // {W}{B}: Destroy target creature blocking or blocked by Cromat.
        FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking or blocked by {this}");
        filter.add(Predicates.or(new BlockedByIdPredicate(this.getId()),
                                 new BlockingAttackerIdPredicate(this.getId())));       
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{W}{B}"));
        ability.addTarget(new TargetCreaturePermanent(filter));
        this.addAbility(ability);
        // {U}{R}: Cromat gains flying until end of turn.
View Full Code Here

        this.power = new MageInt(6);
        this.toughness = new MageInt(6);

        // Creatures blocking or blocked by Alms Beast have lifelink.
        FilterCreaturePermanent filter = new FilterCreaturePermanent();
        filter.add(Predicates.or(new BlockedByIdPredicate(this.getId()),
                                 new BlockingAttackerIdPredicate(this.getId())));
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(LifelinkAbility.getInstance(), Duration.EndOfCombat, filter,
                "Creatures blocking or blocked by {this} have lifelink")));
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        Permanent sourceCreature = game.getPermanent(source.getSourceId());
        if (controller != null && sourceCreature != null) {
            FilterCreaturePermanent filter = new FilterCreaturePermanent("creature it's blocking");
            filter.add(new BlockedByIdPredicate((source.getSourceId())));
            Target target = new TargetCreaturePermanent(filter);
            if (target.canChoose(source.getSourceId(), controller.getId(), game)) {
                if (controller.chooseTarget(outcome, target, source, game)) {
                    Permanent attackingCreature = game.getPermanent(target.getFirstTarget());
                    if (attackingCreature != null) {
View Full Code Here

TOP

Related Classes of mage.filter.predicate.permanent.BlockedByIdPredicate

Copyright © 2018 www.massapicom. 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.