X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FVchess.js;h=c12435c52303f24fde60812eb8d91ba864a0856b;hb=7d7e947f74907222f1d98e17a0042fdac08c6769;hp=8b59c863d63b56ab27291279b4edf9dbfcc8a055;hpb=b2b5a72927ce977f96569b78126165b60f23f039;p=vchess.git diff --git a/client/src/variants/Vchess.js b/client/src/variants/Vchess.js index 8b59c863..c12435c5 100644 --- a/client/src/variants/Vchess.js +++ b/client/src/variants/Vchess.js @@ -1,6 +1,7 @@ import { ChessRules } from "@/base_rules"; export class VchessRules extends ChessRules { + static get PawnSpecs() { return Object.assign( {}, @@ -9,6 +10,16 @@ export class VchessRules extends ChessRules { ); } + isAttackedByPawn(sq, color) { + return this.isAttackedBySlideNJump( + sq, + color, + V.PAWN, + V.steps[V.BISHOP], + "oneStep" + ); + } + getNotation(move) { let notation = super.getNotation(move); // If pawn captures backward, add an indication 'b' @@ -23,4 +34,5 @@ export class VchessRules extends ChessRules { } return notation; } + };