This might be difficult to code seeing as each card might have different options and some can work randomly, and even discarding would need to be checked for a win condition.
Consider
Chaos dwarf. This one could multiply production and give a resource victory, or it might not. Would the system call this a check?
Additionally, Swift and Quick would render this useless. It's possible that your opponent could draw a card and win on the next turn without you ever being warned.