Examples of pay()


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

                boolean paid = false;
                if (opponent != null) {
                    Cost cost = new PayLifeCost(3);
                    if (cost.canPay(source, source.getSourceId(), opponent.getId(), game)
                            && opponent.chooseUse(outcome, new StringBuilder("Pay 3 live to prevent that ").append(creature.getLogName()).append(" returns to ").append(controller.getName()).append("'s hand?").toString(), game)) {
                        if (cost.pay(source, game, source.getSourceId(), opponent.getId(), false)) {
                            paid = true;
                        }
                    }           
                }
                if (opponent == null || !paid) {
View Full Code Here

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

        if ( player != null ) {
            ReturnToHandTargetCost attackCost = new ReturnToHandTargetCost(new TargetControlledPermanent(filter));
            if ( attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
                 player.chooseUse(Outcome.Neutral, "Return an enchantment you control to hand to attack?", game) )
            {
                if (attackCost.pay(source, game, source.getSourceId(), event.getPlayerId(), true) ) {
                    return false;
                }
            }
            return true;
        }
View Full Code Here

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

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

                }
            }
            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

Examples of mage.abilities.costs.mana.ColoredManaCost.pay()

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        ColoredManaCost cost = new ColoredManaCost(ColoredManaSymbol.R);
        if (player != null) {
            if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "? If you do, copy that ability.  You may choose new targets for the copy.", game)) {
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    Ability ability = (Ability) getValue("stackAbility");
                    Player controller = game.getPlayer(source.getControllerId());
                    Permanent sourcePermanent = game.getPermanent(source.getSourceId());
                    if (ability != null && controller != null) {
                        Ability newAbility = ability.copy();
View Full Code Here

Examples of mage.abilities.costs.mana.GenericManaCost.pay()

    @Override
    public boolean apply(Game game, Ability source) {
        Cost cost = new GenericManaCost(1);
        cost.clearPaid();
        if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
            new MyrToken().putOntoBattlefield(1, game, source.getControllerId(), source.getControllerId());
        }
        return true;
    }
View Full Code Here

Examples of mage.abilities.costs.mana.GenericManaCost.pay()

                        }
                        else
                        {
                            //If it's greater, you may pay {X}, where X is the difference. If you do, put it onto the battlefield.
                            GenericManaCost cost = new GenericManaCost(card.getManaCost().convertedManaCost() - convertedManaCost);
                            if(cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)){
                                controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());                               
                            }
                            else{
                                //If you don't, put it into its owner's graveyard. Then shuffle your library
                                controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
View Full Code Here

Examples of mage.abilities.costs.mana.GenericManaCost.pay()

            if (count == 0) {
                return true;
            }
            if (player.chooseUse(Outcome.Benefit, "Pay " + count + "?", game)) {
                GenericManaCost cost = new GenericManaCost(count);
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    return true;
                }
            }
            permanent.sacrifice(source.getSourceId(), game);
            return true;
View Full Code Here

Examples of mage.abilities.costs.mana.GenericManaCost.pay()

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null) {
            GenericManaCost cost = new GenericManaCost(2);
            if (!cost.pay(source, game, player.getId(), player.getId(), false)) {
                player.damage(2, source.getSourceId(), game, false, true);
            }
            return true;
        }
        return false;
View Full Code Here

Examples of mage.abilities.costs.mana.GenericManaCost.pay()

            Player player = game.getPlayer(creature.getControllerId());
            if (player != null) {
                boolean paid = false;
                if (player.chooseUse(outcome, new StringBuilder("Pay {3} to keep ").append(creature.getName()).append(" on the battlefield?").toString(), game)) {
                    Cost cost = new GenericManaCost(3);
                    if (!cost.pay(source, game, source.getSourceId(), creature.getControllerId(), false)) {
                        paid = true;
                    }
                    if (!paid) {
                        creature.moveToZone(Zone.HAND, source.getSourceId(), game, 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.