Have Enemy Track Player By Bouncing RayCast Off Walls

I have a 2D top down shooter puzzle game. The player and enemies fire bullets that bounce endlessly until they hit the player or an NPC. The bullets themselves bounce like light, reflecting at exactly the same angle that they hit. I’ve made an enemy that only fires with a direct line of sight to the player, but I’d like one that can bounce bullets off of walls to hit the player.

My idea is like this:

30789-visualzation.png

The red line proves there is no direct line of sight, and the white line shows the possible path of a bouncing bullet. How could I get the enemy to find that possible trajectory to use?

I imagine the solution involves a heavy dose of trigonometry. I’ve drafted a color coded visualization of all the angles in the problem:

30790-visual2.png

The blue represents the wall and the unknown angles.

I know the x axis of the player, the enemy and any wall the enemy will use. Because I know the angle between the player and the enemy as well as the distance between them, could I use some fancy trig to find the missing (blue) angle?

Solved it: The player and enemy form similar right triangles to the wall. Just use ratios to find the distance.