'Check if Mario is still temporarily invincible after getting hurt'

def check_if_hurt_invincible(self):

    if (self.hurt_invincible and (self.state != c.BIG_TO_SMALL)):
        if (self.hurt_invisible_timer2 == 0):
            self.hurt_invisible_timer2 = self.current_time
        elif ((self.current_time - self.hurt_invisible_timer2) < 2000):
            self.hurt_invincible_check()
        else:
            self.hurt_invincible = False
            self.hurt_invisible_timer = 0
            self.hurt_invisible_timer2 = 0
            for frames in self.all_images:
                for image in frames:
                    image.set_alpha(255)
