made functions for common code between getHit and doBattle
reduced tree depth so things see each other