X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSittuyin.js;h=a18c2f0b3a06972750a97087258bd3b4568a2e1d;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hp=c93c3f07d30f6e42f4d41554e0a54dad07422168;hpb=1c15969ecec2a86ee7dffe570e53dfd61fd06b22;p=vchess.git diff --git a/client/src/variants/Sittuyin.js b/client/src/variants/Sittuyin.js index c93c3f07..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,6 +15,21 @@ 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( {}, @@ -244,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() { @@ -273,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) { @@ -387,4 +390,5 @@ export class SittuyinRules extends ChessRules { } return super.getNotation(move); } + };