Package mage.filter.common

Examples of mage.filter.common.FilterCreaturePermanent


   
    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            if (game.getBattlefield().countAll(new FilterCreaturePermanent("Demon", "Demon"), source.getControllerId(), game) < 1) {
                controller.loseLife(1, game);
            }
            return true;
        }
        return false;
View Full Code Here


        this.color.setRed(true);
        this.power = new MageInt(2);
        this.toughness = new MageInt(2);

        // All Sliver creatures get +1/+0.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 0, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures"), false)));
    }
View Full Code Here

        if (ability instanceof EntersBattlefieldTriggeredAbility) {
            for(UUID opponentId : game.getOpponents(ability.getControllerId())) {
                Player opponent = game.getPlayer(opponentId);
                if (opponent != null) {
                    ability.getTargets().clear();
                    FilterCreaturePermanent filter = new FilterCreaturePermanent(new StringBuilder("creature from opponent ").append(opponent.getName()).toString());
                    filter.add(new ControllerIdPredicate(opponentId));
                    TargetCreaturePermanent target = new TargetCreaturePermanent(0,1, filter,false);
                    ability.addTarget(target);
                }
            }
        }
View Full Code Here

        this.toughness = new MageInt(4);

        // Vigilance
        this.addAbility(VigilanceAbility.getInstance());
        // protection from creatures
        this.addAbility(new ProtectionAbility(new FilterCreaturePermanent("creatures")));
        // Whenever a creature deals combat damage to you, destroy that creature. Put a 1/1 white and black Spirit creature token with flying onto the battlefield.
       this.addAbility(new TeysaEnvoyOfGhostsTriggeredAbility());

    }
View Full Code Here

        // Fumiko the Lowblood has bushido X, where X is the number of attacking creatures.
        this.addAbility(new BushidoAbility(new AttackingCreatureCount("the number of attacking creatures")));

        // Creatures your opponents control attack each turn if able.
        FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
        filter.add(new ControllerPredicate(TargetController.OPPONENT));
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter)));

    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        String subtype = (String) game.getState().getValue(source.getSourceId() + "_XenograftType");
        if (subtype != null) {
            List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game);
            for (Permanent permanent : permanents) {
                if (permanent != null && !permanent.getSubtype().contains(subtype)) {
                    permanent.getSubtype().add(subtype);
                }
            }
View Full Code Here

        super(effect);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        int amount = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game);
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            player.gainLife(amount, game);
        }
        return true;
View Full Code Here

        int amount = (new ManacostVariableValue()).calculate(game, source, this);
        if (amount > 0) {
            LinkedList<Permanent> sacrifices = new LinkedList<Permanent>();
            HashMap<UUID, Integer> lifePaidAmounts = new HashMap<UUID, Integer>();

            FilterCreaturePermanent filter = new FilterCreaturePermanent();
            for (UUID playerId : controller.getInRange()) {
                Player player = game.getPlayer(playerId);
                List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(filter, playerId, game);

                int lifePaid = 0;
View Full Code Here

        if (ability instanceof SimpleActivatedAbility) {
            for (Effect effect :ability.getEffects()) {
                if (effect instanceof UnblockableTargetEffect) {
                    int manaX = ability.getManaCostsToPay().getX();
                    ability.getTargets().clear();
                    FilterCreaturePermanent newFilter = new FilterCreaturePermanent(new StringBuilder("creature with power ").append(manaX).append(" or less").toString());
                    filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, manaX +1));
                    Target target = new TargetCreaturePermanent(newFilter);
                    ability.addTarget(target);
                    break;
                }
View Full Code Here

        this.color.setGreen(true);
        this.power = new MageInt(6);
        this.toughness = new MageInt(5);

        // Creatures you control have hexproof.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures"))));

        // Creatures your opponents control lose hexproof and can't have or gain hexproof.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, filter)));

    }
View Full Code Here

TOP

Related Classes of mage.filter.common.FilterCreaturePermanent

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.