Let's play ASCII mini-golf
Python 2, 469
Pretty long, but it's a start:

R=range
def l(c,x,y,z,t):
 f=abs(z-x);g=1-2*(z&lt;x);p=abs(t-y);q=1-2*(t&lt;y);v=r=0
 for i in R(f):
  w=f+(2*i+1)*p
  for j in R(v,(w-1)/2/f+1):r|='.'&gt;c[x+g*i][y+q*j]
  v=w/2/f
 for j in R(v,p+1):r|='.'&gt;c[z][y+q*j]
 return r
def f(c):
 a=&quot;&quot;.join(c);n=len(c[0]);b=len(a);d=[[9**9*l(c,i/n,i%n,j/n,j%n)+1for i in R(b)]for j in R(b)]
 for k in R(b):
  for i in R(b):
   for j in R(b):
    t=d[i][j]=min(d[i][j],d[i][k]+d[k][j])
    if&quot;o@&quot;==a[i]+a[j]:r=t
 return-1if r&gt;9**9else r

Function f takes a list of strings and returns the number of shots.
Test suite:
def test(s,r):
 print&quot;ok&quot;if f(s.split())==r else&quot;fail&quot;

test(&quot;o # @&quot;, -1)
test(&quot;......@.. .....##.. ......... ......o..&quot;, 2)
test(&quot;o....@&quot;, 1)
test(&quot;o.#.@&quot;, -1)
test(&quot;o..# ..#@&quot;, 2)
test(&quot;o#...# .#.#.# ...#.@&quot;, 4)
test(&quot;o### #..# ###@&quot;, 3)
test(&quot;o.## ##.@&quot;, 1)
test(&quot;...o .@#.&quot;, 2)