projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sq --> [x, y]
[vchess.git]
/
client
/
src
/
variants
/
Allmate1.js
diff --git
a/client/src/variants/Allmate1.js
b/client/src/variants/Allmate1.js
index
3d84300
..
f3c0b2e
100644
(file)
--- a/
client/src/variants/Allmate1.js
+++ b/
client/src/variants/Allmate1.js
@@
-60,7
+60,12
@@
export class Allmate1Rules extends ChessRules {
oppMoves = this.getPotentialQueenMoves([i, j]);
break;
case V.KING:
oppMoves = this.getPotentialQueenMoves([i, j]);
break;
case V.KING:
- oppMoves = this.getPotentialKingMoves([i, j]);
+ // Do not allow castling to escape from check
+ oppMoves = super.getSlideNJumpMoves(
+ [x, y],
+ V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
+ "oneStep"
+ );
break;
}
for (let om of oppMoves) {
break;
}
for (let om of oppMoves) {
@@
-203,8
+208,7
@@
export class Allmate1Rules extends ChessRules {
if (kp[0] < 0)
// King disappeared
return color == "w" ? "0-1" : "1-0";
if (kp[0] < 0)
// King disappeared
return color == "w" ? "0-1" : "1-0";
- if (this.atLeastOneMove())
- return "*";
+ if (this.atLeastOneMove()) return "*";
// Kings still there, no moves:
return "1/2";
}
// Kings still there, no moves:
return "1/2";
}