From 6b7b2cf720e6255e4da0dc34fee363c456346a58 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Thu, 12 Mar 2020 12:11:22 +0100 Subject: [PATCH] Some fixes, work on Eightpieces draft, add a few capturing variants --- TODO | 5 +- client/src/base_rules.js | 4 +- client/src/components/Settings.vue | 4 +- client/src/translations/en.js | 6 +- client/src/translations/es.js | 6 +- client/src/translations/fr.js | 6 +- client/src/translations/rules/Capture/en.pug | 22 ++ client/src/translations/rules/Capture/es.pug | 23 ++ client/src/translations/rules/Capture/fr.pug | 23 ++ client/src/translations/rules/Losers/en.pug | 29 +-- client/src/translations/rules/Losers/es.pug | 33 +-- client/src/translations/rules/Losers/fr.pug | 31 +-- .../src/translations/rules/Racingkings/en.pug | 30 +++ .../src/translations/rules/Racingkings/es.pug | 31 +++ .../src/translations/rules/Racingkings/fr.pug | 31 +++ .../src/translations/rules/Royalrace/en.pug | 2 +- .../src/translations/rules/Royalrace/es.pug | 2 +- .../src/translations/rules/Royalrace/fr.pug | 2 +- client/src/translations/rules/Suicide/en.pug | 30 +++ client/src/translations/rules/Suicide/es.pug | 33 +++ client/src/translations/rules/Suicide/fr.pug | 33 +++ client/src/utils/gameStorage.js | 14 +- client/src/variants/Alice.js | 3 +- client/src/variants/Capture.js | 48 ++++ client/src/variants/Eightpieces.js | 143 ++++++++++-- client/src/variants/Extinction.js | 6 +- client/src/variants/Losers.js | 208 +++-------------- client/src/variants/Racingkings.js | 63 ++++++ client/src/variants/Royalrace.js | 13 +- client/src/variants/Suicide.js | 210 ++++++++++++++++++ client/src/variants/Threechecks.js | 2 +- client/src/views/Hall.vue | 7 +- client/src/views/MyGames.vue | 17 +- client/src/views/Rules.vue | 3 +- server/db/populate.sql | 7 +- 35 files changed, 825 insertions(+), 305 deletions(-) create mode 100644 client/src/translations/rules/Capture/en.pug create mode 100644 client/src/translations/rules/Capture/es.pug create mode 100644 client/src/translations/rules/Capture/fr.pug create mode 100644 client/src/translations/rules/Racingkings/en.pug create mode 100644 client/src/translations/rules/Racingkings/es.pug create mode 100644 client/src/translations/rules/Racingkings/fr.pug create mode 100644 client/src/translations/rules/Suicide/en.pug create mode 100644 client/src/translations/rules/Suicide/es.pug create mode 100644 client/src/translations/rules/Suicide/fr.pug create mode 100644 client/src/variants/Capture.js create mode 100644 client/src/variants/Racingkings.js create mode 100644 client/src/variants/Suicide.js diff --git a/TODO b/TODO index 51e8e48c..a993b216 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +Revise variants code by using more aggregate/disaggregate flags functions? + # New variants 8-pieces https://www.youtube.com/watch?v=XZ8K02Da7Ps&list=PLRyjH8DPuzTBiym6lA0r84P8N0HnTtZyN&index=6&t=0s https://www.chessvariants.com/rules/8-piece-chess "Eightpieces" @@ -17,9 +19,6 @@ https://www.chessvariants.com/diffsetup.dir/unachess.html Rugby http://www.echecspourtous.com/?page_id=7945 -"Capture" Chess (idea of opperwezen, maybe not new): captures are forced, -but the goal is still to checkmate (not lose all material). - Cannibal Chess with forced captures. Knightrelay: implement "official" version as Knightrelay v1 diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 1c5eabca..33b0fc90 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -1058,7 +1058,7 @@ export const ChessRules = class ChessRules { play(move) { // DEBUG: // if (!this.states) this.states = []; -// const stateFen = this.getBaseFen() + this.getTurnFen() + this.getFlagsFen(); +// const stateFen = this.getBaseFen() + this.getTurnFen();// + this.getFlagsFen(); // this.states.push(stateFen); if (V.HasFlags) move.flags = JSON.stringify(this.aggregateFlags()); //save flags (for undo) @@ -1078,7 +1078,7 @@ export const ChessRules = class ChessRules { this.unupdateVariables(move); // DEBUG: -// const stateFen = this.getBaseFen() + this.getTurnFen() + this.getFlagsFen(); +// const stateFen = this.getBaseFen() + this.getTurnFen();// + this.getFlagsFen(); // if (stateFen != this.states[this.states.length-1]) debugger; // this.states.pop(); } diff --git a/client/src/components/Settings.vue b/client/src/components/Settings.vue index 5b79e06e..d2194dae 100644 --- a/client/src/components/Settings.vue +++ b/client/src/components/Settings.vue @@ -60,7 +60,7 @@ div v-model="st.settings.gotonext" ) fieldset - label(for="setRandomness") {{ st.tr["Randomness against computer"] }} + label(for="setRandomness") {{ st.tr["Randomness"] }} select#setRandomness(v-model="st.settings.randomness") option(value="0") {{ st.tr["Deterministic"] }} option(value="1") {{ st.tr["Symmetric random"] }} @@ -110,7 +110,7 @@ export default {