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
/
Balaklava
/
class.js
diff --git
a/variants/Balaklava/class.js
b/variants/Balaklava/class.js
index
ad189cb
..
1ee2dd7
100644
(file)
--- a/
variants/Balaklava/class.js
+++ b/
variants/Balaklava/class.js
@@
-13,7
+13,7
@@
export default class BalaklavaRules extends ChessRules {
pieces(color, x, y) {
let res = super.pieces(color, x, y);
pieces(color, x, y) {
let res = super.pieces(color, x, y);
- const knightSpec
= res['n']
;
+ const knightSpec
Moves = res['n'].both
;
delete res['n'];
res['m'] = {
"class": "mammoth",
delete res['n'];
res['m'] = {
"class": "mammoth",
@@
-28,17
+28,26
@@
export default class BalaklavaRules extends ChessRules {
}
]
};
}
]
};
- ['p', 'r', 'b', 'm', 'q'].forEach(p => res[p].moves = knightSpec.moves);
+ ['p', 'r', 'b', 'm', 'q'].forEach(p => {
+ if (!res[p].moves)
+ res[p].moves = [];
+ Array.prototype.push.apply(res[p].moves, knightSpecMoves);
+ });
return res;
}
genRandInitBaseFen() {
const s = FenUtil.setupPieces(
return res;
}
genRandInitBaseFen() {
const s = FenUtil.setupPieces(
- ['r', 'm', 'b', 'q', 'k', 'b', 'm', 'r'], {diffCol: ['b']});
+ ['r', 'm', 'b', 'q', 'k', 'b', 'm', 'r'],
+ {
+ randomness: this.options["randomness"],
+ diffCol: ['b']
+ }
+ );
return {
fen: s.b.join("") + "/pppppppp/8/8/8/8/PPPPPPPP/" +
s.w.join("").toUpperCase(),
return {
fen: s.b.join("") + "/pppppppp/8/8/8/8/PPPPPPPP/" +
s.w.join("").toUpperCase(),
- o: {}
+ o: {
flags: s.flags
}
};
}
};
}