attack function so ai starts attacking if there's no move to block. still need to look for bugs