I have written this function for a game I am making, however I feel like I have overcomplicated thinks by using multiple nested if statements. Does anyone know a more concis