New variant idea
[xogo.git] / variants / Doublearmy / class.js
... / ...
CommitLineData
1import ChessRules from "/base_rules.js";
2
3export default class DoublearmyRules extends ChessRules {
4
5 static get Options() {
6 return {
7 select: C.Options.select,
8 input: C.Options.input,
9 styles: C.Options.styles.filter(s => s != "madrasi")
10 };
11 }
12
13 pieces(color, x, y) {
14 let res = super.pieces(color, x, y);
15 return Object.assign(
16 {
17 'c': {
18 "class": "commoner",
19 moveas: 'k'
20 }
21 },
22 res
23 );
24 }
25
26 genRandInitBaseFen() {
27 const s = super.genRandInitBaseFen();
28 const rows = s.fen.split('/');
29 return {
30 fen:
31 rows[0] + "/" +
32 rows[1] + "/" +
33 rows[0].replace('k', 'c') + "/" +
34 rows[1] + "/" +
35 rows[6] + "/" +
36 rows[7].replace('K', 'C') + "/" +
37 rows[6] + "/" +
38 rows[7],
39 o: s.o
40 };
41 }
42
43};