- return [ new Move({
- appear: [],
- vanish: [new PiPo({x:x,y:y,p:piece,c:color})],
- start: {x:x,y:y},
- end: {x:i,y:j}
- }) ];
+ // Moving is impossible only if this immobilizer is not neutralized
+ for (let step2 of adjacentSteps)
+ {
+ const [i2,j2] = [i+step2[0],j+step2[1]];
+ if (i2>=0 && i2<sizeX && j2>=0 && j2<sizeY
+ && this.board[i2][j2] != V.EMPTY && this.getColor(i2,j2) == color)
+ {
+ const friendlyPiece = this.getPiece(i2,j2);
+ if ([V.BISHOP,V.IMMOBILIZER].includes(friendlyPiece))
+ break outerLoop;
+ }
+ }
+ return []; //immobilizer isn't neutralized