From: Benjamin Auder Date: Tue, 27 Apr 2021 16:27:04 +0000 (+0200) Subject: Fix Shogi.js X-Git-Url: https://git.auder.net/variants/current/doc/scripts/css/pieces/cr.svg?a=commitdiff_plain;h=45731a7c47d0d9ff6cb9b4cecb2b609f286c2f45;p=vchess.git Fix Shogi.js --- diff --git a/TODO b/TODO index ad453557..9706a013 100644 --- a/TODO +++ b/TODO @@ -36,3 +36,8 @@ A player wins by checkmating the opponent. Note that the coin can be used to rem https://www.chessvariants.com/other.dir/nemoroth.html :-) Chagagne ^^ + +Power Sharing +Rules: Two adjacent pieces of the same color can share their movement. Adjacency includes diagonals, sharing ends once pieces are separated, and sharing can be used to check, capture pieces, and promote pawns. +(+ pawns and king ?!) +TheGoatMan Discord https://discord.com/channels/686736099959504907/687076968046395410/836274318480113686 diff --git a/client/src/variants/Shogi.js b/client/src/variants/Shogi.js index 1526aabd..5f85e753 100644 --- a/client/src/variants/Shogi.js +++ b/client/src/variants/Shogi.js @@ -490,13 +490,13 @@ export class ShogiRules extends ChessRules { return false; } - isAttackedBySilver([x, y], color) { + isAttackedBySilver(sq, color) { const shift = (color == 'w' ? 1 : -1); return this.isAttackedBySlideNJump( sq, color, V.SILVER, V.steps[V.BISHOP].concat([ [shift, 0] ]), 1); } - isAttackedByPawn([x, y], color) { + isAttackedByPawn(sq, color) { const shift = (color == 'w' ? 1 : -1); return this.isAttackedBySlideNJump(sq, color, V.PAWN, [ [shift, 0] ], 1); }