Threw together a quick script to determine targets to hit. Hasn't been properly tested yet for reasons.