make premium for playing seven tiles configurable (system wide)
authorLaurent Mazet <mazet@softndesign.org>
Fri, 23 Oct 2020 19:40:16 +0000 (21:40 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Fri, 23 Oct 2020 19:40:16 +0000 (21:40 +0200)
public/config.js.sample
public/trivabble.js

index 90b18f2d8c78f4309cdd18decd5763fa9ff3472b..0a9e65c45a7bfb471aa48ee7661d1b185d47cbf2 100644 (file)
@@ -32,6 +32,8 @@ window.TrivabbleConf = {
     // The defaut double tap duration. If not set, the value at the middle of the previous array is used.
     DOUBLE_TAP_DURATION: 1800,
 
+    // The default premium for playing seven tiles on a turn
+    PREMIUM_SEVEN_TILES: 50,
 
     // I don't like trailing commas, here is a nice message for you reading this file :-)
     HAVE_FUN: true
index 8546f429093301a337baca340d525ddada04436a..d7e3b50979697cc900209d66f1f6a235885e3104 100644 (file)
@@ -59,6 +59,7 @@
     setConf("FLASH_LIGHT_DURATIONS", [800, 1600, 3200]);
     setConf("FLASH_LIGHT_DURATION",  middle("FLASH_LIGHT_DURATIONS"));
     setConf("FLASH_LIGHT_COLOR",     "#ee6633");
+    setConf("PREMIUM_SEVEN_TILES",   50);
 
     function getSetting(key) {
         let type;
 
         /* Check for trivabble */
         if (Object.keys(currentTilePlayed).length === 7) {
-            totalScore += 50;
+            totalScore += getSetting("PREMIUM_SEVEN_TILES");
         }
 
         /* Confirm score */