Permanent triggeringCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (triggeringCreature == null) {
triggeringCreature = (Permanent) game.getLastKnownInformation(getTargetPointer().getFirst(game, source), Zone.BATTLEFIELD);
}
if (triggeringCreature != null) {
FilterPermanent filter = new FilterPermanent("another permanent you control that shares a card type with " + triggeringCreature.getName());
filter.add(Predicates.not(new PermanentIdPredicate(triggeringCreature.getId())));
filter.add(new ControllerPredicate(TargetController.YOU));
Set<CardTypePredicate> cardTypes = new HashSet<CardTypePredicate>();
for (CardType cardType :triggeringCreature.getCardType()) {
cardTypes.add(new CardTypePredicate(cardType));
}
filter.add(Predicates.or(cardTypes));
TargetPermanent target = new TargetPermanent(1,1,filter, true);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (target.canChoose(controller.getId(), game) && controller.chooseTarget(outcome, target, source, game)) {
Permanent returningCreature = game.getPermanent(target.getFirstTarget());