X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FOmega.js;h=355960b737801fe4690639a98234f54cba396c99;hp=1fde5821e15901fbb101f222bc1f13e17bdf3ac4;hb=b19c68965d6249ab4d7873b99e2f22471049b2c1;hpb=4eb0915a0659c8bece6930866a526c5e2c296d9f diff --git a/client/src/variants/Omega.js b/client/src/variants/Omega.js index 1fde5821..355960b7 100644 --- a/client/src/variants/Omega.js +++ b/client/src/variants/Omega.js @@ -307,6 +307,22 @@ export class OmegaRules extends ChessRules { return moves; } + addPawnMoves([x1, y1], [x2, y2], moves, promotions) { + let finalPieces = [V.PAWN]; + const color = this.turn; + const lastRank = (color == "w" ? 1 : V.size.x - 2); + if (x2 == lastRank) { + // promotions arg: special override for Hiddenqueen variant + if (!!promotions) finalPieces = promotions; + else if (!!V.PawnSpecs.promotions) finalPieces = V.PawnSpecs.promotions; + } + let tr = null; + for (let piece of finalPieces) { + tr = (piece != V.PAWN ? { c: color, p: piece } : null); + moves.push(this.getBasicMove([x1, y1], [x2, y2], tr)); + } + } + getPotentialChampionMoves(sq) { return this.getSlideNJumpMoves(sq, V.steps[V.CHAMPION], "oneStep"); }