More robust endgame condition

This endgame condition works even with AIs that stop buying cards.  This can happen when the AI faces a situation that the author didn't foresee, or when it's based on Monument and doesn't need to buy cards to score points.