attacking function + testing

can hopefully use this function to rebuild legalMoves() with more
functional logic