X-Git-Url: https://git.auder.net/pieces/Checkered/cb.svg?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FPandemonium.js;h=bb614ec301030f9cc21f446a5a8248f5bb862977;hb=4cf77a102880d53b242a972b7eaa43e75ba9c338;hp=4ae73033ed0dc950f09bc821f371e44edd7d1ea3;hpb=809ab1a837e0f748987bcf7d66defa11cb7a1792;p=vchess.git diff --git a/client/src/variants/Pandemonium.js b/client/src/variants/Pandemonium.js index 4ae73033..bb614ec3 100644 --- a/client/src/variants/Pandemonium.js +++ b/client/src/variants/Pandemonium.js @@ -7,10 +7,7 @@ export class PandemoniumRules extends ChessRules { return Object.assign( {}, ChessRules.PawnSpecs, - { - threeSquares: true, - promotions: [V.GILDING] - } + { promotions: [V.GILDING] } ); } @@ -329,7 +326,7 @@ export class PandemoniumRules extends ChessRules { return []; } // Normal move (after initial setup) - if (x >= V.size.x) return this.getReserveMoves(x, y); + if (x >= V.size.x) return this.getReserveMoves([x, y]); const p = this.getPiece(x, y); const sq = [x, y]; let moves = []; @@ -373,17 +370,17 @@ export class PandemoniumRules extends ChessRules { getPotentialPawnMoves([x, y]) { const color = this.turn; - const shiftX = V.PawnSpecs.directions[color]; + const shiftX = (color == 'w' ? -1 : 1); let moves = []; if (this.board[x + shiftX][y] == V.EMPTY) { this.addPawnMoves([x, y], [x + shiftX, y], moves); - if ((color == 'w' && x >= V.size.x - 3) || (color == 'b' && x <= 3)) { + if ((color == 'w' && x >= V.size.x - 3) || (color == 'b' && x <= 2)) { if (this.board[x + 2 * shiftX][y] == V.EMPTY) { moves.push(this.getBasicMove([x, y], [x + 2 * shiftX, y])); if ( ( - (color == 'w' && x >= V.size.x - 2) || - (color == 'b' && x <= 2) + (color == 'w' && x == V.size.x - 2) || + (color == 'b' && x == 1) ) && this.board[x + 3 * shiftX][y] == V.EMPTY @@ -609,7 +606,8 @@ export class PandemoniumRules extends ChessRules { s: 'n', h: 'b', w: 'c', - a: 'm' + a: 'm', + g: 'p' }; }