X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAbsorption.js;h=b10f16530de3ea160c3e962e79e0c9aba6463ccb;hb=9715a7aa1decd42366e80b646d6fd3760fff03ea;hp=efa01036cfe87c3fcf06d54c578acb436772dac8;hpb=107dc1bd5361e2538b1551bdcc37c1e90a444b83;p=vchess.git diff --git a/client/src/variants/Absorption.js b/client/src/variants/Absorption.js index efa01036..b10f1653 100644 --- a/client/src/variants/Absorption.js +++ b/client/src/variants/Absorption.js @@ -80,6 +80,15 @@ export class AbsorptionRules extends ChessRules { default: moves = super.getPotentialMovesFrom(sq); } + // Filter out capturing promotions (except one), + // because they are all the same. + moves = moves.filter(m => { + return ( + m.vanish.length == 1 || + m.vanish[0].p != V.PAWN || + [V.PAWN, V.QUEEN].includes(m.appear[0].p) + ); + }); moves.forEach(m => { if (m.vanish.length == 2) { // Augment pieces abilities in case of captures @@ -124,6 +133,13 @@ export class AbsorptionRules extends ChessRules { ); } + static get VALUES() { + return Object.assign( + { a: 12, e: 7, s: 5 }, + ChessRules.VALUES + ); + } + getNotation(move) { let notation = super.getNotation(move); if (move.vanish[0].p != V.PAWN && move.appear[0].p != move.vanish[0].p)