Search in sources :

Example 1 with BecomesBasicLandTargetEffect

use of mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect in project mage by magefree.

the class DeepwoodElderEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    for (Target target : source.getTargets()) {
        for (UUID targetId : target.getTargets()) {
            Permanent permanent = game.getPermanent(targetId);
            if (permanent != null) {
                ContinuousEffect effect = new BecomesBasicLandTargetEffect(Duration.EndOfTurn, SubType.FOREST);
                effect.setTargetPointer(new FixedTarget(permanent, game));
                game.addEffect(effect, source);
            }
        }
    }
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Target(mage.target.Target) FixedTarget(mage.target.targetpointer.FixedTarget) BecomesBasicLandTargetEffect(mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect) Permanent(mage.game.permanent.Permanent) TargetPermanent(mage.target.TargetPermanent) ContinuousEffect(mage.abilities.effects.ContinuousEffect) UUID(java.util.UUID)

Aggregations

UUID (java.util.UUID)1 ContinuousEffect (mage.abilities.effects.ContinuousEffect)1 BecomesBasicLandTargetEffect (mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect)1 Permanent (mage.game.permanent.Permanent)1 Target (mage.target.Target)1 TargetPermanent (mage.target.TargetPermanent)1 FixedTarget (mage.target.targetpointer.FixedTarget)1