X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAntiking1.js;h=781984f9c80e4118c5d79f7f186ec07abca49682;hp=92034a307279f47c2c96701105bf40f32798aea3;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hpb=cee75a57d2f4f89c89d64cefbab55d839a238ed9 diff --git a/client/src/variants/Antiking1.js b/client/src/variants/Antiking1.js index 92034a30..781984f9 100644 --- a/client/src/variants/Antiking1.js +++ b/client/src/variants/Antiking1.js @@ -5,6 +5,10 @@ import { randInt } from "@/utils/alea"; export class Antiking1Rules extends BerolinaRules { + static get Options() { + return null; + } + static get PawnSpecs() { return Object.assign( {}, @@ -132,10 +136,7 @@ export class Antiking1Rules extends BerolinaRules { getPotentialAntikingMoves(sq) { // The antiking moves like a king (only captured colors differ) return this.getSlideNJumpMoves( - sq, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]), - "oneStep" - ); + sq, V.steps[V.ROOK].concat(V.steps[V.BISHOP]), 1); } isAttacked(sq, color) { @@ -149,24 +150,14 @@ export class Antiking1Rules extends BerolinaRules { // Antiking is not attacked by king: if (this.getPiece(x, y) == V.ANTIKING) return false; return this.isAttackedBySlideNJump( - [x, y], - color, - V.KING, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]), - "oneStep" - ); + [x, y], color, V.KING, V.steps[V.ROOK].concat(V.steps[V.BISHOP]), 1); } isAttackedByAntiking([x, y], color) { // (Anti)King is not attacked by antiking if ([V.KING, V.ANTIKING].includes(this.getPiece(x, y))) return false; return this.isAttackedBySlideNJump( - [x, y], - color, - V.ANTIKING, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]), - "oneStep" - ); + [x, y], color, V.ANTIKING, V.steps[V.ROOK].concat(V.steps[V.BISHOP]), 1); } underCheck(color) {