Package mage.abilities.costs

Examples of mage.abilities.costs.Cost.clearPaid()


    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            Cost cost = new ManaCostsImpl("{8}");
            if (player.chooseUse(Outcome.Tap, "Pay " + cost.getText() + " and " + staticText, game)) {
                cost.clearPaid();
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    for (UUID target : this.targetPointer.getTargets(game, source)) {
                        Permanent permanent = game.getPermanent(target);
                        if (permanent != null) {
                            permanent.tap(game);
View Full Code Here


                if (costToPay instanceof ManaCost) {
                    message = "Would you like to pay " + costToPay.getText() + " to prevent counter effect?";
                } else {
                    message = costToPay.getText() + " to prevent counter effect?";
                }
                costToPay.clearPaid();
                if (!(player.chooseUse(Outcome.Benefit, message, game) && costToPay.pay(source, game, spell.getSourceId(), spell.getControllerId(), false))) {
                    return game.getStack().counter(spell.getId(), source.getSourceId(), game);
                }
                return true;
            }
View Full Code Here

    }

    @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

                targetPointer.getFirst(game, source));
        Cost cost = new GenericManaCost(1);
        if (spell != null) {
            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(),
View Full Code Here

        Spell spell = game.getStack().getSpell(source.getFirstTarget());
        Cost cost = new GenericManaCost(2);
        if (spell != null) {
            Player player = game.getPlayer(spell.getControllerId());
            if (player != null) {
                cost.clearPaid();
                if (!cost.pay(source, game, spell.getControllerId(),
                        spell.getControllerId(), false)) {
                    return spell.chooseNewTargets(game, source.getControllerId(), true, true);
                }
            }
View Full Code Here

    }

    @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)) {
            Player player = game.getPlayer(source.getControllerId());
            if (player != null) {
                player.gainLife(3, game);
                return true;
View Full Code Here

    }

    @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)) {
            Permanent permanent = game.getPermanent(source.getFirstTarget());
            if (permanent != null) {
                permanent.damage(1, source.getSourceId(), game, false, true);
                return true;
View Full Code Here

                target = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
            }
            if (target != null) {
                Cost cost = new ManaCostsImpl("{2}");
                if (player.chooseUse(outcome, new StringBuilder("Pay ").append(cost.getText()).append(" and put a token copy of ").append(target.getName()).append(" onto the battlefield").toString(), game)) {
                    cost.clearPaid();
                    if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                        if (target instanceof Permanent) {
                            EmptyToken token = new EmptyToken();
                            CardUtil.copyTo(token).from((Permanent)target);
                            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
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.