Added function for generating legal targets for effects