Package mage.game.permanent

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


                return permanent.sacrifice(source.getSourceId(), game);
            }
        }
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            return permanent.sacrifice(source.getSourceId(), game);
        }
        return false;

    }
View Full Code Here


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

                if ( permanent != null ) {
                    abilityApplied |= permanent.sacrifice(source.getSourceId(), game);
                }
            }

            return abilityApplied;
        }
View Full Code Here

                Permanent permanent = game.getPermanent(targetId);
                if (permanent == null) {
                    return false;
                }
                permanents.add(permanent.copy());
                paid |= permanent.sacrifice(sourceId, game);
            }
            if (!paid && targets.get(0).getNumberOfTargets() == 0) {
                paid = true; // e.g. for Devouring Rage
            }
        }
View Full Code Here

                cost.clearPaid();
                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

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

                    if (permanent != null) {
                        abilityApplied |= permanent.sacrifice(source.getSourceId(), game);
                    }
                }

                return abilityApplied;
            }
View Full Code Here

    @Override
    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent permanent = game.getPermanent(sourceId);
        if (permanent != null) {
            paid = permanent.sacrifice(sourceId, game);
        }
        return paid;
    }

    @Override
View Full Code Here

                    for (UUID targetId: target.getTargets()) {
                        Permanent targetCreature = game.getPermanent(targetId);
                        if (targetCreature != null) {
                            cardSubtypes.add((ArrayList<String>) targetCreature.getSubtype());
                        }
                        if (targetCreature == null || !targetCreature.sacrifice(source.getSourceId(), game)) {
                            return false;
                        }
                    }
                    int amountCounters;
                    if (devourFactor == DevourFactor.DevourX) {
View Full Code Here

    Player player = game.getPlayer(source.getControllerId());
    if (player != null) {
      if (player.flipCoin()) {
        Permanent perm = game.getPermanent(source.getSourceId());
        if (perm != null) {
          perm.sacrifice(source.getId(), game);
        }
        player.drawCards(3, game);
        return true;
      }
    }
View Full Code Here

                if (opponent != null && opponent.chooseUse(Outcome.LoseLife, sb.toString(), game)) {
                    game.informPlayers(opponent.getName() + " has chosen to receive 4 damage from " + permanent.getName());
                    int dealt = opponent.damage(4, permanent.getId(), game, false, true);
                    if (dealt == 4) {
                        game.informPlayers(opponent.getName() + " was dealt 4 damage so " + permanent.getName() + " will be sacrificed.");
                        permanent.sacrifice(source.getSourceId(), game);
                        return true;
                    } else {
                        game.informPlayers("4 damage wasn't dealt so " + permanent.getName() + " won't be sacrificed.");
                    }
                }
View Full Code Here

                }
            }
            for(UUID creatureId: toSacrifice) {
                Permanent creature = game.getPermanent(creatureId);
                if (creature != null) {
                    creature.sacrifice(source.getSourceId(), game);
                    Player player = game.getPlayer(creature.getControllerId());
                    if (player != null) {
                        game.informPlayers(new StringBuilder(player.getName()).append(" sacrifices ").append(creature.getName()).toString());
                    }
                }
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.