use of mage.abilities.keyword.WardAbility in project mage by magefree.
the class DancingSwordEffect method apply.
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent == null) {
discard();
return false;
}
switch(layer) {
case TypeChangingEffects_4:
permanent.removeAllCardTypes();
permanent.addCardType(game, CardType.ARTIFACT);
permanent.addCardType(game, CardType.CREATURE);
permanent.removeAllSubTypes(game);
permanent.addSubType(game, SubType.CONSTRUCT);
return true;
case AbilityAddingRemovingEffects_6:
permanent.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game);
permanent.addAbility(new WardAbility(new GenericManaCost(1)), source.getSourceId(), game);
return true;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getPower().setValue(2);
permanent.getToughness().setValue(1);
return true;
}
}
return false;
}
Aggregations