Examples of canPay()


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

                chooseText = "Pay {3} to attack?";
            } else {
                chooseText = "Pay {3} to block?";
            }
            ManaCostsImpl attackBlockTax = new ManaCostsImpl("{3}");
            if (attackBlockTax.canPay(source, source.getSourceId(), event.getPlayerId(), game)
                    && player.chooseUse(Outcome.Neutral, chooseText, game)) {
                if (attackBlockTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) {
                    return false;
                }
            }
View Full Code Here

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

    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) {
            Player player = game.getPlayer(event.getPlayerId());
            if ( player != null && event.getTargetId().equals(source.getControllerId())) {
                ManaCostsImpl attackTax = new ManaCostsImpl("{2}");
                if ( attackTax.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
                     player.chooseUse(Outcome.Benefit, "Pay {2} to attack player?", game) )
                {
                    if (attackTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
                        return false;
                    }
View Full Code Here

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

    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        if (event.getType() == GameEvent.EventType.DECLARE_ATTACKER) {
            Player player = game.getPlayer(event.getPlayerId());
            if (player != null && event.getTargetId().equals(source.getControllerId())) {
                ManaCostsImpl propagandaTax = new ManaCostsImpl("{WP}");
                if (propagandaTax.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
                        player.chooseUse(Outcome.Benefit, "Pay {WP} to declare attacker?", game)) {
                    if (propagandaTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
                        return false;
                    }
                }
View Full Code Here

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

    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) {
            Player player = game.getPlayer(event.getPlayerId());
            if ( player != null && event.getTargetId().equals(source.getControllerId())) {
                ManaCostsImpl attackCost = new ManaCostsImpl("{2}");
                if ( attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
                     player.chooseUse(Outcome.Benefit, "Pay {2} to attack player?", game) ) {
                    if (attackCost.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
                        return false;
                    }
                }
View Full Code Here

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

        if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) {
            Player player = game.getPlayer(event.getPlayerId());
            if ( player != null ) {
                int ce = countEnchantments.calculate(game, source, this);
                ManaCostsImpl safetyCosts = new ManaCostsImpl("{"+ ce +"}");
                if ( safetyCosts.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
                     player.chooseUse(Outcome.Benefit, "Pay {"+ ce +"} to declare attacker?", game) )
                {
                    if (safetyCosts.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
                        return false;
                    }
View Full Code Here

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

        if (player != null) {
            int amount = xCosts.calculate(game, source, this);
            if (amount > 0) {
                String mana = new StringBuilder("{").append(amount).append("}").toString();
                ManaCostsImpl cost = new ManaCostsImpl(mana);
                if ( cost.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
                    player.chooseUse(Outcome.Benefit, new StringBuilder("Pay ").append(mana).append(" to declare blocker?").toString(), game) ) {
                    if (cost.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) {
                        return false;
                    }
                }
View Full Code Here

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

    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) {
            Player player = game.getPlayer(event.getPlayerId());
            if ( player != null && event.getTargetId().equals(source.getControllerId())) {
                ManaCostsImpl attackTax = new ManaCostsImpl("{2}");
                if ( attackTax.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
                     player.chooseUse(Outcome.Benefit, "Pay {2} to attack player?", game) ) {
                    if (attackTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
                        return false;
                    }
                }
View Full Code Here

Examples of mage.abilities.costs.mana.PhyrexianManaCost.canPay()

            if (unpaid instanceof ManaCostsImpl) {
                ManaCostsImpl<ManaCost> costs = (ManaCostsImpl<ManaCost>) unpaid;
                for (ManaCost cost : costs.getUnpaid()) {
                    if (cost instanceof PhyrexianManaCost) {
                        PhyrexianManaCost ph = (PhyrexianManaCost)cost;
                        if (ph.canPay(null, null, playerId, game)) {
                            ((PhyrexianManaCost)cost).pay(null, game, null, playerId, false);
                        }
                        break;
                    }
                }
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.