Add chance function to the class animal