X-Git-Url: https://git.auder.net/variants/Baroque/style.css?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FMagnetic.js;h=4549e846d9de4b78dbf772e4d2c9872778e25a34;hb=afbf3ca7151ef15a9e579b0f913683ab212396c4;hp=c2201d60afa94f12490914c4df8e2977d7583e8b;hpb=910d631b73cad5ffef1b4461157b704e7e7057d8;p=vchess.git diff --git a/client/src/variants/Magnetic.js b/client/src/variants/Magnetic.js index c2201d60..4549e846 100644 --- a/client/src/variants/Magnetic.js +++ b/client/src/variants/Magnetic.js @@ -136,8 +136,9 @@ export const VariantRules = class MagneticRules extends ChessRules { return true; //TODO: is it right? } - underCheck() { - return false; //there is no check + filterValid(moves) { + // There are no checks + return moves; } getCheckSquares() { @@ -189,7 +190,7 @@ export const VariantRules = class MagneticRules extends ChessRules { const color = this.turn; const kp = this.kingPos[color]; if (kp[0] < 0) - //king disappeared + // King disappeared return color == "w" ? "0-1" : "1-0"; if (this.atLeastOneMove()) // game not over @@ -200,4 +201,8 @@ export const VariantRules = class MagneticRules extends ChessRules { static get THRESHOLD_MATE() { return 500; //checkmates evals may be slightly below 1000 } + + static get SEARCH_DEPTH() { + return 2; + } };