Forgive me if this has been asked before, but I wasn't able to find an answer.  Consider the following scenario:
..#
..h
..#
.@#
The game always lets me target the 'h' in this scenario, but sometimes I can't actually hit him.  Meanwhile, 'h' has no problems shooting back at me!  What determines whether I can actually damage a target in this position?