X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FOmega.js;h=a688a2ea8c36b68359b7a9ceed7b53460717f44f;hb=f10a644e185d7c467d280d4a0deb2905df038dd3;hp=289c05b35b3dca644018af621f4d3aaa03c700c9;hpb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;p=vchess.git diff --git a/client/src/variants/Omega.js b/client/src/variants/Omega.js index 289c05b3..a688a2ea 100644 --- a/client/src/variants/Omega.js +++ b/client/src/variants/Omega.js @@ -17,6 +17,10 @@ export class OmegaRules extends ChessRules { ); } + static get DarkBottomRight() { + return true; + } + // For space between corners: static get NOTHING() { return "xx"; @@ -274,12 +278,9 @@ export class OmegaRules extends ChessRules { getPotentialMovesFrom([x, y]) { switch (this.getPiece(x, y)) { - case V.CHAMPION: - return this.getPotentialChampionMoves([x, y]); - case V.WIZARD: - return this.getPotentialWizardMoves([x, y]); - default: - return super.getPotentialMovesFrom([x, y]); + case V.CHAMPION: return this.getPotentialChampionMoves([x, y]); + case V.WIZARD: return this.getPotentialWizardMoves([x, y]); + default: return super.getPotentialMovesFrom([x, y]); } } @@ -308,18 +309,12 @@ export class OmegaRules extends ChessRules { return moves; } - addPawnMoves([x1, y1], [x2, y2], moves, promotions) { - let finalPieces = [V.PAWN]; + addPawnMoves([x1, y1], [x2, y2], moves) { 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; + const finalPieces = (x2 == lastRank ? V.PawnSpecs.promotions : [V.PAWN]); for (let piece of finalPieces) { - tr = (piece != V.PAWN ? { c: color, p: piece } : null); + const tr = (piece != V.PAWN ? { c: color, p: piece } : null); moves.push(this.getBasicMove([x1, y1], [x2, y2], tr)); } }