X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSynochess.js;fp=client%2Fsrc%2Fvariants%2FSynochess.js;h=aa758760663234c75492ce34c3f3711f3f05a637;hp=74eecace55ba705f3dcdc7d0a992d4fb14bdc373;hb=a550511adb077ee08686934f67c64b0832d2bb36;hpb=94b9ef2d452192b150578aac791da82849c42c05 diff --git a/client/src/variants/Synochess.js b/client/src/variants/Synochess.js index 74eecace..aa758760 100644 --- a/client/src/variants/Synochess.js +++ b/client/src/variants/Synochess.js @@ -475,7 +475,7 @@ export class SynochessRules extends ChessRules { updateCastleFlags(move, piece) { // Only white can castle: - const firstRank = 0; + const firstRank = 7; if (piece == V.KING && move.appear[0].c == 'w') this.castleFlags['w'] = [8, 8]; else if ( @@ -495,18 +495,19 @@ export class SynochessRules extends ChessRules { } postPlay(move) { - super.postPlay(move); // After black move, turn == 'w': - if (!!this.reserve && this.turn == 'w' && move.vanish.length == 0) + if (!!this.reserve && this.turn == 'w' && move.vanish.length == 0) { if (--this.reserve['b'][V.SOLDIER] == 0) this.reserve = null; + } + else super.postPlay(move); } postUndo(move) { - super.postUndo(move); if (this.turn == 'b' && move.vanish.length == 0) { if (!this.reserve) this.reserve = { 'b': { [V.SOLDIER]: 1 } }; else this.reserve['b'][V.SOLDIER]++; } + else super.postUndo(move); } static get VALUES() { @@ -533,4 +534,9 @@ export class SynochessRules extends ChessRules { return evaluation; } + getNotation(move) { + if (move.vanish.length == 0) return "@" + V.CoordsToSquare(move.end); + return super.getNotation(move); + } + };