X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAntiking.js;h=c3fe0137da267b1b224e3acbd0aa315d88ee2680;hb=3a2a7b5fd3c6bfd0752838094c27e1fb6172d109;hp=1c062bbf04cd039e0e4e450066692130b84d6e51;hpb=7ba4a5bc5b64e19a1e7f26aa232d5c50770d07ad;p=vchess.git diff --git a/client/src/variants/Antiking.js b/client/src/variants/Antiking.js index 1c062bbf..c3fe0137 100644 --- a/client/src/variants/Antiking.js +++ b/client/src/variants/Antiking.js @@ -111,8 +111,8 @@ export const VariantRules = class AntikingRules extends ChessRules { return res; } - updateVariables(move) { - super.updateVariables(move); + postPlay(move) { + super.postPlay(move); const piece = move.vanish[0].p; const c = move.vanish[0].c; // Update antiking position @@ -122,8 +122,8 @@ export const VariantRules = class AntikingRules extends ChessRules { } } - unupdateVariables(move) { - super.unupdateVariables(move); + postUndo(move) { + super.postUndo(move); const c = move.vanish[0].c; if (move.vanish[0].p == V.ANTIKING) this.antikingPos[c] = [move.start.x, move.start.y]; @@ -152,15 +152,17 @@ export const VariantRules = class AntikingRules extends ChessRules { } static GenRandInitFen(randomness) { - if (!randomness) randomness = 2; if (randomness == 0) - return "rnbqkbnr/pppppppp/3A4/8/8/3a4/PPPPPPPP/RNBQKBNR w 0 1111 -"; + return "rnbqkbnr/pppppppp/3A4/8/8/3a4/PPPPPPPP/RNBQKBNR w 0 ahah -"; let pieces = { w: new Array(8), b: new Array(8) }; + let flags = ""; let antikingPos = { w: -1, b: -1 }; for (let c of ["w", "b"]) { if (c == 'b' && randomness == 1) { pieces['b'] = pieces['w']; + antikingPos['b'] = antikingPos['w']; + flags += flags; break; } @@ -201,6 +203,7 @@ export const VariantRules = class AntikingRules extends ChessRules { pieces[c][bishop2Pos] = "b"; pieces[c][knight2Pos] = "n"; pieces[c][rook2Pos] = "r"; + flags += V.CoordToColumn(rook1Pos) + V.CoordToColumn(rook2Pos); } const ranks23_black = "pppppppp/" + @@ -220,7 +223,11 @@ export const VariantRules = class AntikingRules extends ChessRules { ranks23_white + "/" + pieces["w"].join("").toUpperCase() + - " w 0 1111 -" + " w 0 " + flags + " -" ); } + + static get SEARCH_DEPTH() { + return 2; + } };