use of mage.abilities.effects.common.ChooseACardNameEffect in project mage by magefree.
the class CheeringFanaticEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
new ChooseACardNameEffect(TypeOfName.ALL).apply(game, source);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (cardName == null) {
return false;
}
FilterCard filter = new FilterCard();
filter.add(new NamePredicate(cardName));
ContinuousEffect effect = new SpellsCostReductionAllEffect(filter, 1);
effect.setDuration(Duration.EndOfTurn);
game.addEffect(effect, source);
return true;
}
Aggregations