Perhaps use something like https://chessprogramming.wikispaces.com/Blockers+and+Beyond for sliding piece attacks