Search in sources :

Example 1 with RegenerateTargetEffect

use of mage.abilities.effects.common.RegenerateTargetEffect in project mage by magefree.

the class DarkDabblingEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    if (SpellMasteryCondition.instance.apply(game, source)) {
        for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {
            if (!permanent.getId().equals(getTargetPointer().getFirst(game, source))) {
                RegenerateTargetEffect regenEffect = new RegenerateTargetEffect();
                regenEffect.setTargetPointer(new FixedTarget(permanent, game));
                game.addEffect(regenEffect, source);
            }
        }
    }
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) RegenerateTargetEffect(mage.abilities.effects.common.RegenerateTargetEffect)

Example 2 with RegenerateTargetEffect

use of mage.abilities.effects.common.RegenerateTargetEffect in project mage by magefree.

the class FullMoonsRiseEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
        ReplacementEffect effect = new RegenerateTargetEffect();
        effect.setTargetPointer(new FixedTarget(permanent, game));
        game.addEffect(effect, source);
    }
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) FilterPermanent(mage.filter.FilterPermanent) Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) ReplacementEffect(mage.abilities.effects.ReplacementEffect) RegenerateTargetEffect(mage.abilities.effects.common.RegenerateTargetEffect)

Aggregations

RegenerateTargetEffect (mage.abilities.effects.common.RegenerateTargetEffect)2 Permanent (mage.game.permanent.Permanent)2 FixedTarget (mage.target.targetpointer.FixedTarget)2 ReplacementEffect (mage.abilities.effects.ReplacementEffect)1 FilterPermanent (mage.filter.FilterPermanent)1 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)1