From 4ddd84885b77cd19b833bc7c55155363da44a2e4 Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Fri, 23 Oct 2020 21:40:16 +0200 Subject: [PATCH] make premium for playing seven tiles configurable (system wide) --- public/config.js.sample | 2 ++ public/trivabble.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/public/config.js.sample b/public/config.js.sample index 90b18f2..0a9e65c 100644 --- a/public/config.js.sample +++ b/public/config.js.sample @@ -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 diff --git a/public/trivabble.js b/public/trivabble.js index 8546f42..d7e3b50 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -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; @@ -1873,7 +1874,7 @@ /* Check for trivabble */ if (Object.keys(currentTilePlayed).length === 7) { - totalScore += 50; + totalScore += getSetting("PREMIUM_SEVEN_TILES"); } /* Confirm score */ -- 2.30.2