Examples of sacrifice()


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

        TargetControlledPermanent sacrificeLand = new TargetControlledPermanent(0, Integer.MAX_VALUE, new FilterControlledLandPermanent("lands you control"), true);
        if(player.chooseTarget(Outcome.Sacrifice, sacrificeLand, source, game)){
            for(Object uuid : sacrificeLand.getTargets()){
                Permanent land = game.getPermanent((UUID)uuid);
                if(land != null){
                    land.sacrifice(source.getSourceId(), game);
                    amount++;
                }
            }
        }
        TargetCardInLibrary target = new TargetCardInLibrary(amount, new FilterLandCard("lands"));
View Full Code Here

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

        TargetControlledPermanent targetArtifact = new TargetControlledPermanent(new FilterControlledArtifactPermanent());
        if(controller.chooseTarget(Outcome.Sacrifice, targetArtifact, source, game)){
            Permanent permanent = game.getPermanent(targetArtifact.getFirstTarget());
            if(permanent != null){
                convertedManaCost = permanent.getManaCost().convertedManaCost();
                sacrifice = permanent.sacrifice(source.getSourceId(), game);
            }
        }
        else
        {
            return true;
View Full Code Here

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

                }
            }

            game.informPlayers(new StringBuilder(sourceObject != null ? sourceObject.getName() : "")
                    .append(": ").append(player.getName()).append(" hasn't paid").toString());
            creatureToPayFor.sacrifice(source.getSourceId(), game);
        }
    }
   
    private List<Permanent> getPermanentsWithTheHighestCMC(Game game, UUID playerId, FilterPermanent filter) {
        List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter, playerId, game);
View Full Code Here

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

                GenericManaCost cost = new GenericManaCost(count);
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    return true;
                }
            }
            permanent.sacrifice(source.getSourceId(), game);
            return true;
        }
        return false;
    }
View Full Code Here

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

                    int sacrificePile = rnd.nextInt(3) + 1; // random number from 1 - 3
                    game.informPlayers(new StringBuilder(player.getName()).append(" sacrifices pile number ").append(sacrificePile).toString());
                    for (UUID permanentId : playerPiles.getValue().get(sacrificePile)) {
                        Permanent permanent = game.getPermanent(permanentId);
                        if (permanent != null) {
                            permanent.sacrifice(source.getSourceId(), game);
                        }
                    }
                }

            }
View Full Code Here

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

        Target target = new TargetControlledCreaturePermanent(1, 1, filter, true);
        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) {
                permanent.sacrifice(source.getSourceId(), game);
                return true;
            }
        } else {
            player.damage(7, source.getSourceId(), game, false, true);
            return true;
View Full Code Here

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

            target.choose(Outcome.Sacrifice, player.getId(), source.getSourceId(), game);
            int sacrificedPermanents = 0;
            for (UUID permanentId : target.getTargets()) {
                Permanent permanent = game.getPermanent(permanentId);
                if (permanent != null) {
                    if (permanent.sacrifice(source.getSourceId(), game)) {
                        sacrificedPermanents++;
                    }
                }
            }
            player.discard(drawnCards - sacrificedPermanents, source, game);
View Full Code Here

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

            }

            for (int idx = 0; idx < target.getTargets().size(); idx++) {
                Permanent permanent = game.getPermanent((UUID) target.getTargets().get(idx));
                if (permanent != null) {
                    sacrificed |= permanent.sacrifice(source.getSourceId(), game);
                }
            }
        }

        if (sacrificed) {
View Full Code Here

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

        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

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

                        }
                    }
                }
            }
            for (Permanent permanent :toSacrifice) {
                permanent.sacrifice(source.getSourceId(), game);
            }
            return true;
        }
        return false;
    }
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.