Package mage.game.permanent

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


            }
           
            for (UUID cardId : landsToSacrifice) {
                Permanent permanent = game.getPermanent(cardId);
                if (permanent != null) {
                    permanent.sacrifice(source.getSourceId(), game);
                }
            }

            //Creatures
            int minCreature = Integer.MAX_VALUE;
View Full Code Here


            }
           
            for (UUID cardId : creaturesToSacrifice) {
                Permanent permanent = game.getPermanent(cardId);
                if (permanent != null) {
                    permanent.sacrifice(source.getSourceId(), game);
                }
            }
           
            //Cards in hand
            int minCard = Integer.MAX_VALUE;
View Full Code Here

                            Target target = new TargetControlledPermanent(new FilterControlledCreaturePermanent());
                            if (target.canChoose(opponentId, game)) {
                                if (opponent.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) {
                                    Permanent permanent = game.getPermanent(target.getFirstTarget());
                                    if (permanent != null) {
                                        permanent.sacrifice(source.getSourceId(), game);
                                    }
                                }
                            }
                        }
                    }
View Full Code Here

        Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
        if (controller != null && sourcePermanent != null) {
            if (sourcePermanent.getAttachedTo() != null) {
                Permanent attachedTo = game.getPermanent(sourcePermanent.getAttachedTo());
                if (attachedTo != null) {
                    attachedTo.sacrifice(source.getSourceId(), 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.Sacrifice, controllerId, sourceId, game)) {
            for (UUID targetId: targets.get(0).getTargets()) {
                Permanent permanent = game.getPermanent(targetId);
                if (permanent != null && permanent.sacrifice(sourceId, game)) {
                    sumPower += permanent.getPower().getValue();
                }
            }
        }
        game.informPlayers(new StringBuilder("Sacrificed creatures with total power of ").append(sumPower).toString());
View Full Code Here

                    for (int idx = 0; idx < target.getTargets().size(); idx++) {
                        Permanent permanent = game.getPermanent(target.getTargets().get(idx));

                        if (permanent != null) {
                            permanent.sacrifice(source.getSourceId(), game);
                        }
                    }
                }
            }
            return true;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            if (permanent.sacrifice(source.getSourceId(), game)) {
                for (UUID uuid : game.getOpponents(this.getTargetPointer().getFirst(game, source))) {
                    Player player = game.getPlayer(uuid);
                    if (player != null) {
                        player.drawCards(3, game);
                    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        int affectedTargets = 0;
        for (UUID permanentId : targetPointer.getTargets(game, source)) {
            Permanent permanent = game.getPermanent(permanentId);
            if (permanent != null) {
                permanent.sacrifice(source.getSourceId(), game);
                affectedTargets++;
                Player controller = game.getPlayer(source.getControllerId());
                if (controller != null) {
                    controller.gainLife(permanent.getPower().getValue(), game);
                }
View Full Code Here

        if (target.canChoose(source.getSourceId(), player.getId(), game)) {
            player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
            Permanent permanent = game.getPermanent(target.getFirstTarget());
            if (permanent != null) {
                int amount = permanent.getPower().getValue();
                permanent.sacrifice(source.getSourceId(), game);

                if (amount > 0) {
                    Set<UUID> opponents = game.getOpponents(source.getControllerId());
                    for (UUID opponentId : opponents) {
                        Player opponent = game.getPlayer(opponentId);
View Full Code Here

                if (owner != null
                        && artifact.getCardType().contains(CardType.ARTIFACT)
                        && card.getCardType().contains(CardType.ARTIFACT)
                        && currentZone == Zone.GRAVEYARD
                        && card.getOwnerId().equals(artifact.getControllerId())) {
                    boolean sacrifice = artifact.sacrifice(source.getSourceId(), game);
                    boolean putOnBF = owner.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
                    if (sacrifice || putOnBF) {
                        return true;
                    }
                }
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.