Kozilek, the Great Distortion
Legendary Creature — Eldrazi
A void as cryptic as reality itself.
Rulings (4)
To activate the last ability, there must be a legal target: a spell on the stack. That target will determine the value of X and the mana value of the card you discard. You can't activate the ability unless you can match the mana value of a spell on the stack to that of a card in your hand.
The mana value of a spell doesn't change, even if it's been cast using an alternative cost (such as an awaken cost). For example, the mana value of a Sheer Drop (a spell with mana cost 2 generic mana white mana ) that's been cast for its awaken cost of 5 generic mana white mana is 3.
If there's an X generic mana in the mana cost of the card you discard, that X is 0. Any X generic mana in the mana cost of the target spell will have whatever value was determined for it as the spell was cast.
Legality
Formats by platform