Sonic battle - style AI for enemies + randomly block player?

Hi, I'm making a new game and I want to have Sonic Battle - style fights. If someone knows
how to go about this I'd be extrememly happy.
Also, is there a way to make the enemy
randomly block the players moves to prevent damage? Thanks in advance.
how to go about this I'd be extrememly happy.

randomly block the players moves to prevent damage? Thanks in advance.