From: Benjamin Auder Date: Sun, 6 Dec 2020 10:26:48 +0000 (+0100) Subject: Fix Fullcavalry: lancers' initial orientation X-Git-Url: https://git.auder.net/doc/html/img/%7B%7B%20path%28%27mixstore_static_policy%27%29%20%7D%7D?a=commitdiff_plain;h=fe9ba5a032da752af31c079115c2d264a956a594;p=vchess.git Fix Fullcavalry: lancers' initial orientation --- diff --git a/client/src/translations/rules/Fullcavalry/en.pug b/client/src/translations/rules/Fullcavalry/en.pug index 98110364..b5fe4106 100644 --- a/client/src/translations/rules/Fullcavalry/en.pug +++ b/client/src/translations/rules/Fullcavalry/en.pug @@ -8,7 +8,7 @@ p | . p. - Lancers are initially facing each other. + Lancers begin aimed toward their destination square of castling. They can be reoriented after castling, if they effectively moved. While castling, some pieces can stand on the lancer's path, since it can jump over them. diff --git a/client/src/translations/rules/Fullcavalry/es.pug b/client/src/translations/rules/Fullcavalry/es.pug index 2067a1d1..449f2b6c 100644 --- a/client/src/translations/rules/Fullcavalry/es.pug +++ b/client/src/translations/rules/Fullcavalry/es.pug @@ -8,7 +8,7 @@ p | . p. - Los Lancers inicialmente se enfrentan entre sí. + Los lanceros inicialmente apuntan su casilla de destino al final del enroque. Se pueden reorientar después del enroque, si realmente se movieron. Durante el enroque, se pueden encontrar piezas en el camino de la lanza, ya que puede saltarlo. diff --git a/client/src/translations/rules/Fullcavalry/fr.pug b/client/src/translations/rules/Fullcavalry/fr.pug index e92a1afd..b1662ff4 100644 --- a/client/src/translations/rules/Fullcavalry/fr.pug +++ b/client/src/translations/rules/Fullcavalry/fr.pug @@ -8,7 +8,7 @@ p | . p. - Les lanciers se font initialement face. + Les lanciers visent initialement leur case de destination en fin de roque. Ils peuvent être réorientés après le roque, s'ils ont effectivement bougé. Pendant le roque, des pièces peuvent se trouver sur le chemin du lancier, puisqu'il peut sauter par dessus. diff --git a/client/src/variants/Fullcavalry.js b/client/src/variants/Fullcavalry.js index 672ebc8a..7397261e 100644 --- a/client/src/variants/Fullcavalry.js +++ b/client/src/variants/Fullcavalry.js @@ -100,10 +100,14 @@ export class FullcavalryRules extends ChessRules { firstWhiteRook = baseFen.indexOf('R'), lastWhiteRook = baseFen.lastIndexOf('R'); return ( - baseFen.substring(0, firstBlackRook) + 'e' + - baseFen.substring(firstBlackRook + 1, lastBlackRook) + 'm' + - baseFen.substring(lastBlackRook + 1, firstWhiteRook) + 'E' + - baseFen.substring(firstWhiteRook + 1, lastWhiteRook) + 'M' + + baseFen.substring(0, firstBlackRook) + + (firstBlackRook <= 3 ? 'e' : 'm') + + baseFen.substring(firstBlackRook + 1, lastBlackRook) + + (lastBlackRook >= 5 ? 'm' : 'e') + + baseFen.substring(lastBlackRook + 1, firstWhiteRook) + + (firstWhiteRook <= 3 ? 'E' : 'M') + + baseFen.substring(firstWhiteRook + 1, lastWhiteRook) + + (lastWhiteRook >= 5 ? 'M' : 'E') + baseFen.substring(lastWhiteRook + 1) ); }