X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FHorde.js;h=6305c412a5b1ebde239b8e8f669a677ed9a49c76;hp=e61803b3d480664419134da6c880779caa5ed7e0;hb=5a187b07e221493931cf089bf85ef6db41d8b775;hpb=f9385686d9434c607cdaa55e41a0425269db0815 diff --git a/client/src/variants/Horde.js b/client/src/variants/Horde.js index e61803b3..6305c412 100644 --- a/client/src/variants/Horde.js +++ b/client/src/variants/Horde.js @@ -39,13 +39,27 @@ export class HordeRules extends ChessRules { if (randomness == 2) randomness--; const fen = ChessRules.GenRandInitFen(randomness); return ( - // 27 first chars are 3 rows + 3 slashes - fen.substr(0, 27) + // 20 first chars are 3 rows + 3 slashes + fen.substr(0, 20) // En passant available, but no castle: .concat("1PP2PP1/PPPPPPPP/PPPPPPPP/PPPPPPPP/PPPPPPPP w 0 -") ); } + filterValid(moves) { + if (this.turn == 'w') return moves; + return super.filterValid(moves); + } + + getCheckSquares(color) { + if (color == 'w') return []; + return ( + this.underCheck('b') + ? [JSON.parse(JSON.stringify(this.kingPos['b']))] + : [] + ); + } + getCurrentScore() { if (this.turn == 'w') { // Do I have any unit remaining? If not, I lost.