Examples of payOrRollback()


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

                for(int i = 0 ; i < ageCounter; i++){
                    totalCost.add(cumulativeCost.copy());
                }
                if (player.chooseUse(Outcome.Benefit, "Pay " + totalCost.getText() + "?", game)) {
                    totalCost.clearPaid();
                    if (totalCost.payOrRollback(source, game, source.getSourceId(), source.getControllerId())){
                        return true;
                    }
                }
                permanent.sacrifice(source.getSourceId(), game);
                return true;   
View Full Code Here

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

        if ( player != null ) {
            ManaCostsImpl attackTax = new ManaCostsImpl("{2}");
            if ( attackTax.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
                 player.chooseUse(Outcome.Neutral, "Pay {2} to attack player?", game) )
            {
                if (attackTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId()) ) {
                    return false;
                }
            }
            return true;
        }
View Full Code Here

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

                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;
                }
            }
            return true;
        }
View Full Code Here

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

            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;
                    }
                }
            }
            return true;
View Full Code Here

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

            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;
                    }
                }
            }
            return true;
View Full Code Here

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

            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;
                    }
                }
                return true;
            }
View Full Code Here

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

                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;
                    }
                }
            }
            return true;
View Full Code Here

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

            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;
                    }
                }
                return true;
            }
View Full Code Here

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

    @Override
    public boolean apply(Game game, Ability source) {
        ManaCostsImpl cost = new ManaCostsImpl("{X}");
        cost.clearPaid();
        if (cost.payOrRollback(source, game, source.getSourceId(), source.getControllerId())) {
            Player player = game.getPlayer(source.getControllerId());
            player.gainLife(cost.getX(), game);
            return true;
        } else {
            return false;
View Full Code Here

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

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