X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FShogi.js;h=9104ed92d70ea59b64b95ac72bbfbcd3f06170ce;hb=ded43c88fad60fd8f9bb46aabd67f3f2092f65f3;hp=6c522dc6f8cddfd7a8def4aa8a4e5d78789f5add;hpb=e50a802531b99829c533f22ecd21e359e7e1e049;p=vchess.git diff --git a/client/src/variants/Shogi.js b/client/src/variants/Shogi.js index 6c522dc6..9104ed92 100644 --- a/client/src/variants/Shogi.js +++ b/client/src/variants/Shogi.js @@ -3,6 +3,7 @@ import { ArrayFun } from "@/utils/array"; import { sample, shuffle } from "@/utils/alea"; export class ShogiRules extends ChessRules { + static get HasFlags() { return false; } @@ -15,6 +16,10 @@ export class ShogiRules extends ChessRules { return true; } + get showFirstTurn() { + return true; + } + static get Notoodark() { return true; } @@ -307,7 +312,7 @@ export class ShogiRules extends ChessRules { case V.LANCE: return this.getPotentialLanceMoves([x, y]); case V.KING: - return this.getPotentialKingMoves([x, y]); + return super.getPotentialKingMoves([x, y]); case V.P_ROOK: return this.getPotentialDragonMoves([x, y]); case V.P_BISHOP: @@ -446,14 +451,6 @@ export class ShogiRules extends ChessRules { ); } - getPotentialKingMoves(sq) { - return this.getSlideNJumpMoves( - sq, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]), - { oneStep: true } - ); - } - isAttacked(sq, color) { return ( this.isAttackedByPawn(sq, color) || @@ -656,4 +653,5 @@ export class ShogiRules extends ChessRules { ) ); } + };