projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some improvements. Testing variants: Baroque has some issues
[xogo.git]
/
variants
/
Allmate
/
class.js
diff --git
a/variants/Allmate/class.js
b/variants/Allmate/class.js
index
e46f384
..
e491e6d
100644
(file)
--- a/
variants/Allmate/class.js
+++ b/
variants/Allmate/class.js
@@
-35,7
+35,7
@@
export default class AllmateRules extends ChessRules {
if (move.appear.length > 0)
this.curMove = move;
const color = this.turn;
if (move.appear.length > 0)
this.curMove = move;
const color = this.turn;
- const oppCol = C.GetOpp
Col
(this.turn);
+ const oppCol = C.GetOpp
Turn
(this.turn);
let mv = new Move({
start: this.curMove.end,
end: this.curMove.end,
let mv = new Move({
start: this.curMove.end,
end: this.curMove.end,
@@
-58,8
+58,8
@@
export default class AllmateRules extends ChessRules {
// is piece on square x,y mated by color?
isMated(x, y, color) {
// is piece on square x,y mated by color?
isMated(x, y, color) {
- const myColor = C.GetOpp
Col
(color);
- if (!
this.underChe
ck([x, y], color))
+ const myColor = C.GetOpp
Turn
(color);
+ if (!
super.underAtta
ck([x, y], color))
return false;
for (let i=0; i<this.size.x; i++) {
for (let j=0; j<this.size.y; j++) {
return false;
for (let i=0; i<this.size.x; i++) {
for (let j=0; j<this.size.y; j++) {
@@
-71,7
+71,7
@@
export default class AllmateRules extends ChessRules {
if (i == x && j == y) {
// The mated-candidate has moved itself
testSquare = [move.end.x, move.end.y]; }
if (i == x && j == y) {
// The mated-candidate has moved itself
testSquare = [move.end.x, move.end.y]; }
- const res = this.under
Che
ck(testSquare, color);
+ const res = this.under
Atta
ck(testSquare, color);
this.undoOnBoard(move);
if (!res)
return false;
this.undoOnBoard(move);
if (!res)
return false;
@@
-82,9
+82,8
@@
export default class AllmateRules extends ChessRules {
return true;
}
return true;
}
- // No "under check" conditions in castling
- getCastleMoves(sq) {
- return super.getCastleMoves(sq, null, "castleInCheck");
+ underCheck() {
+ return false; //not relevant here
}
filterValid(moves) {
}
filterValid(moves) {