// Whenever Cephalid Illusionist becomes the target of a spell or ability, put the top three cards of your library into your graveyard.
this.addAbility(new BecomesTargetTriggeredAbility(new PutTopCardOfLibraryIntoGraveControllerEffect(3)));
// {2}{U}, {tap}: Prevent all combat damage that would be dealt to
Effect effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, true);
effect.setText("Prevent all combat damage that would be dealt to");
// and dealt by target creature you control this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{U}"));
effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true);
effect.setText("and dealt by target creature you control this turn.");
ability.addEffect(effect);
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetControlledCreaturePermanent());
this.addAbility(ability);
}