Thanks!
The pattern initially was random, but it gave too little control over the gameplay. Also characters got cornered sometimes without any way to escape, thus producing a 100% lose scenario in the case when that character was player. So i’ve decided to keep the pattern in a simple and more predictable manner.