projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some complete rules
[xogo.git]
/
variants
/
_Antiking
/
class.js
diff --git
a/variants/_Antiking/class.js
b/variants/_Antiking/class.js
index
771726c
..
2797cad
100644
(file)
--- a/
variants/_Antiking/class.js
+++ b/
variants/_Antiking/class.js
@@
-37,8
+37,8
@@
export default class AbstractAntikingRules extends ChessRules {
return ['k', 'a'].includes(p);
}
return ['k', 'a'].includes(p);
}
- // NOTE: canTake includes (wrong) captures of
anti
king,
- // to detect attacks on
anti
kings.
+ // NOTE: canTake includes (wrong) captures of
(anti)
king,
+ // to detect attacks on
(anti)
kings.
canTake([x1, y1], [x2, y2]) {
const piece1 = this.getPiece(x1, y1);
const color1 = this.getColor(x1, y1);
canTake([x1, y1], [x2, y2]) {
const piece1 = this.getPiece(x1, y1);
const color1 = this.getColor(x1, y1);
@@
-49,10
+49,10
@@
export default class AbstractAntikingRules extends ChessRules {
);
}
);
}
- // Remove captures of
anti
king (see above)
+ // Remove captures of
(anti)
king (see above)
getPotentialMovesFrom([x, y]) {
return super.getPotentialMovesFrom([x, y]).filter(m =>
getPotentialMovesFrom([x, y]) {
return super.getPotentialMovesFrom([x, y]).filter(m =>
- m.vanish.length == 1 ||
m.vanish[1].p != 'a'
);
+ m.vanish.length == 1 ||
!['k', 'a'].includes(m.vanish[1].p)
);
}
underCheck(square_s, color) {
}
underCheck(square_s, color) {
@@
-60,10
+60,10
@@
export default class AbstractAntikingRules extends ChessRules {
square_s.forEach(sq => {
switch (this.getPiece(sq[0], sq[1])) {
case 'k':
square_s.forEach(sq => {
switch (this.getPiece(sq[0], sq[1])) {
case 'k':
- res ||= super.underAttack(sq,
color
);
+ res ||= super.underAttack(sq,
[color]
);
break;
case 'a':
break;
case 'a':
- res ||= !super.underAttack(sq,
color
);
+ res ||= !super.underAttack(sq,
[color]
);
break;
}
});
break;
}
});