Search in sources :

Example 1 with ValdukElementalToken

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

the class ValdukKeeperOfTheFlameEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent sourcePermanent = game.getPermanent(source.getSourceId());
    if (sourcePermanent != null) {
        EquipmentAttachedCount eamount = new EquipmentAttachedCount();
        int value = eamount.calculate(game, source, this);
        AuraAttachedCount aamount = new AuraAttachedCount();
        value += aamount.calculate(game, source, this);
        CreateTokenEffect effect = new CreateTokenEffect(new ValdukElementalToken(), value);
        if (effect.apply(game, source)) {
            effect.exileTokensCreatedAtNextEndStep(game, source);
            return true;
        }
    }
    return false;
}
Also used : Permanent(mage.game.permanent.Permanent) EquipmentAttachedCount(mage.abilities.dynamicvalue.common.EquipmentAttachedCount) ValdukElementalToken(mage.game.permanent.token.ValdukElementalToken) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) AuraAttachedCount(mage.abilities.dynamicvalue.common.AuraAttachedCount)

Aggregations

AuraAttachedCount (mage.abilities.dynamicvalue.common.AuraAttachedCount)1 EquipmentAttachedCount (mage.abilities.dynamicvalue.common.EquipmentAttachedCount)1 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 Permanent (mage.game.permanent.Permanent)1 ValdukElementalToken (mage.game.permanent.token.ValdukElementalToken)1