Package mage.abilities.costs.mana

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


                        }
                        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

            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

    @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

            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

                int amount = source.getManaCostsToPay().getX();
                if (amount > 0) {
                    GenericManaCost cost = new GenericManaCost(amount);
                    StringBuilder sb = new StringBuilder("Pay ").append(cost.getText()).append("?");
                    if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
                        if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
                            game.informPlayers(new StringBuilder(sourceObject.getName()).append(": additional cost was paid").toString());
                            return true;
                        }
                    }
                   
View Full Code Here

                int amount = game.getBattlefield().count(filter, source.getSourceId(), controller.getId(), game);
                if (amount == 0) {
                    game.informPlayers("Spell Syphon: no blue permanents in controller's battlefield.");
                } else {
                    GenericManaCost cost = new GenericManaCost(amount);
                    if (!cost.pay(source, game, spell.getControllerId(), spell.getControllerId(), false)) {
                        game.informPlayers("Spell Syphon: cost wasn't payed - countering target spell.");
                        return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
                    }
                }
            }
View Full Code Here

            Player player = game.getPlayer(spell.getControllerId());
            if (player != null) {
                cost.clearPaid();
                game.getPlayer(spell.getControllerId()).discard(
                        1, source, game);
                if (!cost.pay(source, game, spell.getControllerId(),
                        spell.getControllerId(), false)) {
                    return game.getStack().counter(source.getFirstTarget(),
                            source.getSourceId(), game);
                }
            }
View Full Code Here

                int amount = controller.getGraveyard().size();
                if (amount == 0) {
                    game.informPlayers("Circular Logic: no cards in controller's graveyard.");
                } else {
                    GenericManaCost cost = new GenericManaCost(amount);
                    if (!cost.pay(source, game, spell.getControllerId(), spell.getControllerId(), false)) {
                        game.informPlayers("Circular Logic: cost wasn't payed - countering target spell.");
                        return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
                    }
                }
            }
View Full Code Here

        boolean payed = false;
        while (player.isInGame() && !payed) {
            xValue = player.announceXMana(0, Integer.MAX_VALUE, "How much mana will you pay?", game, source);
            if (xValue > 0) {
                Cost cost = new GenericManaCost(xValue);
                payed = cost.pay(source, game, source.getSourceId(), player.getId(), false);
            } else {
                payed = true;
            }
        }
        game.informPlayers(new StringBuilder(player.getName()).append(" pays {").append(xValue).append("}.").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.