From: Benjamin Auder Date: Wed, 15 Jul 2020 12:28:47 +0000 (+0200) Subject: Add Progressive2 + fix knightrider translations X-Git-Url: https://git.auder.net/variants/Chakart/%7B%7B%20asset%28%27mixstore/doc/html/up.jpg?a=commitdiff_plain;h=eaab401ea14ebbde1e49ede7c639bc3b6556bf08;p=vchess.git Add Progressive2 + fix knightrider translations --- diff --git a/client/src/translations/en.js b/client/src/translations/en.js index 42112a4f..e088adfb 100644 --- a/client/src/translations/en.js +++ b/client/src/translations/en.js @@ -237,7 +237,8 @@ export const translations = { "Pawns move diagonally": "Pawns move diagonally", "Pieces upside down": "Pieces upside down", "Play at the same time": "Play at the same time", - "Play more and more moves": "Play more and more moves", + "Play more and more moves (v1)": "Play more and more moves (v1)", + "Play more and more moves (v2)": "Play more and more moves (v2)", "Play opponent's pieces": "Play opponent's pieces", "Powerful pieces": "Powerful pieces", "Prolongated captures": "Prolongated captures", diff --git a/client/src/translations/es.js b/client/src/translations/es.js index 379daaee..605f5015 100644 --- a/client/src/translations/es.js +++ b/client/src/translations/es.js @@ -237,7 +237,8 @@ export const translations = { "Pawns move diagonally": "Peones se mueven en diagonal", "Pieces upside down": "Piezas al revés", "Play at the same time": "Jugar al mismo tiempo", - "Play more and more moves": "Jugar más y más movimientos", + "Play more and more moves (v1)": "Jugar más y más movimientos (v1)", + "Play more and more moves (v2)": "Jugar más y más movimientos (v2)", "Play opponent's pieces": "Jugar piezas opuestas", "Powerful pieces": "Piezas poderosas", "Prolongated captures": "Capturas extendidas", diff --git a/client/src/translations/fr.js b/client/src/translations/fr.js index dce01310..a35c4ca4 100644 --- a/client/src/translations/fr.js +++ b/client/src/translations/fr.js @@ -237,7 +237,8 @@ export const translations = { "Pawns move diagonally": "Les pions vont en diagonale", "Pieces upside down": "Pièces à l'envers", "Play at the same time": "Jouer en même temps", - "Play more and more moves": "Jouez de plus en plus de coups", + "Play more and more moves (v1)": "Jouez de plus en plus de coups (v1)", + "Play more and more moves (v2)": "Jouez de plus en plus de coups (v2)", "Play opponent's pieces": "Jouez les pièces adverses", "Powerful pieces": "Pièces puissantes", "Prolongated captures": "Captures prolongées", diff --git a/client/src/translations/rules/Checkered2/en.pug b/client/src/translations/rules/Checkered2/en.pug index 4c004a35..0d0af195 100644 --- a/client/src/translations/rules/Checkered2/en.pug +++ b/client/src/translations/rules/Checkered2/en.pug @@ -4,7 +4,7 @@ p.boxed p | This is the - a(href="/variants/Checkered1") Checkered1 variant + a(href="/#/variants/Checkered1") Checkered1 variant | , without the stage 2. | Probably more drawish, but also quite different. | I think both are interesting. diff --git a/client/src/translations/rules/Checkered2/es.pug b/client/src/translations/rules/Checkered2/es.pug index a93f5790..a38eaf2c 100644 --- a/client/src/translations/rules/Checkered2/es.pug +++ b/client/src/translations/rules/Checkered2/es.pug @@ -4,7 +4,7 @@ p.boxed p | Esta la - a(href="/variants/Checkered1") variante Checkered1 + a(href="/#/variants/Checkered1") variante Checkered1 | , sin fase 2. | Probablemente más canceladoras, pero también bastante diferente. | Creo que ambos tienen interés. diff --git a/client/src/translations/rules/Checkered2/fr.pug b/client/src/translations/rules/Checkered2/fr.pug index 5b5de767..4b0b92a2 100644 --- a/client/src/translations/rules/Checkered2/fr.pug +++ b/client/src/translations/rules/Checkered2/fr.pug @@ -4,7 +4,7 @@ p.boxed p | C'est la - a(href="/variants/Checkered1") variante Checkered1 + a(href="/#/variants/Checkered1") variante Checkered1 | , sans la phase 2. | Sans doute plus annulant, mais aussi assez différente. | Je pense que les deux ont un intérêt. diff --git a/client/src/translations/rules/Enpassant/es.pug b/client/src/translations/rules/Enpassant/es.pug index 50770d18..efc974f8 100644 --- a/client/src/translations/rules/Enpassant/es.pug +++ b/client/src/translations/rules/Enpassant/es.pug @@ -27,9 +27,9 @@ h3 Movimientos especiales ul li. - Los caballos se convierten en caballeros, capaces de realizar varias - saltos en la misma dirección. - Por ejemplo en la posición inicial, el caballero en g1 puede ir a e5 + Los caballos se convierten en caballos de la noche (o noctámbulos), + capaces de realizar varias saltos en la misma dirección. + Por ejemplo en la posición inicial, el noctámbulo en g1 puede ir a e5 o podría tomar en d7 además de los movimientos de caballo. li. El rey puede capturar una pieza en passant haciendo @@ -39,7 +39,7 @@ figure.diagram-container .diagram | fen:rnbqk1nr/ppppppbp/6p1/8/8/2NP5/PPP1PPPP/R1BQKBNR h3,f3,e5,d7: figcaption. - Posibles jugadas de caballero después de 1.d3 g6 2.Nc3 Bg7. + Posibles jugadas de noctámbulo después de 1.d3 g6 2.Nc3 Bg7. Si 3.Nxd7, 3...Bxe5 e.p. es posible. p. @@ -53,7 +53,7 @@ p. figure.diagram-container .diagram | fen:nbqnbrkr/pppppppp/8/8/8/8/PPPPPPPP/RNKBQNBR: - figcaption 1.Nxe7# y 1...Nxg2: "anomalías de caballeros". + figcaption 1.Nxe7# y 1...Nxg2: "anomalías de noctámbulos". h3 Fuente diff --git a/client/src/translations/rules/Enpassant/fr.pug b/client/src/translations/rules/Enpassant/fr.pug index 1a818f70..d598e840 100644 --- a/client/src/translations/rules/Enpassant/fr.pug +++ b/client/src/translations/rules/Enpassant/fr.pug @@ -28,10 +28,10 @@ h3 Coups spéciaux ul li. - Les cavaliers deviennent des chevaliers, pouvant effectuer plusieurs - déplacements de cavalier dans la même direction. - Par exemple dans la position initiale, le chevalier en g1 peut aller - en e5 ou pourrait prendre en d7 en plus des coups de cavalier. + Les cavaliers deviennent des cavaliers de la nuit (ou noctambules), + pouvant effectuer plusieurs déplacements de cavalier dans la même + direction. Par exemple dans la position initiale, le noctambule en g1 peut + aller en e5 ou pourrait prendre en d7 en plus des coups de cavalier. li. Le roi peut capturer une pièce en passant en effectuant un coup de cavalier. @@ -40,7 +40,7 @@ figure.diagram-container .diagram | fen:rnbqk1nr/ppppppbp/6p1/8/8/2NP5/PPP1PPPP/R1BQKBNR h3,f3,e5,d7: figcaption. - Possibles coups de chevalier après 1.d3 g6 2.Nc3 Bg7. + Possibles coups de noctambule après 1.d3 g6 2.Nc3 Bg7. Si 3.Nxd7, 3...Bxe5 e.p. est possible. p. @@ -53,7 +53,7 @@ p. figure.diagram-container .diagram | fen:nbqnbrkr/pppppppp/8/8/8/8/PPPPPPPP/RNKBQNBR: - figcaption 1.Nxe7# et 1...Nxg2 : "anomalies de chevaliers". + figcaption 1.Nxe7# et 1...Nxg2 : "anomalies de noctambules". h3 Source diff --git a/client/src/translations/rules/Progressive/en.pug b/client/src/translations/rules/Progressive1/en.pug similarity index 100% rename from client/src/translations/rules/Progressive/en.pug rename to client/src/translations/rules/Progressive1/en.pug diff --git a/client/src/translations/rules/Progressive/es.pug b/client/src/translations/rules/Progressive1/es.pug similarity index 100% rename from client/src/translations/rules/Progressive/es.pug rename to client/src/translations/rules/Progressive1/es.pug diff --git a/client/src/translations/rules/Progressive/fr.pug b/client/src/translations/rules/Progressive1/fr.pug similarity index 100% rename from client/src/translations/rules/Progressive/fr.pug rename to client/src/translations/rules/Progressive1/fr.pug diff --git a/client/src/translations/rules/Progressive2/en.pug b/client/src/translations/rules/Progressive2/en.pug new file mode 100644 index 00000000..1590c187 --- /dev/null +++ b/client/src/translations/rules/Progressive2/en.pug @@ -0,0 +1,8 @@ +p.boxed + | White plays one move, then black play twice, + | then white plays three moves... + +p + Same as + a(href="/#/variants/Progressive1") Progressive1 + | , but without initial double-step pawn move, and without castling. diff --git a/client/src/translations/rules/Progressive2/es.pug b/client/src/translations/rules/Progressive2/es.pug new file mode 100644 index 00000000..a3f70e97 --- /dev/null +++ b/client/src/translations/rules/Progressive2/es.pug @@ -0,0 +1,8 @@ +p.boxed + | Las blancas juegan un movimiento, luego las negras juegan dos veces, + | entonces las blancas juegan tres movimientos... + +p + | Como + a(href="/#/variants/Progressive1") Progressive1 + | , pero sin el doble movimiento inicial de peón, y sin enroque. diff --git a/client/src/translations/rules/Progressive2/fr.pug b/client/src/translations/rules/Progressive2/fr.pug new file mode 100644 index 00000000..6b8248fe --- /dev/null +++ b/client/src/translations/rules/Progressive2/fr.pug @@ -0,0 +1,8 @@ +p.boxed + | Les blancs jouent un coup, puis les noirs jouent deux fois, + | ensuite les blancs jouent trois coups... + +p + Comme + a(href="/#/variants/Progressive1") Progressive1 + | , mais sans le double coup initial de pion, et sans roque. diff --git a/client/src/translations/rules/Royalrace/es.pug b/client/src/translations/rules/Royalrace/es.pug index 634f4b7c..584771eb 100644 --- a/client/src/translations/rules/Royalrace/es.pug +++ b/client/src/translations/rules/Royalrace/es.pug @@ -21,7 +21,7 @@ h3 Movimientos de piezas adaptadas ul li. - Los caballos se convierten en caballeros: + Los caballos se convierten en noctámbulos: pueden hacer varios saltos de caballo en la misma dirección. li. Los peones se mueven como torres. diff --git a/client/src/translations/rules/Royalrace/fr.pug b/client/src/translations/rules/Royalrace/fr.pug index 21f6dae4..c0bb36b2 100644 --- a/client/src/translations/rules/Royalrace/fr.pug +++ b/client/src/translations/rules/Royalrace/fr.pug @@ -22,7 +22,7 @@ h3 Déplacements de pièces adaptés ul li. - Les cavaliers deviennent des chevaliers : + Les cavaliers deviennent des noctambules : ils peuvent effectuer plusieurs sauts de cavalier dans une même direction. li. Les pions se déplacent comme des tours. diff --git a/client/src/translations/variants/en.pug b/client/src/translations/variants/en.pug index 67227c79..854e5a61 100644 --- a/client/src/translations/variants/en.pug +++ b/client/src/translations/variants/en.pug @@ -339,7 +339,8 @@ p In these variants, you can play two or more moves per turn. "Doublemove1", "Doublemove2", "Monster", - "Progressive" + "Progressive1", + "Progressive2" ] ul for v in varlist diff --git a/client/src/translations/variants/es.pug b/client/src/translations/variants/es.pug index a373000d..283169c4 100644 --- a/client/src/translations/variants/es.pug +++ b/client/src/translations/variants/es.pug @@ -350,7 +350,8 @@ p En estas variantes, puedes jugar dos o más movimientos por turno. "Doublemove1", "Doublemove2", "Monster", - "Progressive" + "Progressive1", + "Progressive2" ] ul for v in varlist diff --git a/client/src/translations/variants/fr.pug b/client/src/translations/variants/fr.pug index 72e481ae..26835cbd 100644 --- a/client/src/translations/variants/fr.pug +++ b/client/src/translations/variants/fr.pug @@ -349,7 +349,8 @@ p Dans ces variantes, vous pouvez jouer deux coups ou plus par tour. "Doublemove1", "Doublemove2", "Monster", - "Progressive" + "Progressive1", + "Progressive2" ] ul for v in varlist diff --git a/client/src/variants/Progressive.js b/client/src/variants/Progressive1.js similarity index 98% rename from client/src/variants/Progressive.js rename to client/src/variants/Progressive1.js index 67654286..4f69ee90 100644 --- a/client/src/variants/Progressive.js +++ b/client/src/variants/Progressive1.js @@ -1,7 +1,7 @@ import { ChessRules } from "@/base_rules"; import { randInt } from "@/utils/alea"; -export class ProgressiveRules extends ChessRules { +export class Progressive1Rules extends ChessRules { static get HasEnpassant() { return false; } diff --git a/client/src/variants/Progressive2.js b/client/src/variants/Progressive2.js new file mode 100644 index 00000000..ffc22bc9 --- /dev/null +++ b/client/src/variants/Progressive2.js @@ -0,0 +1,51 @@ +import { Progressive1Rules } from "@/variants/Progressive1"; +import { SuicideRules } from "@/variants/Suicide"; +import { ChessRules } from "@/base_rules"; +import { randInt } from "@/utils/alea"; + +export class Progressive2Rules extends Progressive1Rules { + static get PawnSpecs() { + return Object.assign( + {}, + ChessRules.PawnSpecs, + { twoSquares: false } + ); + } + + static get HasFlags() { + return false; + } + + postPlay(move) { + const c = move.turn[0]; + const piece = move.vanish[0].p; + if (piece == V.KING && move.appear.length > 0) { + this.kingPos[c][0] = move.appear[0].x; + this.kingPos[c][1] = move.appear[0].y; + } + } + + undo(move) { + this.disaggregateFlags(JSON.parse(move.flags)); + V.UndoOnBoard(this.board, move); + if (this.turn != move.turn[0]) this.movesCount--; + this.turn = move.turn[0]; + this.subTurn = move.turn[1]; + super.postUndo(move); + } + + static GenRandInitFen(randomness) { + return SuicideRules.GenRandInitFen(randomness); + } + + static get VALUES() { + return { + p: 1, + r: 5, + n: 3, + b: 3, + q: 7, //slightly less than in orthodox game + k: 1000 + }; + } +}; diff --git a/server/db/populate.sql b/server/db/populate.sql index f55889ae..1543847e 100644 --- a/server/db/populate.sql +++ b/server/db/populate.sql @@ -85,7 +85,8 @@ insert or ignore into Variants (name, description) values ('Pawnsking', 'Reach the last rank (v2)'), ('Perfect', 'Powerful pieces'), ('Pocketknight', 'Knight in pocket'), - ('Progressive', 'Play more and more moves'), + ('Progressive1', 'Play more and more moves (v1)'), + ('Progressive2', 'Play more and more moves (v2)'), ('Queenpawns', 'Queen versus pawns'), ('Racingkings', 'Kings cross the 8x8 board'), ('Rampage', 'Move under cover'),