Examples of pay()


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

                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

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

        if (creatureToPayFor != null) {
            ManaCost manaCost = CardUtil.removeVariableManaCost(creatureToPayFor.getManaCost());
            String message = new StringBuilder("Pay ").append(manaCost.getText()).append(" (otherwise sacrifice ")
                    .append(creatureToPayFor.getName()).append(")?").toString();
            if (player.chooseUse(Outcome.Benefit, message, game)) {
                if (manaCost.pay(source, game, source.getSourceId(), player.getId(), false)) {
                    game.informPlayers(new StringBuilder(sourceObject != null ? sourceObject.getName() : "")
                            .append(": ").append(player.getName()).append(" has paid").toString());
                    return;
                }
            }
View Full Code Here

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

        Player controller = game.getPlayer(source.getControllerId());
        if (creature != null && controller != null) {
            if (controller.chooseUse(Outcome.Damage, "Pay {2}{R} to do the damage?", game)) {
         // if (controller.chooseUse(Outcome.Damage, "Pay {2}{R}? If you do, " + creature.getName() + " deals damage equal to its power to target creature or player.", game)) {
                ManaCosts manaCosts = new ManaCostsImpl("{2}{R}");
                if (manaCosts.pay(source, game, source.getSourceId(), controller.getId(), false)) {
                    int amount = creature.getPower().getValue();
                    UUID target = source.getTargets().getFirstTarget();
                    Permanent targetCreature = game.getPermanent(target);
                    if (targetCreature != null) {
                        targetCreature.damage(amount, creature.getId(), game, false, true);
View Full Code Here

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

        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            ManaCosts cost = new ManaCostsImpl("{5}{R}{R}");
            if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + "?", game)) {
                cost.clearPaid();
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    new UntapAllControllerEffect(new FilterAttackingCreature(),"").apply(game, source);
                    game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false));
                    return true;
                }
            }
View Full Code Here

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

        ManaCosts cost = new ManaCostsImpl("{X}{R}");
        if (player != null) {
            if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + "? If you do, Flameblast Dragon deals X damage to target creature or player", game)) {
                int costX = player.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
                cost.add(new GenericManaCost(costX));
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    Permanent permanent = game.getPermanent(source.getFirstTarget());
                    if (permanent != null) {
                        permanent.damage(costX, source.getSourceId(), game, false, true);
                        return true;
                    }
View Full Code Here

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

        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);
                            ContinuousEffect effect = new SkipNextUntapTargetEffect();
View Full Code Here

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

        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null && permanent != null) {
            if (player.chooseUse(Outcome.Damage, new StringBuilder("Extort opponents? (").append(permanent.getName()).append(")").toString(), game)) {
                Cost cost = new ManaCostsImpl("{W/B}");
                if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
                    int loseLife = 0;
                    for (UUID opponentId : game.getOpponents(source.getControllerId())) {
                        loseLife += game.getPlayer(opponentId).loseLife(1, game);
                    }
                    if (loseLife > 0) {
View Full Code Here

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

        Player controller = game.getPlayer(source.getControllerId());
        if (creature != null && controller != null) {
            if (controller.chooseUse(Outcome.Damage, "Pay {2}{R} to do the damage?", game)) {
         // if (controller.chooseUse(Outcome.Damage, "Pay {2}{R}? If you do, " + creature.getName() + " deals damage equal to its power to target creature or player.", game)) {
                ManaCosts manaCosts = new ManaCostsImpl("{2}{R}");
                if (manaCosts.pay(source, game, source.getSourceId(), controller.getId(), false)) {
                    int amount = creature.getPower().getValue();
                    UUID target = source.getTargets().getFirstTarget();
                    Permanent targetCreature = game.getPermanent(target);
                    if (targetCreature != null) {
                        targetCreature.damage(amount, creature.getId(), game, false, true);
View Full Code Here

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

                    totalCost.add(cumulativeCost.copy());
                }
                if (player.chooseUse(Outcome.Benefit, totalCost.getText() + "?", game)) {
                    totalCost.clearPaid();
                    int bookmark = game.bookmarkState();
                    if (totalCost.pay(source, game, source.getSourceId(), source.getControllerId(), false)){
                        return true;
                    }
                    else{
                        game.restoreState(bookmark, source.getRule());
                    }
View Full Code Here

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

        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            ManaCosts cost = new ManaCostsImpl("{5}{R}{R}");
            if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + "?", game)) {
                cost.clearPaid();
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    new UntapAllControllerEffect(new FilterAttackingCreature(),"").apply(game, source);
                    game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false));
                    return 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.