Examples of sacrifice()


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

            }

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

            sacrifices.clear();
            count++;
View Full Code Here

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

    public boolean apply(Game game, Ability source) {
        Permanent enchantment = game.getPermanent(source.getSourceId());
        if (enchantment != null && enchantment.getAttachedTo() != null) {
            Permanent creature = game.getPermanent(enchantment.getAttachedTo());
            if (creature != null) {
                return creature.sacrifice(source.getSourceId(), game);
            }
        }
        return false;
    }
View Full Code Here

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

        }

        for (UUID uuid : chosen) {
            Permanent permanent = game.getPermanent(uuid);
            if (permanent != null) {
                permanent.sacrifice(source.getSourceId(), game);
            }
        }
        return true;
    }
View Full Code Here

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

                        Target target = new TargetCreaturePermanent(creaturesToSacrifice, creaturesToSacrifice, 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

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

                        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

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

    @Override
    public boolean apply(Game game, Ability source) {       
        Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget());
        if (permanent != null) {
            if (permanent.sacrifice(source.getSourceId(), game)) {
                Player permanentController = game.getPlayer(permanent.getControllerId());
                if (permanentController != null) {
                    Library library = permanentController.getLibrary();
                    if (library.size() > 0) {
                        Cards cards = new CardsImpl();
View Full Code Here

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

            Target target = new TargetControlledPermanent(new FilterControlledCreaturePermanent());

            if (target.canChoose(player.getId(), game) && player.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) {
                Permanent permanent = game.getPermanent(target.getFirstTarget());
                if (permanent != null) {
                    return permanent.sacrifice(source.getSourceId(), game);
                }
            }
        }
        return false;
    }
View Full Code Here

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

            if (player.chooseUse(Outcome.ReturnToHand, "Sacrifice a land to copy this spell?", game)){
                TargetControlledPermanent target = new TargetControlledPermanent(new FilterControlledLandPermanent());
                if (player.chooseTarget(Outcome.Sacrifice, target, source, game)){
                    Permanent land = game.getPermanent(target.getFirstTarget());
                    if(land != null){
                        if(land.sacrifice(source.getSourceId(), game)){
                            Spell spell = game.getStack().getSpell(source.getSourceId());
                            if (spell != null) {
                                Spell copy = spell.copySpell();
                                copy.setControllerId(player.getId());
                                copy.setCopiedSpell(true);
View Full Code Here

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

            player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);

            Permanent permanent = game.getPermanent(target.getFirstTarget());
            if (permanent != null) {
                controller.gainLife(permanent.getToughness().getValue(), game);
                return permanent.sacrifice(source.getSourceId(), game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

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

                    cost.clearPaid();
                    if (cost.pay(source, game, source.getSourceId(), equipped.getControllerId(), false)) {
                        return true;
                    }
                }
                equipped.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.