From 4313762da3237b04f204e121a20cab3ba7bb5dd2 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Mon, 12 Apr 2021 17:54:42 +0200 Subject: [PATCH] Several small improvements + integrate options + first working draft of Cwda --- TODO | 16 +- client/public/images/pieces/Cwda/bc.svg | 158 ++++++ client/public/images/pieces/Cwda/bf.svg | 247 +++++++++ client/public/images/pieces/Cwda/bg.svg | 88 +++ client/public/images/pieces/Cwda/bh.svg | 260 ++------- client/public/images/pieces/Cwda/bi.svg | 93 ++++ client/public/images/pieces/Cwda/bl.svg | 78 +++ client/public/images/pieces/Cwda/bo.svg | 103 ++++ client/public/images/pieces/Cwda/bs.svg | 199 +++---- client/public/images/pieces/Cwda/bt.svg | 88 +++ .../images/pieces/Cwda/{ba.svg => bw.svg} | 0 client/public/images/pieces/Cwda/by.svg | 98 ++++ client/public/images/pieces/Cwda/wc.svg | 153 ++++++ client/public/images/pieces/Cwda/wf.svg | 285 ++++++++++ client/public/images/pieces/Cwda/wg.svg | 97 ++++ client/public/images/pieces/Cwda/wh.svg | 321 +++-------- client/public/images/pieces/Cwda/wi.svg | 64 +++ client/public/images/pieces/Cwda/wl.svg | 133 +++++ client/public/images/pieces/Cwda/wo.svg | 190 +++++++ client/public/images/pieces/Cwda/ws.svg | 225 ++++---- client/public/images/pieces/Cwda/wt.svg | 95 ++++ .../images/pieces/Cwda/{wa.svg => ww.svg} | 0 client/public/images/pieces/Cwda/wy.svg | 69 +++ client/src/base_rules.js | 34 +- client/src/components/BaseGame.vue | 4 +- client/src/components/ChallengeList.vue | 15 +- client/src/components/Settings.vue | 10 + client/src/components/UploadGame.vue | 3 + client/src/data/challengeCheck.js | 2 + client/src/store.js | 13 +- client/src/translations/about/en.pug | 5 +- client/src/translations/about/es.pug | 5 +- client/src/translations/about/fr.pug | 5 +- client/src/translations/en.js | 21 +- client/src/translations/es.js | 21 +- client/src/translations/faq/en.pug | 8 - client/src/translations/faq/es.pug | 9 - client/src/translations/faq/fr.pug | 9 - client/src/translations/fr.js | 23 +- client/src/translations/rules/Capture/en.pug | 3 +- client/src/translations/rules/Capture/es.pug | 3 +- client/src/translations/rules/Capture/fr.pug | 3 +- client/src/translations/rules/Cwda/en.pug | 103 +++- client/src/translations/rules/Cwda/es.pug | 111 +++- client/src/translations/rules/Cwda/fr.pug | 115 +++- client/src/variants/Absorption.js | 6 +- client/src/variants/Alapo.js | 16 +- client/src/variants/Align4.js | 22 +- client/src/variants/Allmate.js | 9 +- client/src/variants/Ambiguous.js | 6 +- client/src/variants/Antiking1.js | 23 +- client/src/variants/Antiking2.js | 18 +- client/src/variants/Apocalypse.js | 4 + client/src/variants/Arena.js | 33 +- client/src/variants/Atarigo.js | 4 + client/src/variants/Avalam2.js | 4 + client/src/variants/Avalanche.js | 1 + client/src/variants/Balaklava.js | 13 +- client/src/variants/Ball.js | 29 +- client/src/variants/Bario.js | 4 + client/src/variants/Baroque.js | 28 +- client/src/variants/Benedict.js | 18 +- client/src/variants/Bicolour.js | 6 +- client/src/variants/Bishopawns.js | 4 + client/src/variants/Capablanca.js | 26 +- client/src/variants/Chakart.js | 4 +- client/src/variants/Checkered.js | 60 +- client/src/variants/Chess960.js | 3 +- client/src/variants/Circular.js | 8 +- client/src/variants/Clorange.js | 25 +- client/src/variants/Convert.js | 6 +- client/src/variants/Copycat.js | 4 +- client/src/variants/Coregal.js | 11 +- client/src/variants/Crazyhouse.js | 14 +- client/src/variants/Cwda.js | 512 +++++++++++++++--- client/src/variants/Cylinder.js | 2 +- client/src/variants/Diamond.js | 6 +- client/src/variants/Dice.js | 4 +- client/src/variants/Discoduel.js | 4 + client/src/variants/Dobutsu.js | 10 +- client/src/variants/Doublearmy.js | 21 +- client/src/variants/Eightpieces.js | 11 +- client/src/variants/Emergo.js | 6 +- client/src/variants/Empire.js | 22 +- client/src/variants/Fanorona.js | 4 + client/src/variants/Football.js | 24 +- client/src/variants/Fugue.js | 38 +- client/src/variants/Fullcavalry.js | 6 +- client/src/variants/Fusion.js | 17 +- client/src/variants/Gomoku.js | 4 + client/src/variants/Grand.js | 26 +- client/src/variants/Grasshopper.js | 4 +- client/src/variants/Hamilton.js | 4 + client/src/variants/Hidden.js | 5 + client/src/variants/Hiddenqueen.js | 4 +- client/src/variants/Hoppelpoppel.js | 16 +- client/src/variants/Horde.js | 18 +- client/src/variants/Hypnotic.js | 6 +- client/src/variants/Iceage.js | 4 +- client/src/variants/Interweave.js | 6 +- client/src/variants/Janggi.js | 22 +- client/src/variants/Joker.js | 6 +- client/src/variants/Knightmate1.js | 23 +- client/src/variants/Knightmate2.js | 23 +- client/src/variants/Knightpawns.js | 4 + client/src/variants/Konane.js | 4 + client/src/variants/Koopa.js | 4 +- client/src/variants/Madrasi.js | 4 +- client/src/variants/Maharajah.js | 21 +- client/src/variants/Makruk.js | 38 +- client/src/variants/Maxima.js | 27 +- client/src/variants/Mesmer.js | 6 +- client/src/variants/Minixiangqi.js | 2 +- client/src/variants/Monocolor.js | 4 +- client/src/variants/Monster.js | 51 +- client/src/variants/Musketeer.js | 78 +-- client/src/variants/Newzealand.js | 16 +- client/src/variants/Omega.js | 14 +- client/src/variants/Orda.js | 68 +-- client/src/variants/Ordamirror.js | 20 +- client/src/variants/Otage.js | 9 +- client/src/variants/Pacifist1.js | 18 +- client/src/variants/Pacosako.js | 4 +- client/src/variants/Pandemonium1.js | 4 +- client/src/variants/Pandemonium2.js | 41 +- client/src/variants/Parachute.js | 5 + client/src/variants/Pawnmassacre.js | 4 +- client/src/variants/Pawns.js | 4 + client/src/variants/Pawnsking.js | 4 + client/src/variants/Perfect.js | 36 +- client/src/variants/Pocketknight.js | 5 +- client/src/variants/Queenpawns.js | 4 + client/src/variants/Racingkings.js | 4 + client/src/variants/Recycle.js | 4 +- client/src/variants/Refusal1.js | 4 +- client/src/variants/Relayup.js | 2 +- client/src/variants/Rococo.js | 28 +- client/src/variants/Rollerball.js | 24 +- client/src/variants/Rookpawns.js | 4 + client/src/variants/Royalrace.js | 30 +- client/src/variants/Rugby.js | 6 +- client/src/variants/Schess.js | 32 +- client/src/variants/Screen.js | 4 + client/src/variants/Shako.js | 10 +- client/src/variants/Shatranj.js | 43 +- client/src/variants/Shinobi.js | 25 +- client/src/variants/Shogi.js | 38 +- client/src/variants/Shogun.js | 24 +- client/src/variants/Sittuyin.js | 29 +- client/src/variants/Spartan.js | 26 +- client/src/variants/Squatter2.js | 4 +- client/src/variants/Stealthbomb1.js | 9 +- client/src/variants/Stealthbomb2.js | 2 +- client/src/variants/Suction.js | 4 +- client/src/variants/Suicide.js | 6 +- client/src/variants/Swap.js | 4 +- client/src/variants/Synchrone1.js | 4 +- client/src/variants/Synchrone2.js | 4 +- client/src/variants/Synochess.js | 46 +- client/src/variants/Tencubed.js | 60 +- client/src/variants/Threechecks.js | 4 +- client/src/variants/Titan.js | 2 + client/src/variants/Twokings.js | 6 +- client/src/variants/Upsidedown.js | 6 +- client/src/variants/Vchess.js | 7 +- client/src/variants/Wildebeest.js | 27 +- client/src/variants/Wormhole1.js | 6 +- client/src/variants/Xiangqi.js | 22 +- client/src/variants/Yote.js | 6 +- client/src/variants/Zen.js | 20 +- client/src/views/Game.vue | 44 +- client/src/views/Hall.vue | 47 +- client/src/views/Rules.vue | 26 +- client/src/views/Variants.vue | 5 +- 174 files changed, 3936 insertions(+), 2123 deletions(-) create mode 100644 client/public/images/pieces/Cwda/bc.svg create mode 100644 client/public/images/pieces/Cwda/bf.svg create mode 100644 client/public/images/pieces/Cwda/bg.svg create mode 100644 client/public/images/pieces/Cwda/bi.svg create mode 100644 client/public/images/pieces/Cwda/bl.svg create mode 100644 client/public/images/pieces/Cwda/bo.svg create mode 100644 client/public/images/pieces/Cwda/bt.svg rename client/public/images/pieces/Cwda/{ba.svg => bw.svg} (100%) create mode 100644 client/public/images/pieces/Cwda/by.svg create mode 100644 client/public/images/pieces/Cwda/wc.svg create mode 100644 client/public/images/pieces/Cwda/wf.svg create mode 100644 client/public/images/pieces/Cwda/wg.svg create mode 100644 client/public/images/pieces/Cwda/wi.svg create mode 100644 client/public/images/pieces/Cwda/wl.svg create mode 100644 client/public/images/pieces/Cwda/wo.svg create mode 100644 client/public/images/pieces/Cwda/wt.svg rename client/public/images/pieces/Cwda/{wa.svg => ww.svg} (100%) create mode 100644 client/public/images/pieces/Cwda/wy.svg diff --git a/TODO b/TODO index 924b6d0e..473ea2d0 100644 --- a/TODO +++ b/TODO @@ -6,9 +6,18 @@ If new live game starts in background, "new game" notify OK but not first move. Will be used for variants with custom non-rectangular board (Hex, at least) Or, with other board shapes (see greenchess.net for example) -Merge variants 1, 2 (3) into one with sub-variant selection when starting a game (New Game + vs engine + analyse) -E.g. Checkered 1 & 2 into one, and so on. -Need additional field in variant code... in a generic way (radiobutton or select or checkbox?) +debug import game + load + +TODEBUG: Avalanche computer play from here +game.fen = "r2q1bnr/3pp3/n3k1p1/6Pp/3p1B1P/p5R1/1p6/4K1NR w 26 ihii 0"; +game.fenStart = "r2q1bnr/3pp3/n3k1p1/6Pp/3p1B1P/p5R1/1p6/4K1NR w 26 ihii 0"; +game.mycolor = 'w'; +Bd6,b1 then black promotes and win, but UI freezes. + +Merge Orda + Empire + Hoppelpoppel + Newzealand getSlideNJumpMoves() into base_rules.js +=> allow to simplify getPawnMoves in RoyalRace (and some getXMoves in Shatranj) + +Option "free placement" in Hidden #New variants: Chessplode @@ -16,7 +25,6 @@ Tablut https://brainking.com/fr/GameRules?tp=128 Massacre Chess -CWDA : need game options (also useful at least for Monster) PizzaKings https://www.chessvariants.com/unequal.dir/pizza-kings.html https://en.m.wikipedia.org/wiki/Chess_with_different_armies#Pizza_Kings%5B11%5D_(John_Lawson) diff --git a/client/public/images/pieces/Cwda/bc.svg b/client/public/images/pieces/Cwda/bc.svg new file mode 100644 index 00000000..c34593d7 --- /dev/null +++ b/client/public/images/pieces/Cwda/bc.svg @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/bf.svg b/client/public/images/pieces/Cwda/bf.svg new file mode 100644 index 00000000..9d51bfc9 --- /dev/null +++ b/client/public/images/pieces/Cwda/bf.svg @@ -0,0 +1,247 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/bg.svg b/client/public/images/pieces/Cwda/bg.svg new file mode 100644 index 00000000..899f4809 --- /dev/null +++ b/client/public/images/pieces/Cwda/bg.svg @@ -0,0 +1,88 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/bh.svg b/client/public/images/pieces/Cwda/bh.svg index 9d51bfc9..1b096435 100644 --- a/client/public/images/pieces/Cwda/bh.svg +++ b/client/public/images/pieces/Cwda/bh.svg @@ -5,32 +5,28 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="177.17" - height="177.17" - shape-rendering="geometricPrecision" - image-rendering="optimizeQuality" - fill-rule="evenodd" - clip-rule="evenodd" - viewBox="0 0 50 50" + height="100%" + width="100%" version="1.1" - id="svg974" - sodipodi:docname="ba.svg" - inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"> + viewBox="0 0 2048 2048" + id="svg16" + sodipodi:docname="bh.svg" + inkscape:version="1.0.2 (e86c870879, 2021-01-15)"> + id="metadata22"> image/svg+xml - + - - - - - - - - - - - - - - - - - - - + inkscape:current-layer="svg16" + inkscape:document-rotation="0" /> + + fill-rule="nonzero" + fill="#ffffff" + id="g14" + transform="matrix(1,0,0,-1,0,2030.1154)"> + style="color:#000000" + d="m 1290,1466 -42,-102 q -102,-22 -224,-22 -121,0 -222,22 l -42,101 q 124,-31 264,-31 138,0 266,32 z" + display="block" + id="path4" /> - - - - + style="color:#000000" + d="m 1206,1260 -29,-70 v -27 q -76,-11 -153,-11 -75,0 -152,11 l -1,27 -27,70 q 85,-15 180,-15 96,0 182,15 z" + display="block" + id="path6" /> + + + - - - - - - - + style="fill:#b22222;stroke:#000000;stroke-width:2.31937" + d="m 1001.38,1832.1886 c -39.68505,-7.0772 -75.02345,-32.2286 -95.45407,-67.9376 -21.25638,-37.1523 -21.37604,-95.589 -0.27125,-132.4764 10.89005,-19.0338 28.95274,-35.9683 54.63044,-51.2181 3.55589,-2.1118 1.04506,-5.7062 -20.2524,-28.9921 -50.29807,-54.9942 -97.8562,-97.4176 -195.5163,-174.4069 -87.07894,-68.6477 -111.49189,-99.4061 -134.423,-169.3621 -16.51279,-50.3757 -18.66368,-63.721 -18.59505,-115.3741 0.0893,-67.2689 7.39393,-100.6648 32.85312,-150.20221 16.66889,-32.43355 29.18938,-49.76489 49.60848,-68.66983 16.97168,-15.7132 59.87612,-45.4002 94.37803,-65.30335 14.17854,-8.1792 18.85707,-12.03593 17.9341,-14.78394 -0.68681,-2.04487 -24.01181,-60.07851 -51.83335,-128.96367 l -50.5846,-125.24576 16.41494,-6.45924 c 39.09328,-15.38313 130.21966,-37.87882 171.23265,-42.27093 9.6404,-1.0324 15.65568,-2.7395 15.65568,-4.443 0,-1.52153 -7.56693,-10.6712 -16.81541,-20.33259 -19.1029,-19.9558 -61.04944,-48.64292 -79.43827,-54.32763 -6.66732,-2.06114 -24.41356,-4.0735 -41.74859,-4.73415 -28.19458,-1.07451 -36.55024,-0.20503 -128.7248,13.39503 -93.59186,13.80918 -101.09295,14.57798 -148.43941,15.21422 -98.33847,1.32144 -147.21685,-7.96129 -212.72091,-40.39887 -23.00263,-11.39089 -51.6868,-32.1845 -51.6868,-37.46858 0,-1.49762 91.60139,-152.92249 93.89453,-155.21563 0.49214,-0.49214 4.39946,1.77833 8.68293,5.04549 22.28363,16.99655 56.26452,26.27892 108.48483,29.63419 l 38.26954,2.45891 142.641,-20.12454 c 78.45254,-11.06849 154.24877,-20.70398 168.43603,-21.4122 46.32015,-2.31227 77.51576,5.06583 129.60247,30.65239 32.09237,15.76473 69.95855,43.51679 89.19581,65.37148 11.95072,13.57673 23.72853,37.63867 30.73723,62.79563 2.922,10.48828 5.8346,19.0696 6.4724,19.0696 0.6378,0 3.5449,-8.60275 6.4601,-19.1172 7.0485,-25.42218 16.5664,-45.32961 27.4913,-57.49997 14.8169,-16.5062 58.7505,-52.93964 78.4984,-65.09752 22.2312,-13.68671 58.3527,-28.14897 82.859,-33.17492 35.1123,-7.20112 57.7897,-5.40822 220.995,17.47216 l 150.7811,21.13857 35.9502,-2.44678 c 50.8848,-3.46323 89.8636,-14.2889 111.0223,-30.83448 3.0202,-2.36168 6.2932,-3.79831 7.2734,-3.19251 2.0752,1.28251 91.876,146.89376 93.9911,152.40582 3.4151,8.89962 -46.0577,40.38553 -88.6416,56.41408 -44.685,16.81937 -78.6753,22.07964 -150.827,23.34172 -53.2544,0.93153 -64.2086,0.48997 -88.1359,-3.55273 -15.0278,-2.53906 -62.2877,-9.44518 -105.022,-15.34693 -69.0316,-9.53349 -81.0622,-10.6087 -107.8506,-9.63896 -36.1015,1.30687 -47.646,4.70954 -76.7848,22.63183 -20.8229,12.80749 -61.2174,50.03607 -61.2174,56.41945 0,2.19345 4.274,3.75304 13.3363,4.86642 36.1666,4.44335 98.9431,19.40032 152.7622,36.3967 l 37.3736,11.80281 -51.878,128.80464 c -28.5329,70.84254 -51.6134,129.03578 -51.2899,129.3183 0.3235,0.2825 16.2751,10.318 35.4481,22.30112 74.2055,46.37853 101.6667,73.47477 128.4234,126.71691 21.9093,43.59628 31.3835,87.89135 31.3542,146.59065 -0.021,40.3905 -3.1992,60.6357 -16.3442,104.085 -23.24,76.8169 -55.4753,119.547 -135.385,179.4618 -77.8737,58.3883 -137.634,110.836 -184.6502,162.0553 -40.2461,43.844 -38.1758,39.2708 -22.2329,49.1113 76.8351,47.4253 81.6693,160.2541 9.3166,217.4456 -29.577,23.3793 -70.0827,33.9595 -105.6968,27.6083 z m 45.7354,-518.2274 c 12.6126,-6.5222 13.9945,-13.504 13.9945,-70.7066 v -51.1006 h 49.9408 c 55.9386,0 62.6909,-1.3729 70.6067,-14.3564 3.4274,-5.6216 4.6809,-11.7147 4.6809,-22.7534 0,-11.0387 -1.2535,-17.1319 -4.6809,-22.7534 -7.9158,-12.9835 -14.6681,-14.3565 -70.6067,-14.3565 h -49.9408 v -50.683 c 0,-48.9419 -0.1821,-50.9538 -5.2989,-58.564 -12.3193,-18.32216 -51.3027,-18.32216 -63.62196,0 -5.11685,7.6102 -5.29889,9.6221 -5.29889,58.564 v 50.683 h -48.78118 c -51.87795,0 -59.17071,1.2293 -68.3468,11.5202 -3.89236,4.3653 -4.63873,8.4827 -4.63873,25.5897 0,17.1069 0.74637,21.2243 4.63873,25.5896 9.17609,10.291 16.46885,11.5202 68.3468,11.5202 h 48.78118 v 52.3009 c 0,63.2867 0.83963,65.9522 23.05825,73.2001 8.5007,2.7729 28.5065,0.7847 37.167,-3.6938 z m 49.0048,-437.40333 c 19.6517,-1.36497 45.6456,-3.71333 57.7643,-5.21857 l 22.034,-2.73681 1.4307,-15.07588 c 1.0504,-11.06845 5.1957,-23.98043 15.5944,-48.57466 7.7901,-18.42432 13.6923,-33.97027 13.116,-34.54654 -0.5763,-0.57627 -13.3342,0.67406 -28.351,2.77849 -57.619,8.07466 -77.8861,9.33354 -151.3892,9.40352 -74.58956,0.071 -100.46218,-1.51696 -154.81578,-9.50196 -14.35003,-2.10812 -26.63998,-3.28394 -27.31102,-2.6129 -0.67104,0.67104 4.68538,16.24064 11.90313,34.59911 8.97766,22.83483 13.57532,38.14144 14.55451,48.45494 l 1.4313,15.07588 24.35334,2.85716 c 63.6325,7.46543 138.19612,9.36915 199.68532,5.09822 z m 50.6165,-193.30316 c 37.4044,-4.04651 100.2599,-14.54013 102.3934,-17.0944 2.8078,-3.36162 41.8406,-100.76455 40.7978,-101.80738 -0.5934,-0.59332 -12.9199,1.55622 -27.3924,4.77678 -151.8852,33.79898 -335.38904,33.56934 -482.04212,-0.60324 -10.82831,-2.52317 -20.12444,-4.151 -20.65808,-3.61736 -0.53362,0.53364 8.46032,23.68138 19.98657,51.43941 l 20.9568,50.46914 19.41587,4.02016 c 25.04472,5.18562 81.6526,12.77725 115.66956,15.51234 39.25656,3.15638 170.953,1.22316 210.8726,-3.09545 z M 988.30167,469.98768 c -1.72408,-19.02583 -9.69945,-50.1926 -17.14436,-66.99788 l -4.88062,-11.01699 h -46.70553 -46.70551 l 13.52413,11.50307 c 16.9296,14.3996 36.36791,37.02786 54.37347,63.29648 l 13.9106,20.29445 h 17.58773 17.58775 z m 110.14763,8.38151 c 12.0271,-19.93759 37.6167,-51.694 55.1667,-68.46114 l 18.7726,-17.93524 h -45.9896 -45.9896 l -2.9633,6.37826 c -10.2625,22.08988 -18.6556,56.33199 -18.6556,76.11087 v 12.60487 h 17.2061 17.206 z" + id="path194" /> diff --git a/client/public/images/pieces/Cwda/bi.svg b/client/public/images/pieces/Cwda/bi.svg new file mode 100644 index 00000000..b31c14ed --- /dev/null +++ b/client/public/images/pieces/Cwda/bi.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/bl.svg b/client/public/images/pieces/Cwda/bl.svg new file mode 100644 index 00000000..1e669b49 --- /dev/null +++ b/client/public/images/pieces/Cwda/bl.svg @@ -0,0 +1,78 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/bo.svg b/client/public/images/pieces/Cwda/bo.svg new file mode 100644 index 00000000..282d9217 --- /dev/null +++ b/client/public/images/pieces/Cwda/bo.svg @@ -0,0 +1,103 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/bs.svg b/client/public/images/pieces/Cwda/bs.svg index c34593d7..a4aadfe8 100644 --- a/client/public/images/pieces/Cwda/bs.svg +++ b/client/public/images/pieces/Cwda/bs.svg @@ -1,6 +1,4 @@ - - - - - - - - - + height="100%" + width="100%" + version="1.1" + viewBox="0 0 2048 2048" + id="svg16" + sodipodi:docname="bs.svg" + inkscape:version="1.0.2 (e86c870879, 2021-01-15)"> + id="metadata22"> @@ -82,77 +25,69 @@ + + + + fill-rule="nonzero" + fill="#ffffff" + id="g14" + transform="matrix(1,0,0,-1,0,2048)"> + + style="color:#000000" + d="M 1024,496 H 512 v 46 l 73,55 h 879 l 71,-55 v -46 z" + display="block" + id="path6" /> + style="color:#000000" + d="M 1024,665 H 674 l 60,47 v 57 h 580 v -57 l 60,-47 z" + display="block" + id="path8" /> - - - - - - - + style="color:#000000" + d="M 1024,1211 H 734 v 46 l -60,58 h 700 l -60,-58 v -46 z" + display="block" + id="path10" /> + style="color:#000000" + d="M 1024,1383 H 610 l -46,43 v 58 h 920 v -58 l -46,-43 z" + display="block" + id="path12" /> - + diff --git a/client/public/images/pieces/Cwda/bt.svg b/client/public/images/pieces/Cwda/bt.svg new file mode 100644 index 00000000..17ba73f9 --- /dev/null +++ b/client/public/images/pieces/Cwda/bt.svg @@ -0,0 +1,88 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/ba.svg b/client/public/images/pieces/Cwda/bw.svg similarity index 100% rename from client/public/images/pieces/Cwda/ba.svg rename to client/public/images/pieces/Cwda/bw.svg diff --git a/client/public/images/pieces/Cwda/by.svg b/client/public/images/pieces/Cwda/by.svg new file mode 100644 index 00000000..b569a989 --- /dev/null +++ b/client/public/images/pieces/Cwda/by.svg @@ -0,0 +1,98 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/wc.svg b/client/public/images/pieces/Cwda/wc.svg new file mode 100644 index 00000000..ee56aff4 --- /dev/null +++ b/client/public/images/pieces/Cwda/wc.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/wf.svg b/client/public/images/pieces/Cwda/wf.svg new file mode 100644 index 00000000..0e249758 --- /dev/null +++ b/client/public/images/pieces/Cwda/wf.svg @@ -0,0 +1,285 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/wg.svg b/client/public/images/pieces/Cwda/wg.svg new file mode 100644 index 00000000..4290d9c3 --- /dev/null +++ b/client/public/images/pieces/Cwda/wg.svg @@ -0,0 +1,97 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/wh.svg b/client/public/images/pieces/Cwda/wh.svg index 0e249758..96843bf9 100644 --- a/client/public/images/pieces/Cwda/wh.svg +++ b/client/public/images/pieces/Cwda/wh.svg @@ -5,32 +5,28 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="177.17" - height="177.17" - shape-rendering="geometricPrecision" - image-rendering="optimizeQuality" - fill-rule="evenodd" - clip-rule="evenodd" - viewBox="0 0 50 50" + height="100%" + width="100%" version="1.1" - id="svg974" - sodipodi:docname="wWaffle.svg" - inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"> + viewBox="0 0 2048 2048" + id="svg18" + sodipodi:docname="wh.svg" + inkscape:version="1.0.2 (e86c870879, 2021-01-15)"> + id="metadata24"> image/svg+xml - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + inkscape:current-layer="svg18" + inkscape:document-rotation="0" /> + + style="color:#000000" + d="m 988,1120.1154 -83,1 q -34,0 -34,34 0,34 34,34 h 83 v 86 q 0,35 36,35 35,0 35,-35 v -86 h 86 q 33,0 33,-34 0,-34 -33,-34 h -86 v -82 q 0,-36 -35,-36 -36,0 -36,36 z m 36,-578.00002 q 68,0 132,11 64,11 125,28 -117,31 -257,31 -142,0 -257,-31 58,-16 123,-27 65,-11 134,-12 z m 0,1089.00002 q 68,0 68,68 0,68 -68,68 -68,0 -68,-68 0,-68 68,-68 z m 0,-949.00002 q 117,0 225,-23 l -48,123 q -88,14 -177,14 -91,0 -178,-14 l -48,-123 q 107,23 226,23 z m 0,182 q 97,0 186,-15 98,35 142,109 38,64.00002 38,141.00002 0,46 -23,101 -23,55 -75,101 -59,49 -129,107 -70,58 -139,137 -70,-78 -140,-136 -70,-58 -128,-108 -53,-45 -75,-100 -22,-55 -23,-102 0,-77 37,-141.00002 43,-74 143,-109 88,15 186,15 z m -36,-377 h -32 q -56,-90 -107,-113 -24,-12 -53,-22 -29,-10 -67,-10 -7,0 -107,16 -48,7 -76,15 -28,8 -44,10 -57,7 -133,-6 -46,-8 -86,-29 l 48,-78 q 12,12 31,15 19,3 36,8 42,7 80,2 13,-3 51,-7 38,-4 101,-15 75,-11 102,-11 105,0 161,40 34,26 64,72 30,46 31,113 z m 36,-113 q -14,-57 -34,-79 -20,-22 -53,-46 -36,-25 -85,-42 -49,-17 -109,-9 l -281,39 q -17,2 -30,0 -13,-2 -26,-2 -21,0 -53,-9 -32,-9 -51,-28 l -97,159 q 18,20 32,28 14,8 33,17 58,27 124,33 28,2 55,1 27,-1 56,2 54,-9 108,-16 54,-7 110,-16 60,0 81,12 11,6 35,22 24,16 48,47 -53,6 -108,20 -55,14 -97,31 l 104,258 q -78,45 -109,72 -31,27 -49,64 -26,46 -33,89.00002 -7,43 -7,77 1,60 28,132 27,72 104,130 63,48 123,99 60,51 119,119 -74,38 -74,121 0,56 39,96 39,40 97,40 56,0 96,-40 40,-40 40,-96 0,-82 -74,-121 58,-68 117,-119 59,-51 125,-99 75,-57 102,-129 27,-72 29,-133 0,-34 -7,-77 -7,-43.00002 -32,-89.00002 -20,-36 -50,-63 -30,-27 -108,-73 l 104,-258 q -44,-16 -99,-30 -55,-14 -106,-21 23,-31 47,-47 24,-16 36,-22 21,-12 81,-12 54,8 108,15 54,7 110,17 27,-3 54,-2 27,1 57,-1 64,-6 124,-33 18,-9 32,-17 14,-8 33,-28 l -98,-159 q -18,18 -50,27 -32,9 -53,10 -13,0 -26,2 -13,2 -31,0 l -280,-39 q -60,-9 -111,8 -51,17 -85,45 -33,27 -52,46 -19,19 -33,77 z m 35,113 q 0,-66 30,-112 30,-46 66,-73 55,-40 161,-40 26,0 102,11 62,10 100,14 38,4 51,8 38,5 80,-2 16,-4 35,-7 19,-3 33,-16 l 48,78 q -41,21 -87,29 -76,13 -133,6 -17,-2 -44,-10 -27,-8 -75,-15 -101,-16 -107,-16 -39,0 -68,10 -29,10 -52,22 -53,24 -108,113 z" + fill-rule="nonzero" + display="block" + fill="#000000" + id="path4" /> - - - - - - - - + fill-rule="nonzero" + fill="#ffffff" + id="g16" + transform="matrix(1,0,0,-1,0,2030.1154)"> + + style="color:#000000" + d="m 1024,399 q 68,0 68,-68 0,-68 -68,-68 -68,0 -68,68 0,68 68,68 z" + display="block" + id="path8" /> + + + + style="fill:#ffd700;stroke:#000000;stroke-width:2.31937" + d="m 947.17182,471.41109 c -30.45334,-45.32634 -64.86074,-80.9966 -91.76761,-95.13576 -22.95398,-12.06198 -61.45362,-26.6333 -81.08074,-30.68739 -26.67391,-5.50965 -51.01232,-4.28682 -116.05835,5.8311 -72.89746,11.33921 -76.88494,12.10192 -119.01258,22.76439 -33.45007,8.46618 -33.89255,8.5119 -82.33748,8.50794 -66.52062,-0.005 -108.55722,-7.30624 -155.48269,-27.00384 l -17.29486,-7.25975 5.09615,-8.37924 c 2.80289,-4.60858 13.30666,-21.68954 23.34173,-37.95769 l 18.24557,-29.57846 9.70164,5.52032 c 5.33589,3.03617 22.74806,8.43988 38.6937,12.00823 40.29849,9.0181 76.74353,9.11601 142.641,0.38322 26.78868,-3.55006 60.80841,-8.50481 75.5994,-11.01056 85.2588,-14.44374 136.26154,-18.40583 179.53084,-13.94666 71.73861,7.39311 116.60421,29.22282 153.48533,74.67949 36.13568,44.53787 51.19578,79.03611 55.36431,126.823 l 1.65194,18.9377 h -15.28893 -15.28896 z" + id="path98" /> + + + + style="fill:#ffd700;stroke:#000000;stroke-width:2.31937" + d="m 971.81427,1489.269 c -33.7343,-34.0367 -67.92481,-65.5709 -100.89241,-93.0538 C 727.7932,1276.898 712.94334,1262.0988 689.43513,1215.3477 c -35.64978,-70.8972 -38.89555,-152.0899 -8.95504,-224.01025 17.47633,-41.98002 48.40993,-80.56982 83.42688,-104.0754 20.8143,-13.97185 67.23106,-35.85433 75.65918,-35.66836 3.8513,0.085 19.52694,1.82817 34.83475,3.87375 49.50664,6.61557 86.90237,8.81829 149.5991,8.81183 64.5397,-0.007 103.5443,-2.40639 155.2128,-9.54937 35.4041,-4.89449 34.5399,-5.05898 71.4319,13.59618 49.5753,25.06869 85.7117,60.84318 109.4786,108.38215 49.3986,98.80777 32.1307,215.45167 -44.2309,298.77907 -8.1005,8.8394 -51.2582,46.4757 -95.906,83.6361 -92.232,76.7649 -127.2998,108.6652 -166.9212,151.8437 -15.2675,16.6383 -28.314,30.1466 -28.992,30.0184 -0.6781,-0.1281 -24.1946,-23.4006 -52.25893,-51.7165 z m 74.36703,-183.3493 c 12.8571,-8.4243 13.7046,-12.2248 14.5769,-65.3684 l 0.808,-49.2261 47.8987,-0.7453 c 55.0636,-0.8567 59.784,-2.1479 66.1661,-18.0983 4.7794,-11.9451 4.7794,-22.9297 0,-34.8748 -6.3581,-15.8903 -11.0983,-17.1878 -66.1595,-18.1099 l -47.892,-0.8019 -0.8887,-46.7677 c -0.9815,-51.6509 -2.6343,-58.5058 -15.7406,-65.2833 -10.1912,-5.27 -34.187,-4.6222 -43.7036,1.1799 -12.77518,7.7888 -14.35645,15.0548 -14.35645,65.968 v 45.3021 l -41.16875,0.1009 c -48.20479,0.1183 -59.1611,1.7612 -67.52557,10.1257 -5.64188,5.642 -6.11429,7.6295 -6.11429,25.7236 0,18.0106 0.49019,20.0993 6.013,25.6222 8.62666,8.6266 18.87421,10.2104 66.46718,10.2726 l 42.32843,0.055 v 44.9378 c 0,48.9596 0.71455,55.7952 6.65597,63.6719 8.67818,11.505 39.13738,15.1598 52.63518,6.3157 z" + id="path106" /> + style="fill:#ffd700;stroke:#000000;stroke-width:2.31937" + d="m 997.32729,1762.3466 c -16.51064,-5.022 -26.29282,-13.3548 -33.30723,-28.3726 -5.20533,-11.1445 -6.07755,-16.1561 -6.09806,-35.0385 -0.0216,-19.8695 0.65961,-23.4011 6.93417,-35.9502 5.32746,-10.6549 9.47402,-15.4484 17.69378,-20.4544 22.68075,-13.8128 60.21935,-13.8128 82.90005,0 8.2198,5.006 12.3664,9.7995 17.6938,20.4544 6.2664,12.5327 6.9581,16.1067 6.9581,35.9502 0,19.8434 -0.6917,23.4174 -6.9581,35.9501 -4.307,8.6142 -9.9728,15.9127 -14.8709,19.1563 -17.8607,11.8278 -47.8295,15.3358 -70.94561,8.3047 z" + id="path108" /> diff --git a/client/public/images/pieces/Cwda/wi.svg b/client/public/images/pieces/Cwda/wi.svg new file mode 100644 index 00000000..38d59912 --- /dev/null +++ b/client/public/images/pieces/Cwda/wi.svg @@ -0,0 +1,64 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/wl.svg b/client/public/images/pieces/Cwda/wl.svg new file mode 100644 index 00000000..44814bb1 --- /dev/null +++ b/client/public/images/pieces/Cwda/wl.svg @@ -0,0 +1,133 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/wo.svg b/client/public/images/pieces/Cwda/wo.svg new file mode 100644 index 00000000..2524dba6 --- /dev/null +++ b/client/public/images/pieces/Cwda/wo.svg @@ -0,0 +1,190 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/ws.svg b/client/public/images/pieces/Cwda/ws.svg index ee56aff4..539083de 100644 --- a/client/public/images/pieces/Cwda/ws.svg +++ b/client/public/images/pieces/Cwda/ws.svg @@ -1,6 +1,4 @@ - - - - - - - - - + height="100%" + width="100%" + version="1.1" + viewBox="0 0 2048 2048" + id="svg18" + sodipodi:docname="ws.svg" + inkscape:version="1.0.2 (e86c870879, 2021-01-15)"> + id="metadata24"> image/svg+xml - + + + + fill-rule="nonzero" + fill="#ffffff" + id="g12" + transform="matrix(1,0,0,-1,0,2048)"> + + style="color:#000000" + d="M 1484,1468 H 564 v 136 h 920 z" + display="block" + id="path6" /> + style="color:#000000" + d="M 1314,751 H 734 v 478 h 580 z" + display="block" + id="path8" /> - - - - - - - + style="color:#000000" + d="M 1536,512 V 273 H 1399 V 410 H 1091 V 273 H 956 V 410 H 649 V 273 H 512 v 239 z" + display="block" + id="path10" /> - + + + + + + + + diff --git a/client/public/images/pieces/Cwda/wt.svg b/client/public/images/pieces/Cwda/wt.svg new file mode 100644 index 00000000..90291260 --- /dev/null +++ b/client/public/images/pieces/Cwda/wt.svg @@ -0,0 +1,95 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Cwda/wa.svg b/client/public/images/pieces/Cwda/ww.svg similarity index 100% rename from client/public/images/pieces/Cwda/wa.svg rename to client/public/images/pieces/Cwda/ww.svg diff --git a/client/public/images/pieces/Cwda/wy.svg b/client/public/images/pieces/Cwda/wy.svg new file mode 100644 index 00000000..75bdb6d8 --- /dev/null +++ b/client/public/images/pieces/Cwda/wy.svg @@ -0,0 +1,69 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 0c20b59e..7c1c8232 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -40,7 +40,7 @@ export const ChessRules = class ChessRules { { label: "Randomness", variable: "randomness", - defaut: 2, + defaut: 0, options: [ { label: "Deterministic", value: 0 }, { label: "Symmetric random", value: 1 }, @@ -58,6 +58,10 @@ export const ChessRules = class ChessRules { //return "R" + opts.randomness; } + static IsValidOptions(opts) { + return true; + } + // Some variants don't have flags: static get HasFlags() { return true; @@ -368,8 +372,7 @@ export const ChessRules = class ChessRules { // Setup the initial random (asymmetric) position static GenRandInitFen(options) { - const randomness = parseInt(options.randomness, 10); - if (!randomness || randomness == 0) + if (!options.randomness || options.randomness == 0) // Deterministic: return "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w 0 ahah -"; @@ -746,14 +749,15 @@ export const ChessRules = class ChessRules { // Generic method to find possible moves of non-pawn pieces: // "sliding or jumping" - getSlideNJumpMoves([x, y], steps, oneStep) { + getSlideNJumpMoves([x, y], steps, nbSteps) { let moves = []; outerLoop: for (let step of steps) { let i = x + step[0]; let j = y + step[1]; + let stepCounter = 0; while (V.OnBoard(i, j) && this.board[i][j] == V.EMPTY) { moves.push(this.getBasicMove([x, y], [i, j])); - if (!!oneStep) continue outerLoop; + if (nbSteps && ++stepCounter >= nbSteps) continue outerLoop; i += step[0]; j += step[1]; } @@ -895,7 +899,7 @@ export const ChessRules = class ChessRules { // What are the knight moves from square x,y ? getPotentialKnightMoves(sq) { - return this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT], "oneStep"); + return this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT], 1); } // What are the bishop moves from square x,y ? @@ -906,19 +910,14 @@ export const ChessRules = class ChessRules { // What are the queen moves from square x,y ? getPotentialQueenMoves(sq) { return this.getSlideNJumpMoves( - sq, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]) - ); + sq, V.steps[V.ROOK].concat(V.steps[V.BISHOP])); } // What are the king moves from square x,y ? getPotentialKingMoves(sq) { // Initialize with normal moves let moves = this.getSlideNJumpMoves( - sq, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]), - "oneStep" - ); + sq, V.steps[V.ROOK].concat(V.steps[V.BISHOP]), 1); if (V.HasCastle && this.castleFlags[this.turn].some(v => v < V.size.y)) moves = moves.concat(this.getCastleMoves(sq)); return moves; @@ -1102,13 +1101,18 @@ export const ChessRules = class ChessRules { // Generic method for non-pawn pieces ("sliding or jumping"): // is x,y attacked by a piece of given color ? - isAttackedBySlideNJump([x, y], color, piece, steps, oneStep) { + isAttackedBySlideNJump([x, y], color, piece, steps, nbSteps) { for (let step of steps) { let rx = x + step[0], ry = y + step[1]; - while (V.OnBoard(rx, ry) && this.board[rx][ry] == V.EMPTY && !oneStep) { + let stepCounter = 1; + while ( + V.OnBoard(rx, ry) && this.board[rx][ry] == V.EMPTY && + (!nbSteps || stepCounter < nbSteps) + ) { rx += step[0]; ry += step[1]; + stepCounter++; } if ( V.OnBoard(rx, ry) && diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index 7627f2dc..4b6529ff 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -167,7 +167,8 @@ export default { baseGameDiv.tabIndex = 0; baseGameDiv.addEventListener("click", this.focusBg); baseGameDiv.addEventListener("keydown", this.handleKeys); - baseGameDiv.addEventListener("wheel", this.handleScroll); + if (this.st.settings.scrollmove) + baseGameDiv.addEventListener("wheel", this.handleScroll); } document.getElementById("eogDiv") .addEventListener("click", processModalClick); @@ -340,6 +341,7 @@ export default { pgn += '[Url "' + params.serverUrl + '/game/' + this.game.id + '"]\n'; if (!!this.game.cadence) pgn += '[Cadence "' + this.game.cadence + '"]\n'; + pgn += '[Options "' + JSON.stringify(this.game.options) + '"]\n'; pgn += '\n'; for (let i = 0; i < this.moves.length; i += 2) { if (i > 0) pgn += " "; diff --git a/client/src/components/ChallengeList.vue b/client/src/components/ChallengeList.vue index 21179a65..a1c46cdc 100644 --- a/client/src/components/ChallengeList.vue +++ b/client/src/components/ChallengeList.vue @@ -62,17 +62,14 @@ export default { return c.to || this.st.tr["Any player"]; return c.from.name || "@nonymous"; }, + // TODO: duplicated from Hall getRandomnessClass: function(c) { - if ( - // TODO: one extra test here - !Number.isInteger(c.options.randomness) && - !parseInt(c.options.randomness, 10) - ) { + const opts = c.options; + if (opts.randomness === undefined && opts.random === undefined) return {}; - } - return { - ["random-" + c.options.randomness]: true - }; + if (opts.randomness !== undefined) + return { ["random-" + opts.randomness]: true }; + return { ["random-" + (opts.random ? 2 : 0)]: true }; } } }; diff --git a/client/src/components/Settings.vue b/client/src/components/Settings.vue index 514e7049..e04cbdfa 100644 --- a/client/src/components/Settings.vue +++ b/client/src/components/Settings.vue @@ -60,6 +60,13 @@ div type="checkbox" v-model="st.settings.gotonext" ) + fieldset(v-if="desktopBrowser") + label(for="setScrollmove") + | {{ st.tr["Mouse scroll to replay moves"] }} + input#setScrollmove( + type="checkbox" + v-model="st.settings.scrollmove" + )