I'm currently trying to write a monthly event that will destroy ruined buildings on AI planets. This is because the AI can't repair buildings, meaning if a building gets ruined for any reason, they lose that building slot permanently. However, I can't find a good way to check if a building is ruined. Does one exist, and if so, how do I do it?