Search in sources :

Example 1 with CumulativeUpkeepAbility

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

the class DreamsOfTheDeadReplacementEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null && card != null) {
        if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
            Permanent creature = game.getPermanent(card.getId());
            if (creature != null) {
                ContinuousEffect effect = new GainAbilityTargetEffect(new CumulativeUpkeepAbility(new ManaCostsImpl("{2}")), Duration.Custom);
                effect.setTargetPointer(new FixedTarget(creature, game));
                game.addEffect(effect, source);
            }
        }
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) CumulativeUpkeepAbility(mage.abilities.keyword.CumulativeUpkeepAbility) GainAbilityTargetEffect(mage.abilities.effects.common.continuous.GainAbilityTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl) FilterCreatureCard(mage.filter.common.FilterCreatureCard) Card(mage.cards.Card)

Aggregations

ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)1 ContinuousEffect (mage.abilities.effects.ContinuousEffect)1 GainAbilityTargetEffect (mage.abilities.effects.common.continuous.GainAbilityTargetEffect)1 CumulativeUpkeepAbility (mage.abilities.keyword.CumulativeUpkeepAbility)1 Card (mage.cards.Card)1 FilterCreatureCard (mage.filter.common.FilterCreatureCard)1 Permanent (mage.game.permanent.Permanent)1 Player (mage.players.Player)1 FixedTarget (mage.target.targetpointer.FixedTarget)1