X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSittuyin.js;h=a18c2f0b3a06972750a97087258bd3b4568a2e1d;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hp=aae1890ea9a6cd007da3e05c2069c8314ad507e0;hpb=cd49e617866590dbc68530ad961b109cdbe1ce55;p=vchess.git diff --git a/client/src/variants/Sittuyin.js b/client/src/variants/Sittuyin.js index aae1890e..a18c2f0b 100644 --- a/client/src/variants/Sittuyin.js +++ b/client/src/variants/Sittuyin.js @@ -2,6 +2,11 @@ import { ChessRules, Move, PiPo } from "@/base_rules"; import { randInt } from "@/utils/alea"; export class SittuyinRules extends ChessRules { + + static get Options() { + return null; + } + static get HasFlags() { return false; } @@ -10,12 +15,26 @@ export class SittuyinRules extends ChessRules { return false; } + static get Monochrome() { + return true; + } + + static get Notoodark() { + return true; + } + + static get Lines() { + return ChessRules.Lines.concat([ + [[0, 0], [8, 8]], + [[0, 8], [8, 0]] + ]); + } + static get PawnSpecs() { return Object.assign( {}, ChessRules.PawnSpecs, { - twoSquares: false, // Promotions are handled differently here promotions: [V.QUEEN] } @@ -245,18 +264,11 @@ export class SittuyinRules extends ChessRules { getPotentialBishopMoves(sq) { const forward = (this.turn == 'w' ? -1 : 1); return this.getSlideNJumpMoves( - sq, - V.steps[V.BISHOP].concat([ [forward, 0] ]), - "oneStep" - ); + sq, V.steps[V.BISHOP].concat([ [forward, 0] ]), 1); } getPotentialQueenMoves(sq) { - return this.getSlideNJumpMoves( - sq, - V.steps[V.BISHOP], - "oneStep" - ); + return this.getSlideNJumpMoves(sq, V.steps[V.BISHOP], 1); } getAllValidMoves() { @@ -274,22 +286,12 @@ export class SittuyinRules extends ChessRules { isAttackedByBishop(sq, color) { const forward = (this.turn == 'w' ? 1 : -1); return this.isAttackedBySlideNJump( - sq, - color, - V.BISHOP, - V.steps[V.BISHOP].concat([ [forward, 0] ]), - "oneStep" - ); + sq, color, V.BISHOP, V.steps[V.BISHOP].concat([ [forward, 0] ]), 1); } isAttackedByQueen(sq, color) { return this.isAttackedBySlideNJump( - sq, - color, - V.QUEEN, - V.steps[V.BISHOP], - "oneStep" - ); + sq, color, V.QUEEN, V.steps[V.BISHOP], 1); } underCheck(color) { @@ -388,4 +390,5 @@ export class SittuyinRules extends ChessRules { } return super.getNotation(move); } + };