X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCannibal.js;h=3a87a723259f9c8ad55e6cfb25b1c7d89e578ac1;hb=0a9cef131612079e55714f56f1466b4e2bd749af;hp=a08f197547d88ded964ede5635136b3d463df19a;hpb=6f2f94374f1e73c375edf732d9425e575e81fff7;p=vchess.git diff --git a/client/src/variants/Cannibal.js b/client/src/variants/Cannibal.js index a08f1975..3a87a723 100644 --- a/client/src/variants/Cannibal.js +++ b/client/src/variants/Cannibal.js @@ -231,7 +231,18 @@ export class CannibalRules extends ChessRules { }; } - static get SEARCH_DEPTH() { - return 4; + getNotation(move) { + let notation = super.getNotation(move); + const lastRank = (move.appear[0].c == "w" ? 0 : 7); + if ( + move.end.x != lastRank && + this.getPiece(move.start.x, move.start.y) == V.PAWN && + move.vanish.length == 2 && + move.appear[0].p != V.PAWN + ) { + // Fix "promotion" (transform indicator) from base_rules notation + notation = notation.slice(0, -2); + } + return notation; } };