- super.playOnBoard(m);
- let attacks = this.findAttacks([m.end.x, m.end.y])
- if (this.options["zen"]) {
- let endSquares = {};
- super.findCapturesOn([m.end.x, m.end.y], true).forEach(c => {
- endSquares[C.CoordsToSquare(c.end)] = true;
+ m.flips = [];
+ if (!this.options["cleopatra"] || m.vanish[0].p == 'q') {
+ super.playOnBoard(m);
+ let attacks = this.findAttacks([m.end.x, m.end.y])
+ if (this.options["zen"]) {
+ let endSquares = {};
+ super.findCapturesOn([m.end.x, m.end.y], {zen: true}).forEach(c => {
+ endSquares[C.CoordsToSquare(c.end)] = true;
+ });
+ Array.prototype.push.apply(attacks, Object.keys(endSquares));
+ }
+ super.undoOnBoard(m);
+ attacks.map(C.SquareToCoords).forEach(a => {
+ m.flips.push({x: a.x, y: a.y});