Line of Sight builder for a targeting system
Show polygons ?
Obstacle
Non visible
Intersects with a polygon but non targetable by the player.
Intersects with a polygon but targetable by the player.

A cell is considered fully visible (targetable) when we can form a line from the player to a cell's center without bumping into an obstacle.

You can use directional arrows to move the player.

Algorithm
1- Make a polygon for each obstacle, based on the corners.
2- Detect and store all cells that intersects with the polygons' lines. Those may or may not be visible.
3- Detect all cells fully inside the polygons. Those are absolutely non visible.
4- For each cells gathered from step 2, check if the user can reach their center without bumping into an obstacle. If so, the cell is targetable.