Package mage.abilities.costs.common

Examples of mage.abilities.costs.common.SacrificeTargetCost.pay()


        Player opponent = game.getPlayer(source.getFirstTarget());
        if (opponent != null) {
            Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent());
            if (cost.canPay(source, source.getSourceId(), opponent.getId(), game)
                    && opponent.chooseUse(outcome, "Sacrifice a creature to prevent the card draw?", game)) {
                if (cost.pay(source, game, source.getSourceId(), opponent.getId(), false)) {
                    return true;
                }
            }
            cost = new PayLifeCost(3);
            if (cost.canPay(source, source.getSourceId(), opponent.getId(), game)
View Full Code Here


                }
            }
            cost = new PayLifeCost(3);
            if (cost.canPay(source, source.getSourceId(), opponent.getId(), game)
                    && opponent.chooseUse(outcome, "Pay 3 life to prevent the card draw?", game)) {
                if (cost.pay(source, game, source.getSourceId(), opponent.getId(), false)) {
                    return true;
                }
            }
            game.getPlayer(source.getControllerId()).drawCards(1, game);
            return true;
View Full Code Here

        Player defender = game.getPlayer(defendingPlayerId);
        if (defender != null && sourceObject != null) {
            Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent());
            if (cost.canPay(source, source.getSourceId(), defendingPlayerId, game) &&
                    defender.chooseUse(Outcome.LoseAbility, "Sacrifice a creature to prevent " + sourceObject.getLogName() + " from getting unblockable?", game)) {
                if (!cost.pay(source, game, source.getSourceId(), defendingPlayerId, false)) {
                    // cost was not payed - so source gets unblockable
                    ContinuousEffect effect = new UnblockableSourceEffect(Duration.EndOfTurn);
                    game.addEffect(effect, source);
                }
            }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")));
            if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
                for (UUID targetId: getTargetPointer().getTargets(game, source)) {
                    Card card = game.getCard(targetId);
                    if (card != null) {
                        player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), 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.