Search in sources :

Example 1 with ElementalMasteryElementalToken

use of mage.game.permanent.token.ElementalMasteryElementalToken in project mage by magefree.

the class ElementalMasteryEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent creatureAttached = game.getPermanent(source.getSourceId());
    if (creatureAttached != null) {
        int power = creatureAttached.getPower().getValue();
        if (power > 0) {
            CreateTokenEffect effect = new CreateTokenEffect(new ElementalMasteryElementalToken(), power);
            effect.apply(game, source);
            effect.exileTokensCreatedAtNextEndStep(game, source);
            return true;
        }
    }
    return false;
}
Also used : Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) TargetPermanent(mage.target.TargetPermanent) ElementalMasteryElementalToken(mage.game.permanent.token.ElementalMasteryElementalToken) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect)

Aggregations

CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 Permanent (mage.game.permanent.Permanent)1 ElementalMasteryElementalToken (mage.game.permanent.token.ElementalMasteryElementalToken)1 TargetPermanent (mage.target.TargetPermanent)1 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)1