Search in sources :

Example 1 with CrewAbility

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

the class SwiftReconfigurationEffect method apply.

@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
    Permanent aura = source.getSourcePermanentIfItStillExists(game);
    if (aura == null) {
        return false;
    }
    Permanent permanent = game.getPermanent(aura.getAttachedTo());
    if (permanent == null) {
        return false;
    }
    switch(layer) {
        case TypeChangingEffects_4:
            permanent.removeAllCardTypes(game);
            permanent.addCardType(game, CardType.ARTIFACT);
            permanent.addSubType(game, SubType.VEHICLE);
            return true;
        case AbilityAddingRemovingEffects_6:
            permanent.addAbility(new CrewAbility(5));
            return true;
    }
    return false;
}
Also used : FilterPermanent(mage.filter.FilterPermanent) Permanent(mage.game.permanent.Permanent) TargetPermanent(mage.target.TargetPermanent) CrewAbility(mage.abilities.keyword.CrewAbility)

Aggregations

CrewAbility (mage.abilities.keyword.CrewAbility)1 FilterPermanent (mage.filter.FilterPermanent)1 Permanent (mage.game.permanent.Permanent)1 TargetPermanent (mage.target.TargetPermanent)1