Package mage.abilities.costs

Examples of mage.abilities.costs.VariableCost


        // {X}, {tap}: Crimson Hellkite deals X damage to target creature. Spend only red mana this way.
        Effect effect = new DamageTargetEffect(new ManacostVariableValue());
        effect.setText("{this} deals X damage to target creature. Spend only red mana this way");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
        ability.addCost(new TapSourceCost());
        VariableCost variableCost = ability.getManaCostsToPay().getVariableCosts().get(0);
        if (variableCost instanceof VariableManaCost) {
            ((VariableManaCost) variableCost).setFilter(filterRedMana);
        }
        ability.addTarget(new TargetCreaturePermanent());
        this.addAbility(ability);
View Full Code Here


        // Spend only black mana on X.
        // Drain Life deals X damage to target creature or player. You gain life equal to the damage dealt, but not more life than the player's life total before Drain Life dealt damage or the creature's toughness.
        this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
        this.getSpellAbility().addEffect(new DrainLifeEffect());
        VariableCost variableCost = this.getSpellAbility().getManaCostsToPay().getVariableCosts().get(0);
        if (variableCost instanceof VariableManaCost) {
            ((VariableManaCost) variableCost).setFilter(filterBlack);
        }
    }
View Full Code Here

        // {X}: Crypt Rats deals X damage to each creature and each player. Spend only black mana this way.
        Effect effect = new DamageEverythingEffect(new ManacostVariableValue(), new FilterPermanent());
        effect.setText("{this} deals X damage to each creature and each player. Spend only black mana this way");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect,new ManaCostsImpl("{X}"));
        VariableCost variableCost = ability.getManaCostsToPay().getVariableCosts().get(0);
        if (variableCost instanceof VariableManaCost) {
            ((VariableManaCost) variableCost).setFilter(filterBlack);
        }
        this.addAbility(ability);
    }
View Full Code Here

   
    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            VariableCost cost = new PayVariableLifeCost();
            int xValue = cost.announceXValue(source, game);
            cost.getFixedCostsFromAnnouncedValue(xValue).pay(source, game, source.getSourceId(), source.getControllerId(), true);
           
            Cards cards = new CardsImpl(Zone.PICK);
            int count = Math.min(player.getLibrary().size(), xValue);
            for (int i = 0; i < count; i++) {
                Card card = player.getLibrary().removeFromTop(game);
View Full Code Here

        // Spend only black mana on X.
        // Consume Spirit deals X damage to target creature or player and you gain X life.
        this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
        this.getSpellAbility().addEffect(new ConsumeSpiritEffect());
        VariableCost variableCost = this.getSpellAbility().getManaCostsToPay().getVariableCosts().get(0);
        if (variableCost instanceof VariableManaCost) {
            ((VariableManaCost) variableCost).setFilter(filterBlack);
        }
    }
View Full Code Here

TOP

Related Classes of mage.abilities.costs.VariableCost

Copyright © 2018 www.massapicom. 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.