if (player != null && card != null) {
if (player.chooseUse(Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", game)) {
if (card.getCardType().contains(CardType.LAND)) {
// If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn.
if (game.getActivePlayerId().equals(player.getId()) && player.canPlayLand()) {
player.playLand(card, game);
}
} else {
player.cast(card.getSpellAbility(), game, true);
}
}