X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAbsorption.js;h=c6e1de7476af0c61f08a69d059f0907ee4016efa;hb=2c947b3a9b435b87781d31b0ef6e7744dd81ee1b;hp=b10f16530de3ea160c3e962e79e0c9aba6463ccb;hpb=9715a7aa1decd42366e80b646d6fd3760fff03ea;p=vchess.git diff --git a/client/src/variants/Absorption.js b/client/src/variants/Absorption.js index b10f1653..c6e1de74 100644 --- a/client/src/variants/Absorption.js +++ b/client/src/variants/Absorption.js @@ -1,6 +1,7 @@ import { ChessRules } from "@/base_rules"; export class AbsorptionRules extends ChessRules { + getPpath(b) { if ([V.BN, V.RN, V.QN].includes(b[1])) return "Absorption/" + b; return b; @@ -49,8 +50,8 @@ export class AbsorptionRules extends ChessRules { // p1 or p2 already have knight + other piece return (p1 == V.KNIGHT ? p2 : p1); } + if ([p1, p2].includes(V.QN)) return V.QN; for (let p of [p1, p2]) { - if (p == V.QN) return V.QN; if ([V.BN, V.RN].includes(p)) return V.MergeComposed[[p1, p2].sort().join("")]; } @@ -147,4 +148,5 @@ export class AbsorptionRules extends ChessRules { notation += "=" + move.appear[0].p.toUpperCase(); return notation; } + };