projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some variants and improve a few other things a little bit
[vchess.git]
/
client
/
src
/
variants
/
Allmate.js
diff --git
a/client/src/variants/Allmate.js
b/client/src/variants/Allmate.js
index
5636f56
..
728de25
100644
(file)
--- a/
client/src/variants/Allmate.js
+++ b/
client/src/variants/Allmate.js
@@
-5,10
+5,6
@@
export const VariantRules = class AllmateRules extends ChessRules {
return false;
}
return false;
}
- canTake(sq1, sq2) {
- return false; //Captures handled differently
- }
-
getCheckSquares() {
// No notion of check
return [];
getCheckSquares() {
// No notion of check
return [];
@@
-20,6
+16,10
@@
export const VariantRules = class AllmateRules extends ChessRules {
getPotentialMovesFrom([x, y]) {
let moves = super.getPotentialMovesFrom([x, y]);
getPotentialMovesFrom([x, y]) {
let moves = super.getPotentialMovesFrom([x, y]);
+ // Remove standard captures (without removing castling):
+ moves = moves.filter(m => {
+ return m.vanish.length == 1 || m.appear.length == 2;
+ });
// Augment moves with "mate-captures":
// TODO: this is coded in a highly inefficient way...
// Augment moves with "mate-captures":
// TODO: this is coded in a highly inefficient way...