X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAllmate1.js;h=88599e49c69719655cccda1c2c176f697c6d8f41;hp=0e7e8ed51f7e7bcb8ca529d4a6c6a91592cc3708;hb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;hpb=31c535953c843b28434a7fcdf7b4da0b376774ab diff --git a/client/src/variants/Allmate1.js b/client/src/variants/Allmate1.js index 0e7e8ed5..88599e49 100644 --- a/client/src/variants/Allmate1.js +++ b/client/src/variants/Allmate1.js @@ -1,6 +1,7 @@ import { ChessRules, PiPo, Move } from "@/base_rules"; export class Allmate1Rules extends ChessRules { + static get HasEnpassant() { return false; } @@ -125,7 +126,7 @@ export class Allmate1Rules extends ChessRules { // No "under check" conditions in castling getCastleMoves(sq) { - return super.getCastleMoves(sq, "castleInCheck"); + return super.getCastleMoves(sq, null, "castleInCheck"); } // TODO: allow pieces to "commit suicide"? (Currently yes except king) @@ -201,10 +202,10 @@ export class Allmate1Rules extends ChessRules { this.kingPos[this.turn] = [-1, -1]; // Or maybe a rook? else if (v.p == V.ROOK) { - if (v.y < this.INIT_COL_KING[v.c]) + if (v.y < this.kingPos[v.c][1]) this.castleFlags[v.c][0] = 8; else - // v.y > this.INIT_COL_KING[v.c] + // v.y > this.kingPos[v.c][1] this.castleFlags[v.c][1] = 8; } } @@ -248,4 +249,5 @@ export class Allmate1Rules extends ChessRules { } return notation; } + };