X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FShatranj.js;h=969b8197606c8872b84b13e8953a9b0118baddb7;hp=c364b816f3db16fb0e644dc90a8a5128e929962d;hb=68e19a449db7a12e0a168e99cd750d985c983ba1;hpb=11589e7c4bb1b69473588d133db8b6d1d37b8fee diff --git a/client/src/variants/Shatranj.js b/client/src/variants/Shatranj.js index c364b816..969b8197 100644 --- a/client/src/variants/Shatranj.js +++ b/client/src/variants/Shatranj.js @@ -98,20 +98,20 @@ export const VariantRules = class ShatranjRules extends ChessRules { ); } - isAttackedByBishop(sq, colors) { + isAttackedByBishop(sq, color) { return this.isAttackedBySlideNJump( sq, - colors, + color, V.BISHOP, V.ElephantSteps, "oneStep" ); } - isAttackedByQueen(sq, colors) { + isAttackedByQueen(sq, color) { return this.isAttackedBySlideNJump( sq, - colors, + color, V.QUEEN, V.steps[V.BISHOP], "oneStep" @@ -157,7 +157,7 @@ export const VariantRules = class ShatranjRules extends ChessRules { // 2 enemy units or more: I lose return getScoreLost(); // I don't have any piece, my opponent have one: can I take it? - if (this.isAttacked(piecesLeft[oppCol].square, [color])) + if (this.isAttacked(piecesLeft[oppCol].square, color)) // Yes! But I still need to take it return "*"; // No :(