@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
FilterCard protectionFilter = new FilterCard();
ChoiceColorOrArtifact choice = new ChoiceColorOrArtifact();
if (controller.choose(outcome, choice, game)) {
if (choice.isArtifactSelected()) {
protectionFilter.add(new CardTypePredicate(CardType.ARTIFACT));
} else {
protectionFilter.add(new ColorPredicate(choice.getColor()));
}
protectionFilter.setMessage(choice.getChoice());
((ProtectionAbility) ability).setFilter(protectionFilter);
Permanent creature = game.getPermanent(source.getFirstTarget());
if (creature != null) {
creature.addAbility(ability, source.getSourceId(), game);
return true;