Package mage.game.permanent

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


                    }
                    searchTheCityExileZone.remove(card);
                    if (searchTheCityExileZone.isEmpty()) {
                        Permanent permanent = game.getPermanent(source.getSourceId());
                        if (permanent != null) {
                            permanent.sacrifice(source.getSourceId(), game);
                            // extra turn
                            game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false));
                        }
                    }
                    return true;
View Full Code Here


            Target target = new TargetControlledCreaturePermanent();
            target.setNotTarget(true);
            if (you.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) {
                Permanent creature = game.getPermanent(target.getFirstTarget());
                if (creature != null) {
                    if (creature.sacrifice(source.getSourceId(), game)) {
                        you.gainLife(creature.getToughness().getValue(), game);
                        return true;
                    }
                }
            }
View Full Code Here

            player.chooseTarget(Outcome.Sacrifice, target, source, game);
            int numSacrificed = 0;
            for (UUID permanentId : target.getTargets()) {
                Permanent permanent = game.getPermanent(permanentId);
                if (permanent != null) {
                    if (permanent.sacrifice(source.getSourceId(), game)) {
                        numSacrificed++;
                    }
                }
            }
            if (numSacrificed > 0) {
View Full Code Here

                    }
                }
                // sacrifice all lands
                for (Permanent permanent :permanentsToSacrifice) {
                    permanent.sacrifice(source.getSourceId(), game);
                }
            }
        }
        return false;
    }
View Full Code Here

            if (target.getTargets().size() > 0) {
                int sacrificedCreatures = target.getTargets().size();
                game.informPlayers(new StringBuilder(controller.getName()).append(" sacrifices ").append(sacrificedCreatures).append(" creatures for ").append(creature.getName()).toString());
                for (UUID targetId: target.getTargets()) {
                    Permanent targetCreature = game.getPermanent(targetId);
                    if (targetCreature == null || !targetCreature.sacrifice(source.getSourceId(), game)) {
                        return false;
                    }
                }
                creature.addCounters(CounterType.P1P1.createInstance(sacrificedCreatures), game);
            }
View Full Code Here

                player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
            }
            Permanent permanent = game.getPermanent(target.getFirstTarget());
            if (permanent != null) {
                int gainLife = permanent.getToughness().getValue();
                permanent.sacrifice(source.getSourceId(), game);
                player.gainLife(gainLife, game);
            } else{
                return false;
            }
        }
View Full Code Here

                if (target.canChoose(targetPlayer.getId(), game)) {
                    targetPlayer.choose(Outcome.Sacrifice, target, source.getSourceId(), game);

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

            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

                            if(card.getCardType().contains(CardType.CREATURE)){
                                // If a creature card is put into that graveyard this way, sacrifice Helm of Obedience
                                // and put that card onto the battlefield under your control.
                                Permanent sourcePermanent = game.getPermanent(source.getSourceId());
                                if (sourcePermanent != null) {
                                    sourcePermanent.sacrifice(source.getSourceId(), game);
                                }
                                if (game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) {
                                    card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
                                }
                                break;
View Full Code Here

                Player player = game.getPlayer(playerId);
                Target target = new TargetControlledCreaturePermanent();
                if (player != null && player.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) {
                    Permanent permanent = game.getPermanent(target.getFirstTarget());
                    if (permanent != null) {
                        permanent.sacrifice(source.getSourceId(), game);
                    }
                }
            }
        }
        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.