X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FMaxima.js;h=df781b9e09cb914475efb86db3970096a1beaa21;hp=05df0bd990cbe1c247e39181343c9510713e4cd1;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hpb=cee75a57d2f4f89c89d64cefbab55d839a238ed9 diff --git a/client/src/variants/Maxima.js b/client/src/variants/Maxima.js index 05df0bd9..df781b9e 100644 --- a/client/src/variants/Maxima.js +++ b/client/src/variants/Maxima.js @@ -4,6 +4,10 @@ import { shuffle } from "@/utils/alea"; export class MaximaRules extends ChessRules { + static get Options() { + return null; + } + static get HasFlags() { return false; } @@ -192,7 +196,7 @@ export class MaximaRules extends ChessRules { if (piece == V.KING) j = j % V.size.y; while (V.OnBoard(i, j) && this.board[i][j] == V.EMPTY) { moves.push(this.getBasicMove(initSquare, [i, j])); - if (!!oneStep) continue outerLoop; + if (oneStep) continue outerLoop; i += step[0]; j += step[1]; } @@ -450,14 +454,8 @@ export class MaximaRules extends ChessRules { } getPotentialGuardMoves(sq) { - return ( - this.getSlideNJumpMoves( - sq, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]), - "oneStep", - null - ) - ); + return this.getSlideNJumpMoves( + sq, V.steps[V.ROOK].concat(V.steps[V.BISHOP]), "oneStep"); } getNextMageSteps(step) { @@ -679,15 +677,8 @@ export class MaximaRules extends ChessRules { } isAttackedByGuard(sq, color) { - return ( - super.isAttackedBySlideNJump( - sq, - color, - V.GUARD, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]), - "oneStep" - ) - ); + return super.isAttackedBySlideNJump( + sq, color, V.GUARD, V.steps[V.ROOK].concat(V.steps[V.BISHOP]), 1); } getNextMageCheck(step) {