Package mage.abilities.costs.common

Examples of mage.abilities.costs.common.DiscardCardCost


    @Override
    public int calculate(Game game, Ability sourceAbility, Effect effect) {
        for (Cost cost: sourceAbility.getCosts()) {
            if (cost instanceof DiscardCardCost) {
                DiscardCardCost discardCost = (DiscardCardCost) cost;
                int cmc = 0;
                for (Card card :discardCost.getCards()) {
                    cmc += card.getManaCost().convertedManaCost();
                }
                return cmc;
            }
        }
View Full Code Here


        this.expansionSetCode = "EXO";

        this.color.setBlue(true);

        // Discard a card: You may tap or untap target artifact, creature, or land.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MayTapOrUntapTargetEffect(), new DiscardCardCost());
        ability.addTarget(new TargetPermanent(filter));
        this.addAbility(ability);
    }
View Full Code Here

        this.color.setRed(true);

        // Buyback—Pay 3 life, Discard a card at random. (You may pay 3 life and discard a card at random in addition to any other costs as you cast this spell. If you do, put this card into your hand as it resolves.)
        BuybackAbility buybackAbility = new BuybackAbility(new PayLifeCost(3));
        buybackAbility.addCost(new DiscardCardCost(true));
        this.addAbility(buybackAbility);

        // Destroy target land.
        this.getSpellAbility().addEffect(new DestroyTargetEffect());
        this.getSpellAbility().addTarget(new TargetLandPermanent());
View Full Code Here

        this.color.setWhite(true);

        // {W}, Discard a card: You gain 3 life.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(3), new ManaCostsImpl("{W}"));
        ability.addCost(new DiscardCardCost());
        this.addAbility(ability);
    }
View Full Code Here

        this.toughness = new MageInt(1);

        // When Earsplitting Rats enters the battlefield, each player discards a card.
        this.addAbility(new EntersBattlefieldTriggeredAbility(new DiscardEachPlayerEffect()));
        // Discard a card: Regenerate Earsplitting Rats.
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new DiscardCardCost()));
    }
View Full Code Here

class GigapedeTriggerdAbility extends BeginningOfUpkeepTriggeredAbility{
   
    public GigapedeTriggerdAbility(){
        super(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), TargetController.YOU, true);
        this.addCost(new DiscardCardCost());
    }
View Full Code Here

        this.addAbility(ability);

        // Enchanted creature has "{R}, {T}, Discard a card: Draw a card."
        Ability drawAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{R}"));
        drawAbility.addCost(new TapSourceCost());
        drawAbility.addCost(new DiscardCardCost());
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(drawAbility, AttachmentType.AURA)));
    }
View Full Code Here

        this.toughness = new MageInt(3);

        // Discard a card at random: Dwarven Strike Force gains first strike and haste until end of turn.
        Effect effect = new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn);
        effect.setText("{this} gains first strike");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new DiscardCardCost(true));
        effect = new GainAbilitySourceEffect(HasteAbility.getInstance(),Duration.EndOfTurn);
        effect.setText("and haste until end of turn");
        ability.addEffect(effect);
        this.addAbility(ability);
    }
View Full Code Here

        this.color.setBlue(true);
        this.power = new MageInt(1);
        this.toughness = new MageInt(3);

        // Discard a card: Switch Aquamoeba's power and toughness until end of turn.
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), new DiscardCardCost()));
    }
View Full Code Here

        this.color.setBlack(true);
        this.power = new MageInt(1);
        this.toughness = new MageInt(1);

        // Discard a card: Putrid Imp gains flying until end of turn.
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new DiscardCardCost()));
        // Threshold - As long as seven or more cards are in your graveyard, Putrid Imp gets +1/+1 and can't block.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), "Threshold - As long as seven or more cards are in your graveyard, Putrid Imp gets +1/+1 and can't block")));
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CantBlockSourceEffect(Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), "")));
       
    }
View Full Code Here

TOP

Related Classes of mage.abilities.costs.common.DiscardCardCost

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.