Player player = game.getPlayer(source.getControllerId());
if (player != null) {
for (UUID cardId: player.getGraveyard()) {
if (objects.contains(cardId)) {
Card card = game.getCard(cardId);
FlashbackAbility ability = null;
if (card.getCardType().contains(CardType.INSTANT)) {
ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT);
}
else if (card.getCardType().contains(CardType.SORCERY)) {
ability = new FlashbackAbility(card.getManaCost(), TimingRule.SORCERY);
}
if (ability != null) {
ability.setSourceId(cardId);
ability.setControllerId(card.getOwnerId());
game.getState().addOtherAbility(cardId, ability);
}
}
}
return true;