if (card != null) {
if (card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId())) {
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
permanent.addCounters(CounterType.LUCK.createInstance(), game);
Cost cost = new ExileFromHandCost(new TargetCardInHand());
if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) {
cost.pay(source, game, source.getSourceId(), source.getControllerId(), true);
}
}
}
}
}