Package mage.game.permanent

Examples of mage.game.permanent.Permanent.tap()


            Permanent permanent = game.getPermanent(target);
            if (sourcePermanent != null) {
                sourcePermanent.addConnectedCard("DesertersQuarters", permanent.getId());
            }
            if (permanent != null) {            
                permanent.tap(game);
            }
        }
        return true;
    }
View Full Code Here


            if (player != null) {
                for (UUID targetId : source.getTargets().get(0).getTargets()) {
                    Permanent permanent = game.getPermanent(targetId);
                    if (permanent != null) {
                        if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append("?").toString(), game)) {
                            permanent.tap(game);
                        } else if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append("?").toString(), game)) {
                            permanent.untap(game);
                        }
                    }
                }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent narcolepsy = game.getPermanent(source.getSourceId());
        if (narcolepsy != null) {
            Permanent enchanted = game.getPermanent(narcolepsy.getAttachedTo());
            if (enchanted != null && !enchanted.isTapped()) {
                enchanted.tap(game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        int sumPower = 0;
        if (targets.choose(Outcome.Tap, controllerId, sourceId, game)) {
            for (UUID targetId: targets.get(0).getTargets()) {
                Permanent permanent = game.getPermanent(targetId);
                if (permanent != null && permanent.tap(game)) {
                    sumPower += permanent.getPower().getValue();
                }
            }
        }
        game.informPlayers(new StringBuilder("Tap creatures with total power of ").append(sumPower).toString());
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        for (UUID targetId : this.targetPointer.getTargets(game, source)) {
            Permanent creature = game.getPermanent(targetId);
            if (creature != null) {
                creature.tap(game);
                SkipNextUntapTargetEffect effect = new SkipNextUntapTargetEffect();
                effect.setTargetPointer(new FixedTarget(targetId));
                game.addEffect(effect, source);
            }
        }
View Full Code Here

                        if (player.chooseUse(Outcome.Untap, "Untap that permanent?", game)) {
                            targetPermanent.untap(game);
                        }
                    } else {
                        if (player.chooseUse(Outcome.Tap, "Tap that permanent?", game)) {
                            targetPermanent.tap(game);
                        }
                    }
                    return true;
                }
            }
View Full Code Here

                final StringBuilder sb = new StringBuilder("Pay 2 life otherwise ").append(targetCreature.getName()).append(" will be tapped)");
                if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
                    cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true);
                }
                if (!cost.isPaid()) {
                    return targetCreature.tap(game);
                }
            }
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent creature = game.getPermanent(source.getFirstTarget());
        if (creature != null) {
            creature.tap(game);
        }
        creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
        if (creature != null) {
            creature.tap(game);
        }
View Full Code Here

        if (creature != null) {
            creature.tap(game);
        }
        creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
        if (creature != null) {
            creature.tap(game);
        }
        return new FightTargetsEffect().apply(game, source);
    }
}
View Full Code Here

            boolean abilityApplied = false;

            for (UUID uuid : target.getTargets()) {
                Permanent selectedPermanent = game.getPermanent(uuid);
                if ( selectedPermanent != null ) {
                    abilityApplied |= selectedPermanent.tap(game);
                }
            }

            return abilityApplied;
        }
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.