Package mage.target.common

Examples of mage.target.common.TargetLandPermanent.choose()


    @Override
    public boolean apply(Game game, Ability source) {
        TargetLandPermanent target = new TargetLandPermanent(0, amount, new FilterLandPermanent(), true);
        if (target.canChoose(source.getControllerId(), game)) {
            if (target.choose(Outcome.Untap, source.getControllerId(), source.getSourceId(), game)) {
                for (Object targetId : target.getTargets()) {
                    Permanent p = game.getPermanent((UUID) targetId);
                    if (p.isTapped())
                        p.untap(game);
                }
View Full Code Here


                    FilterLandPermanent filter = new FilterLandPermanent();
                    filter.add(new ControllerIdPredicate(playerId));
                    int landsToSacrifice = (int) Math.ceil(game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) / 3.0);
                    if (landsToSacrifice > 0) {
                        Target target = new TargetLandPermanent(landsToSacrifice, landsToSacrifice, filter, true);
                        target.choose(Outcome.Sacrifice, playerId, source.getSourceId(), game);
                        for (UUID permanentId : target.getTargets()) {
                            Permanent permanent = game.getPermanent(permanentId);
                            if (permanent != null) {
                                permanent.sacrifice(source.getSourceId(), 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.