X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FShako.js;h=2701f1e2a1379d4f47a9b5591c5759c78e89546f;hp=c3db2794bca3492a9fc2c865329ff498afdfbf50;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hpb=cee75a57d2f4f89c89d64cefbab55d839a238ed9 diff --git a/client/src/variants/Shako.js b/client/src/variants/Shako.js index c3db2794..2701f1e2 100644 --- a/client/src/variants/Shako.js +++ b/client/src/variants/Shako.js @@ -68,7 +68,7 @@ export class ShakoRules extends ChessRules { } getPotentialElephantMoves([x, y]) { - return this.getSlideNJumpMoves([x, y], V.steps[V.ELEPHANT], "oneStep"); + return this.getSlideNJumpMoves([x, y], V.steps[V.ELEPHANT], 1); } getPotentialCannonMoves([x, y]) { @@ -115,7 +115,7 @@ export class ShakoRules extends ChessRules { isAttackedByElephant(sq, color) { return ( this.isAttackedBySlideNJump( - sq, color, V.ELEPHANT, V.steps[V.ELEPHANT], "oneStep" + sq, color, V.ELEPHANT, V.steps[V.ELEPHANT], 1 ) ); } @@ -185,8 +185,8 @@ export class ShakoRules extends ChessRules { return 2; } - static GenRandInitFen(randomness) { - if (randomness == 0) { + static GenRandInitFen(options) { + if (options.randomness == 0) { return ( "c8c/ernbqkbnre/pppppppppp/91/91/91/91/PPPPPPPPPP/ERNBQKBNRE/C8C " + "w 0 bibi -" @@ -197,7 +197,7 @@ export class ShakoRules extends ChessRules { let flags = ""; // Shuffle pieces on second (and before-last rank if randomness == 2) for (let c of ["w", "b"]) { - if (c == 'b' && randomness == 1) { + if (c == 'b' && options.randomness == 1) { pieces['b'] = pieces['w']; flags += flags; break;