projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Monochrome: show first turn indication
[vchess.git]
/
client
/
src
/
variants
/
Allmate2.js
diff --git
a/client/src/variants/Allmate2.js
b/client/src/variants/Allmate2.js
index
9ba91ef
..
9b60a5f
100644
(file)
--- a/
client/src/variants/Allmate2.js
+++ b/
client/src/variants/Allmate2.js
@@
-63,14
+63,14
@@
export class Allmate2Rules extends ChessRules {
case V.KING:
// Do not allow castling to escape from check
oppMoves = super.getSlideNJumpMoves(
case V.KING:
// Do not allow castling to escape from check
oppMoves = super.getSlideNJumpMoves(
-
sq
,
+
[x, y]
,
V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
"oneStep"
);
break;
}
for (let om of oppMoves) {
V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
"oneStep"
);
break;
}
for (let om of oppMoves) {
- if (om.vanish.length == 2
&& om.appear.length == 1
)
+ if (om.vanish.length == 2)
// Skip captures: forbidden in this mode
continue;
V.PlayOnBoard(this.board, om);
// Skip captures: forbidden in this mode
continue;
V.PlayOnBoard(this.board, om);
@@
-90,6
+90,7
@@
export class Allmate2Rules extends ChessRules {
}
}
}
}
}
}
+ this.undo(m);
// 3) Add mate-captures:
Object.values(attacked).forEach(sq => {
// 3) Add mate-captures:
Object.values(attacked).forEach(sq => {
@@
-100,8
+101,6
@@
export class Allmate2Rules extends ChessRules {
p: this.getPiece(sq[0], sq[1])
}));
});
p: this.getPiece(sq[0], sq[1])
}));
});
-
- this.undo(m);
});
return moves;
});
return moves;