Search in sources :

Example 1 with ScavengeAbility

use of mage.abilities.keyword.ScavengeAbility in project mage by magefree.

the class VarolzTheScarStripedEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        for (UUID cardId : controller.getGraveyard()) {
            Card card = game.getCard(cardId);
            if (card != null && card.isCreature(game)) {
                ScavengeAbility ability = new ScavengeAbility(new ManaCostsImpl(card.getManaCost().getText()));
                ability.setSourceId(cardId);
                ability.setControllerId(card.getOwnerId());
                game.getState().addOtherAbility(card, ability);
            }
        }
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) UUID(java.util.UUID) ScavengeAbility(mage.abilities.keyword.ScavengeAbility) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl) Card(mage.cards.Card)

Aggregations

UUID (java.util.UUID)1 ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)1 ScavengeAbility (mage.abilities.keyword.ScavengeAbility)1 Card (mage.cards.Card)1 Player (mage.players.Player)1